SlideShare a Scribd company logo
1 of 39
Getting started with
OpenAI and Data
science
SUSAN IBACH | HOCKEYGEEKGIRL
SUSAN.IBACH@LIVE.COM
You can't go
anywhere these
days without
hearing about
Generative AI
AI won't replace you, but someone with your skills + AI might
Coders are more productive when they
use AI to help them code
 Over 80% of coders say they are more productive when they use a code helper
such as GitHub Copilot
 74% say it enables them to focus on more satisfying work
 96% say they are faster completing repetitive tasks
 When studying two control groups, the group using a built in AI to help with
coding completed their tasks 50% faster
Okay I get it Susan this AI thing
looks useful, how do I get
started using it for data
science?
You could just
open up ChatGPT
ask it to write code
for you then copy
& paste
But the real win is doing it inside your IDE!
This Photo by Unknown Author is licensed under CC BY
Step 1
Find a Large
Language Model
(LLM) you can install
inside your IDE
This takes a bit
of research
OpenAI – Owned by Microsoft
Codeium – VS Code, Vim, Jupyter Notebook, Eclipse
GitHub Copilot – comes as an extension for VS Code, Visual
Studio, JetBrains
Obsidian Integration, heroml, Superpower extension,
llmops.space, cursor.so, ChatGPT, CometLLM, Cohere
I use Jupyter
notebooks so
I'm going with
Jupyter AI
Jupyter AI is
vendor neutral
and can
connect to
different LLMs
 AI21
 Anthropic
 AWS
 Cohere
 HuggingFace Hub
 OpenAI
I chose OpenAI
because I had
played with it a
bit already
Step 2
Install the
extension or
library in your IDE
If you want to use Jupyter AI with OpenAI
in a Jupyter Notebook
Software versions required
 Requires Jupyter Lab 4
 Python 3.8 – 3.11 (I installed Python 3.11.6 64 bit)
Accounts required (you can start with the free version)
 OpenAI
If you want to use Jupyter AI with OpenAI
in a Jupyter Notebook
Install the openai library
 pip install openai
Create an environment variable and set it to the API key for your OpenAI account
 OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
 Each LLM supported has a specific environment variable name
Install the jupyter_ai extension
 load_ext jupyter_ai
Not all OpenAI models are created equal
Version GPT-3.5 Turbo GPT-4.0
Speed Faster Slower
Database size 10X size of ChatGPT 3.5
and can handle images
Quality of output 40% more likely to
produce factual responses
than 3.5, better at dialects
$ Input / 1000 tokens $0.00005 $0.03
$ Output / 1000 tokens $0.0015 $0.06
You can find more information on pricing at openai.com
So what is a token anyway?
You can think of tokens as pieces of words
Wayne Gretzky’s quote "You miss 100% of the shots you don't take" contains 11 tokens
1 token is about 4 characters in English
1 English word is typically 1.3 tokens
1 French word is typically 2 tokens
Punctuation marks are counted as one token
Special characters are one to three tokens
Emojis are between two to three tokens
Step 3
Try a hello world
type command
Ask the AI to create "Hello World"
%%ai chatgpt --format code
display a message that says hello world
Possible successful outputs include
print("Hello World")
System.out.println("Hello World");
console.log("Hello World");
echo "Hello World";
Step 4
Evaluate the
suggested code
AI does not replace programmers.
Programmers with AI replace programmers
 There is more than one way to write code to complete a task
 LLMs make an educated guess based on code it has seen in the past
 The coder provides the knowledge to evaluate the suggestion from the AI and make
modifications to the prompt as needed (referred to as prompt engineering)
Curious about
pricing?
How much did that cost?
How many tokens and calls was it?
Step 5
Now we can play!
Maybe I need a
dataframe with
some sample
data
Maybe I forgot the
syntax for returning
entries that start
with a particular
letter
Let's read a .csv file
and then do some
linear regression
Let's read a .csv file
and then do some
linear regression
ValueError: Input y
contains NaN
AI does not replace
programmers.
Programmers with AI
replace
programmers
What would a
coder do? We'd
get rid of the rows
with Nulls and try
again!
Victory!
I have successfully
produced a plot but if
you don't know how
to read it this isn't
going to help you 
AI does not replace
data scientists. Data
scientists with AI
replace data
scientists
Until today, I have never done a
live code demo
- with this much code
- in a session this short
- without having to look up
method names and parameters
- without spending time in the
session having the audience
help me find my typing mistakes
AI doesn't replace
presenters.
Presenters with AI
replace presenters
References
ChatGPT
Open AI
Project Jupyter | Installing Jupyter
Generative AI in Jupyter. Jupyter AI, a new open source project… | by Jason Weill | Jupyter Blog
GitHub - jupyterlab/jupyter-ai: A generative AI extension for JupyterLab
What are tokens and how to count them
OpenAI Pricing
Questions?
SUSAN IBACH | HOCKEYGEEKGIRL
SUSAN.IBACH@LIVE.COM
Thank you!

