You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add link for dashboard to API key
* Update claude model and prompt
* Add dynamically updated libraries in code-interpreter
* Add loading of .env to code examples
* Syntax errors + missing dotenv imports
* more fixes + edited sbx.upload example
* add sandbox spawn for connect example
* fix sandbox/connect highlights
* removing dotenv import from code snippets
* move libraries info from component
* last dotenv remove
* unified single quotes for imports
* Remove/unify dotenv imports
* fix spaces + code snippet
Copy file name to clipboardExpand all lines: docs/code-interpreting/analyze-data-with-ai.mdx
+34-16Lines changed: 34 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,12 +140,16 @@ These are the columns:
140
140
- 'vote_average': float number between 0 and 10 that's representing viewers voting average
141
141
- 'vote_count': int for how many viewers voted
142
142
143
-
I want to better understand how the vote average has changed over the years. Write Python code that analyzes the dataset based on my request and produces right chart accordingly`
143
+
Write Python code that creates a line chart showing how vote_average changed over the years.
144
+
Do NOT print or explore the data. Just create the visualization directly.
145
+
146
+
CRITICAL: Your code MUST end with this exact line to display the plot:
I have a CSV file about movies. It has about 10k rows. It's saved in the sandbox at {datasetPathInSandbox.path}.
161
+
prompt =f'''
162
+
I have a CSV file about movies. It has about 10k rows. It's saved in the sandbox at {dataset_path_in_sandbox.path}.
159
163
These are the columns:
160
164
- 'id': number, id of the movie
161
165
- 'original_language': string like "eng", "es", "ko", etc
@@ -167,11 +171,15 @@ These are the columns:
167
171
- 'vote_average': float number between 0 and 10 that's representing viewers voting average
168
172
- 'vote_count': int for how many viewers voted
169
173
170
-
I want to better understand how the vote average has changed over the years. Write Python code that analyzes the dataset based on my request and produces right chart accordingly'''
174
+
Write Python code that creates a line chart showing how vote_average changed over the years.
175
+
Do NOT print or explore the data. Just create the visualization directly.
176
+
177
+
CRITICAL: Your code MUST end with this exact line to display the plot:
178
+
display(plt.gcf())'''
171
179
172
180
anthropic = Anthropic()
173
181
msg = anthropic.messages.create(
174
-
model='claude-3-5-sonnet-20240620',
182
+
model='claude-haiku-4-5-20251001',
175
183
max_tokens=1024,
176
184
messages=[
177
185
{"role": "user", "content": prompt}
@@ -189,7 +197,7 @@ Update the initialization of the Anthropic client to include the tool use like t
console.log('Chart saved to chart-${resultIdx}.png')
395
+
console.log(`Chart saved to chart-${resultIdx}.png`)
385
396
resultIdx++
386
397
}
387
398
}
388
399
}
389
400
390
401
constprompt=`
391
-
I have a CSV file about movies. It has about 10k rows. It's saved in the sandbox at ${datasetPathInSandbox.path}.
402
+
I have a CSV file about movies. It has about 10k rows. It's saved in the sandbox at ${dataset_path_in_sandbox.path}.
392
403
These are the columns:
393
404
- 'id': number, id of the movie
394
405
- 'original_language': string like "eng", "es", "ko", etc
@@ -400,12 +411,16 @@ These are the columns:
400
411
- 'vote_average': float number between 0 and 10 that's representing viewers voting average
401
412
- 'vote_count': int for how many viewers voted
402
413
403
-
I want to better understand how the vote average has changed over the years. Write Python code that analyzes the dataset based on my request and produces right chart accordingly`
414
+
Write Python code that creates a line chart showing how vote_average changed over the years.
415
+
Do NOT print or explore the data. Just create the visualization directly.
416
+
417
+
CRITICAL: Your code MUST end with this exact line to display the plot:
418
+
display(plt.gcf())`
404
419
405
420
constanthropic=newAnthropic()
406
421
console.log('Waiting for the model response...')
407
422
constmsg=awaitanthropic.messages.create({
408
-
model:'claude-3-5-sonnet-20240620',
423
+
model:'claude-haiku-4-5-20251001',
409
424
max_tokens:1024,
410
425
messages: [{ role:'user', content: prompt }],
411
426
tools: [
@@ -495,13 +510,16 @@ These are the columns:
495
510
- 'vote_average': float number between 0 and 10 that's representing viewers voting average
496
511
- 'vote_count': int for how many viewers voted
497
512
498
-
I want to better understand how the vote average has changed over the years.
499
-
Write Python code that analyzes the dataset based on my request and produces right chart accordingly"""
513
+
Write Python code that creates a line chart showing how vote_average changed over the years.
514
+
Do NOT print or explore the data. Just create the visualization directly.
515
+
516
+
CRITICAL: Your code MUST end with this exact line to display the plot:
Copy file name to clipboardExpand all lines: docs/code-interpreting/analyze-data-with-ai/pre-installed-libraries.mdx
+5-32Lines changed: 5 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,35 +2,8 @@
2
2
title: "Pre-installed libraries"
3
3
---
4
4
5
-
The sandbox comes with a [set of pre-installed Python libraries](https://github.com/e2b-dev/code-interpreter/blob/main/template/requirements.txt) for data analysis
6
-
but you can [install additional packages](/docs/quickstart/install-custom-packages):
The sandbox comes with a <ahref="https://github.com/e2b-dev/code-interpreter/blob/main/template/requirements.txt">set of pre-installed Python libraries</a> for data analysis but you can <ahref="/docs/quickstart/install-custom-packages">install additional packages</a>
0 commit comments