Skip to content

Analyze data with Code Interpreter

View as markdown

Code Interpreter lets Bearly use Python when a question needs reliable calculation or file processing. It is useful for analyzing tables, creating charts, transforming files, and solving multi-step quantitative problems.

Analyze a file

  1. Attach the source material

    Select the plus icon → Attach files, or drag the files into the chat. Code Interpreter cannot see files on your computer unless you attach them.

  2. Ask for the decision or output you need

    Name the fields to use, the calculation to perform, and the form of the result. For example:

    Analyze this sales spreadsheet. Compare revenue and gross margin by region, flag unusual month-over-month changes, and create a CSV with the underlying summary table.

    Bearly can choose Code Interpreter automatically when the task calls for it.

  3. Choose Run Python when you want to require it

    Type / in the composer, then select Run Python under Code. Enter the task in What would you like to run? and send it.

  4. Review the run and its results

    A Run Python step shows while the work is in progress. Select it to expand the Input and Result. If execution fails, the expanded step shows Error instead.

    Bearly explains the result in the conversation. Charts appear as previews, and generated spreadsheets, documents, images, or other files appear with the response.

Open, download, and continue with results

Select a generated file to preview it, then use Download in the open file panel. You can also find it later through the Browse files Files icon in the chat header.

To continue working, stay in the same conversation and refer to the generated file by name:

Using the regional-summary.csv you just created, add each region's share of annual revenue and sort from highest to lowest.

Each execution starts with a fresh workspace. Bearly can reuse an earlier output only by supplying that generated file to the next run, so naming the file removes ambiguity.

Good tasks for Code Interpreter

  • Calculate statistics, financial scenarios, or other multi-step math.
  • Inspect, filter, join, summarize, or reshape CSV and spreadsheet data.
  • Create charts and save the underlying data as a file.
  • Convert or modify documents, images, audio, and other supported files.
  • Generate a clean CSV, spreadsheet, document, image, or text file from computed results.

For a persistent interactive interface, such as a calculator or dashboard that someone will operate, create a Page instead.

Limits and recovery

Code Interpreter runs away from your device. It cannot use your local applications, folders, or installed software, and it does not keep a working directory between executions. It can retrieve public internet resources when needed.

Runs have bounded time, memory, and computing power. Large datasets, intensive media processing, and long-running programs may fail. A single run can return up to five output files.

If a run fails:

  • Expand Run Python and read Error for the immediate cause.
  • Confirm every required input file is attached and readable.
  • Ask Bearly to correct the code and rerun it; you do not need to write the correction yourself.
  • Split a large dataset or multi-stage job into smaller tasks, saving an intermediate file between stages.

For consequential work, ask Bearly to show its assumptions and validation checks. Review the source data and generated file before relying on the result.