More Related Content

Similar to Confoo 2024 Gettings started with OpenAI and data science

ChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano FirtmanChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano FirtmanWey Wey Web
 
Open Source Security and ChatGPT-Published.pdf
Open Source Security and ChatGPT-Published.pdfOpen Source Security and ChatGPT-Published.pdf
Open Source Security and ChatGPT-Published.pdfJavier Perez
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its ApplicationsAbhijeet Singh
 
Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Sapna Tyagi
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
Breaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI TechnologyBreaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI TechnologySafe Software
 
Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox Animesh Singh
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonCodeOps Technologies LLP
 
A Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureA Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureNick Kridler
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP codeGabriele Santini
 
API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards 25-6-2014API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards 25-6-2014openi_ict
 
API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards   25-6-2014API Athens Meetup - API standards   25-6-2014
API Athens Meetup - API standards 25-6-2014Michael Petychakis
 
Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedWojciech Koszek
 
OpenAI GPT in Depth - Questions and Misconceptions
OpenAI GPT in Depth - Questions and MisconceptionsOpenAI GPT in Depth - Questions and Misconceptions
OpenAI GPT in Depth - Questions and MisconceptionsIvo Andreev
 
PHP Interview Questions for Freshers 2018
PHP Interview Questions for Freshers 2018PHP Interview Questions for Freshers 2018
PHP Interview Questions for Freshers 2018AshokKumar3319
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python ProgrammingDozie Agbo
 

Similar to Confoo 2024 Gettings started with OpenAI and data science (20)

ChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano FirtmanChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano Firtman
 
Walter api
Walter apiWalter api
Walter api
 
Open Source Security and ChatGPT-Published.pdf
Open Source Security and ChatGPT-Published.pdfOpen Source Security and ChatGPT-Published.pdf
Open Source Security and ChatGPT-Published.pdf
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
 
Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
Breaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI TechnologyBreaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI Technology
 
Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
 
A Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source AdventureA Year of Pyxley: My First Open Source Adventure
A Year of Pyxley: My First Open Source Adventure
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP code
 
LVPHP.org
LVPHP.orgLVPHP.org
LVPHP.org
 
API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards 25-6-2014API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards 25-6-2014
 
API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards   25-6-2014API Athens Meetup - API standards   25-6-2014
API Athens Meetup - API standards 25-6-2014
 
Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
 
From open source labs to ceo methods and advice by sysfera
From open source labs to ceo methods and advice by sysferaFrom open source labs to ceo methods and advice by sysfera
From open source labs to ceo methods and advice by sysfera
 
OpenAI GPT in Depth - Questions and Misconceptions
OpenAI GPT in Depth - Questions and MisconceptionsOpenAI GPT in Depth - Questions and Misconceptions
OpenAI GPT in Depth - Questions and Misconceptions
 
PHP Interview Questions for Freshers 2018
PHP Interview Questions for Freshers 2018PHP Interview Questions for Freshers 2018
PHP Interview Questions for Freshers 2018
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
 
