Run Python with Oda in Excel

For analysis that formulas do poorly, DataMind Oda in Excel can write and run Python code: statistics, regressions, forecasts, optimisation, simulations, or reshaping and cleaning many rows. Python runs in a sandbox in the pane, on your computer, without network access. This page covers what Python has, how it reads and changes your workbook, its limits and where it is available.

What Python has

How a run works

  1. Oda writes the code and names the ranges it needs, for example the table on your Data sheet. The pane reads those ranges from Excel and hands them to Python; a range with headers becomes a pandas table with those column names.
  2. Python runs in the pane's sandbox, a separate, locked-down space that cannot reach your sign-in, your chats or the pane's storage.
  3. The code can read more cells and write cells through Oda's own steps. A write is the same step as Writing cells, so it asks for approval as your permission mode says, goes through the same formula checks, and is listed in the Changes panel. Python has no other way to change the workbook.
  4. Oda gets back what the code printed, the result of its last line and up to 50 rows of each table.

The step row reads Running Python with Oda's short description, and shows the code; code longer than four lines is folded, with Show the code. When it finishes, it reads, for example, Ran in 4 s, Ran in 4 s and kept 2 files, or The code stopped with an error, and shows what the code printed, or the error it stopped with, folded behind Show the output when it is long. The result itself goes to Oda, who writes the answer.

The first run in a chat

The first run in a chat loads Python from your DataMind server, and the first import of a package, such as pandas or SciPy, loads that package. While loading takes more than a moment, the step row reads Loading Python; the first run in a chat takes longer, with a moving bar under it. Your browser keeps the files, so later loads are quicker. Nothing is downloaded from the internet.

Variables between runs

Files

Limits

ItemLimit
Running time2 minutes per run; loading Python and waiting for Excel or an approval card do not count
Loading Python2 minutes
Data handed in1,000,000 cells and 50 MB per run, from up to 20 ranges or files
Calls of Oda's steps from the code200 per run
Printed output20,000 characters
Result40,000 characters

A run that passes its time shows This took too long and was stopped. Stop ends Python at once; when the code had already written cells, the step row reads Stopped, but the change was already made.

Where Python is available

Oda runs Python only when all of these hold:

MessageWhat it means and what to do
Python could not be loaded in this Excel.Loading Python failed, for example because the connection to your DataMind server dropped. Ask again; if it keeps failing, contact your administrator.
Python stopped unexpectedly; it may have run out of memory.Python ended during the run, often because the data was too large. Ask Oda to work on less data at a time. The variables are gone.
This took too long and was stopped.The run passed 2 minutes, or loading did. Ask for a smaller task, or for the work in steps.
This tool was turned off for Oda in Excel, by your company or in your settings.Python was turned off while Oda was about to use it. Turn Python on under Settings, or ask your administrator.

Questions, answered

Which Python packages can Oda use?

The Python 3.14 standard library, NumPy, pandas, SciPy and openpyxl, with python-dateutil, pytz and six. Nothing else can be installed.

Does my data leave my computer when Python runs?

Python runs on your computer, in the pane's sandbox, not on a server. What the run returns, such as its printed output, results and table previews, goes to Oda's model with the chat, as other step results do.

Can Python reach the internet?

No. The sandbox has no network access, and Python cannot install packages or call web addresses.

Can Python change my workbook without asking?

Only as Oda's Writing cells step can: each write asks as your permission mode says, for example before overwriting your data in Accept edits. Python has no other way to change the workbook.

Why did the first Python run take longer?

The first run in a chat loads Python from your DataMind server, and the first import of each package loads that package. Later runs in the same chat reuse what is loaded, and your browser keeps the files for next time.

Why did Oda say my Python variables are gone?

Python started fresh: it was idle for 10 minutes, it timed out or stopped, it used too much memory, another chat needed it, or the pane was closed. Oda reads the data again.

Why does Oda not offer Python?

Your company or you turned Python off, this Excel cannot run Python in its sandbox, or you are on an iPad, where Python is not offered.

How much data can Python work on?

Up to 1,000,000 cells and 50 MB handed in per run. For more, Oda can read the rest from the code in parts or work through it in steps.

Can I see the code Oda ran?

Ask Oda in the chat to show it. Python's writes to the workbook come with an approval card where your permission mode asks, and every change is listed in the Changes panel.