Learning resourcesReviewed · E2B

E2B: Analyze data with AI

E2B's Analyze data with AI is a tutorial for developers adding AI-generated CSV analysis to an application, but its examples need code corrections and explicit sandbox access restrictions. It shows how TypeScript or Python applications can ask Claude for Python code, execute it through E2B and save chart images.

Researched 15 Nov 2026

In short.

E2B's Analyze data with AI is a tutorial for developers turning CSV files into charts with AI-generated Python, but its examples contain code inconsistencies and use a publicly reachable execution server by default. It demonstrates dataset upload, Claude tool calls, E2B execution, error inspection and PNG export. The TypeScript example references an undeclared dataset-path variable, and the complete Python example changes the expected local CSV location. Pricing, reuse rights and current dependency compatibility are unknown from this page. Nothing was executed; chart accuracy, performance and operational reliability were not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at [https://docs.e2b.dev/code-interpreting/analyze-data-with-ai.md], including the public-access notice, installation and configuration instructions, walkthrough snippets and both complete examples. Linked pages, the documentation index, dataset contents, external image contents and external pricing or licensing terms are excluded. Nothing was executed; actual setup success, chart accuracy, security behavior, performance and reliability remain unverified.

The overview

Identity

Analyze data with AI is an E2B documentation tutorial at [https://docs.e2b.dev/code-interpreting/analyze-data-with-ai.md]. It teaches an application integration using E2B Sandbox and the Anthropic SDK, with parallel TypeScript and Python examples.

The resource is instructional documentation rather than a ready-to-use analysis application. Its worked example asks Claude to generate Python that charts movie vote averages over release years.

Assessment

The tutorial is useful for understanding the connection between a model's tool request and an application's code-execution service. It exposes the upload, request, execution and export steps instead of hiding them behind a finished interface.

It needs adaptation before reuse. The TypeScript variable mismatch, Python file-path inconsistency and public-access default are concrete concerns in the examples. The page provides no execution records, accuracy evaluation or performance measurements.

Users

The primary audience is developers building applications that accept datasets and return AI-generated analyses or charts. Beginners get a step-by-step sequence; experienced developers get SDK calls, a tool-input schema and result-handling code.

Readers need enough Python or TypeScript knowledge to manage packages, API keys, file paths and errors. Someone seeking a graphical CSV analysis tool would still need an application interface built around these examples.

Capabilities

The examples upload a CSV to E2B, ask Claude to produce Python through a named tool, execute that code and inspect returned results. The chart-export code decodes base64 PNG results into local files named chart-0.png and subsequent numbered images.

The page describes execution outputs including standard output, standard error, charts, tables, text and runtime errors. The completed example implements PNG export and runtime-error reporting; it does not demonstrate a general viewer for every output type.

Using it

Requirements

The walkthrough requires E2B and Anthropic API keys, a local CSV file and access to both services. Its TypeScript dependency command installs @e2b/code-interpreter, @anthropic-ai/sdk and dotenv. The Python command installs e2b-code-interpreter, anthropic and python-dotenv.

The TypeScript launch instruction uses npx tsx index.ts; the Python instruction uses python main.py. Runtime versions and SDK versions are not specified. The example dataset is linked at [https://www.kaggle.com/datasets/muqarrishzaib/tmdb-10000-movies-dataset], but its contents and access requirements were not assessed.

Mechanism

The application uploads the dataset to the sandbox. The shown Claude request contains the sandbox file path, column descriptions and chart instructions; it does not explicitly attach the CSV contents to that request.

Tool calling means Claude can return a structured request named run_python_code with a code string. The application reads matching tool-use blocks and explicitly passes their code to sbx.runCode in TypeScript or sbx.run_code in Python.

The example makes one model request and then executes matching tool calls. It does not show returning execution results to Claude or an iterative loop for correcting failed code.

Setup

The documented sequence is to install dependencies, put E2B_API_KEY and ANTHROPIC_API_KEY in a .env file, obtain dataset.csv, create a sandbox, upload the dataset and connect the execution helper to Claude's tool schema.

All shown Sandbox.create() calls omit access restrictions. The page warns that the Code Interpreter server is reachable through a public URL by default and executes received code. For application-only execution, it specifies allowPublicTraffic: false in JavaScript/TypeScript or allow_public_traffic: False in Python.

The TypeScript upload result is named datasetPathInSandbox, but the prompt reads dataset_path_in_sandbox.path. That identifier is undeclared in the shown TypeScript code. The complete Python example reads ../dataset.csv, while the earlier instructions place dataset.csv in the project root; reconcile that path with the working directory.

Example

The walkthrough describes a dataset of about 10,000 movies, with fields including release_date, vote_average and vote_count. It asks for a line chart showing how vote_average changed over the years and requests explicit display of the resulting plot.

The prompt leaves the yearly aggregation rule unspecified, including whether vote_count should affect weighting. It also tells the model not to explore the data. Consequently, the requested chart alone would not establish correct aggregation, missing-value handling or interpretation.

The page includes an illustrative chart image but does not supply the generated analysis code or numerical reference results. No chart output was independently assessed.

Assessment & evidence

Limitations

The examples execute matching model-generated code without demonstrating a review or validation step. The sandbox access warning concerns who can submit code; it does not establish that a generated analysis is correct or appropriate for a particular dataset.

The request does not explicitly force a tool call, and the response loop handles only matching tool-use blocks. From the shown control flow, a plain-text response would not trigger execution. A response without a PNG would produce no chart file, with no explicit missing-chart diagnostic.

Runtime errors cause the example to exit rather than retry. Sandbox cleanup, resource limits, sensitive-data controls and recovery from service failures are not demonstrated. Their availability elsewhere in E2B is unknown from this page.

Reasoning

The tutorial's strongest contribution is a visible integration pattern: the model proposes code, the application routes it to an execution service, and the application extracts an artifact. That makes it useful for learning how to connect these components.

A prototype based on this pattern still needs separate validation of access settings, generated code and analytical results. This follows from the documented public-access default and the example's limited error and output handling; the page does not demonstrate production reliability or statistical validity.

Alternatives

The page offers Python and TypeScript implementations of the same architecture. Both ask Claude to generate Python for execution in E2B, so choosing TypeScript changes the controlling application language rather than the analysis language.

The page does not compare other sandbox services, model providers or conventional analysis tools. Relative cost, speed, reliability and suitability are unknown. For a fixed chart, directly authored analysis code is an architectural alternative to consider, but the page does not evaluate that tradeoff.

Evidence

The source is the complete documentation page at [https://docs.e2b.dev/code-interpreting/analyze-data-with-ai.md], including its introductory explanation, public-access warning, numbered walkthrough and complete TypeScript and Python examples.

These findings are based on the page's text and static inspection of its code. Nothing was executed. Linked documentation, SDK repositories, API dashboards, dataset contents and the externally hosted chart image were not independently assessed.

Access & freshness

Costs

Costs are unknown. The page requires E2B and Anthropic API access but provides no prices, free allowances, billing units or spending limits. It also does not establish whether obtaining the linked dataset has any cost.

The Claude requests set max_tokens to 1024. That parameter does not establish the total cost of model use and sandbox execution.

Rights

The selected page supplies no licence or redistribution terms for its text, example code or SDK dependencies. It does not establish the linked dataset's licence or rights in generated outputs. Commercial-use permissions, attribution obligations and redistribution rights are unknown.

Calling the dataset publicly available establishes availability rather than reuse permission. Data-retention terms, provider use of uploaded data and deletion guarantees are also not documented on this page.

Freshness

The page was captured on 15 November 2026 at 07:21:16.504 UTC. It provides no publication or last-updated date.

The example heading names Claude 3.5 Sonnet, while the actual API calls request claude-haiku-4-5-20251001. The model identifier's date does not establish the documentation's update date. Dependency versions are unpinned, and present model availability and SDK compatibility are unknown.

Actions

Before adapting the examples, correct the TypeScript dataset-path identifier, align the Python CSV path with the working directory and apply the documented restriction on public sandbox traffic. Confirm compatible runtime, SDK and model versions.

Define the intended yearly aggregation and weighting, then validate generated analysis against a small dataset with known results. Review generated code and add handling for absent tool calls, missing charts and execution failures.

Confirm service pricing, data-handling terms, dataset permissions and code-reuse rights. Establish sandbox cleanup and operational controls before using the pattern with real user data.

Evidence for this report

selected-page.txtselected · checked 2026-11-15