Performance Tuning with XHProf
Performance Tuning with XHProfPerformance Tuning with XHProf
Performance Tuning with XHProf
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Confoo 2024 Gettings started with OpenAI and data science

  • 1. Getting started with OpenAI and Data science SUSAN IBACH | HOCKEYGEEKGIRL SUSAN.IBACH@LIVE.COM
  • 2. You can't go anywhere these days without hearing about Generative AI
  • 3. AI won't replace you, but someone with your skills + AI might
  • 4. Coders are more productive when they use AI to help them code  Over 80% of coders say they are more productive when they use a code helper such as GitHub Copilot  74% say it enables them to focus on more satisfying work  96% say they are faster completing repetitive tasks  When studying two control groups, the group using a built in AI to help with coding completed their tasks 50% faster
  • 5. Okay I get it Susan this AI thing looks useful, how do I get started using it for data science?
  • 6. You could just open up ChatGPT ask it to write code for you then copy & paste
  • 7. But the real win is doing it inside your IDE! This Photo by Unknown Author is licensed under CC BY
  • 8. Step 1 Find a Large Language Model (LLM) you can install inside your IDE
  • 9. This takes a bit of research OpenAI – Owned by Microsoft Codeium – VS Code, Vim, Jupyter Notebook, Eclipse GitHub Copilot – comes as an extension for VS Code, Visual Studio, JetBrains Obsidian Integration, heroml, Superpower extension, llmops.space, cursor.so, ChatGPT, CometLLM, Cohere
  • 10. I use Jupyter notebooks so I'm going with Jupyter AI
  • 11. Jupyter AI is vendor neutral and can connect to different LLMs  AI21  Anthropic  AWS  Cohere  HuggingFace Hub  OpenAI
  • 12. I chose OpenAI because I had played with it a bit already
  • 13. Step 2 Install the extension or library in your IDE
  • 14. If you want to use Jupyter AI with OpenAI in a Jupyter Notebook Software versions required  Requires Jupyter Lab 4  Python 3.8 – 3.11 (I installed Python 3.11.6 64 bit) Accounts required (you can start with the free version)  OpenAI
  • 15. If you want to use Jupyter AI with OpenAI in a Jupyter Notebook Install the openai library  pip install openai Create an environment variable and set it to the API key for your OpenAI account  OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx  Each LLM supported has a specific environment variable name Install the jupyter_ai extension  load_ext jupyter_ai
  • 16. Not all OpenAI models are created equal Version GPT-3.5 Turbo GPT-4.0 Speed Faster Slower Database size 10X size of ChatGPT 3.5 and can handle images Quality of output 40% more likely to produce factual responses than 3.5, better at dialects $ Input / 1000 tokens $0.00005 $0.03 $ Output / 1000 tokens $0.0015 $0.06 You can find more information on pricing at openai.com
  • 17. So what is a token anyway? You can think of tokens as pieces of words Wayne Gretzky’s quote "You miss 100% of the shots you don't take" contains 11 tokens 1 token is about 4 characters in English 1 English word is typically 1.3 tokens 1 French word is typically 2 tokens Punctuation marks are counted as one token Special characters are one to three tokens Emojis are between two to three tokens
  • 18. Step 3 Try a hello world type command
  • 19. Ask the AI to create "Hello World" %%ai chatgpt --format code display a message that says hello world Possible successful outputs include print("Hello World") System.out.println("Hello World"); console.log("Hello World"); echo "Hello World";
  • 21. AI does not replace programmers. Programmers with AI replace programmers  There is more than one way to write code to complete a task  LLMs make an educated guess based on code it has seen in the past  The coder provides the knowledge to evaluate the suggestion from the AI and make modifications to the prompt as needed (referred to as prompt engineering)
  • 23. How much did that cost?
  • 24. How many tokens and calls was it?
  • 25. Step 5 Now we can play!
  • 26. Maybe I need a dataframe with some sample data
  • 27. Maybe I forgot the syntax for returning entries that start with a particular letter
  • 28. Let's read a .csv file and then do some linear regression
  • 29. Let's read a .csv file and then do some linear regression
  • 31. AI does not replace programmers. Programmers with AI replace programmers
  • 32. What would a coder do? We'd get rid of the rows with Nulls and try again!
  • 33. Victory! I have successfully produced a plot but if you don't know how to read it this isn't going to help you 
  • 34. AI does not replace data scientists. Data scientists with AI replace data scientists
  • 35. Until today, I have never done a live code demo - with this much code - in a session this short - without having to look up method names and parameters - without spending time in the session having the audience help me find my typing mistakes
  • 36. AI doesn't replace presenters. Presenters with AI replace presenters
  • 37. References ChatGPT Open AI Project Jupyter | Installing Jupyter Generative AI in Jupyter. Jupyter AI, a new open source project… | by Jason Weill | Jupyter Blog GitHub - jupyterlab/jupyter-ai: A generative AI extension for JupyterLab What are tokens and how to count them OpenAI Pricing
  • 38. Questions? SUSAN IBACH | HOCKEYGEEKGIRL SUSAN.IBACH@LIVE.COM