Python Workbench

Browser-based analysis using Python, NumPy, pandas and Matplotlib

Loading Python...

Local workspace

Choose a folder on this laptop for real, Finder-visible storage of data, scripts, sessions and outputs. If no folder is connected, the workbench falls back to persistent browser storage.

Workspace Browser storage only
No local folder connected.
Folder layout: data/ input files, scripts/ saved Python scripts, sessions/ session metadata and autosave, output/ files generated by Python. For browser security, you choose the folder with the system folder picker; a webpage cannot accept an arbitrary absolute path directly.

1. Data files

Upload CSV, TSV, TXT, DAT, XYZ or other files. With a local workspace connected, uploads are stored in its data/ folder.

Python working directory: /data. When a local workspace is connected, its data/ and output/ files are mirrored into this runtime directory for analysis.
Python is loading...

2. Preview data

Select a CSV, TSV, TXT or DAT file. Previewing a tabular file also loads it as the pandas DataFrame df.

Select a file to inspect it.

3. Python analysis

Syntax-highlighted Python editor. The current runtime working directory is /data.

Not yet autosaved
Editor Drag the lower-right corner to resize.
⋮⋮ Python editor Drag this bar when floating
Ctrl/Cmd + Enter Run Ctrl/Cmd + S Save session Ctrl/Cmd + Shift + S Save As Ctrl/Cmd + F Find

4. Output

Python is loading...

5. Plot

Matplotlib plots will appear here.

6. Files in the current runtime

With a local workspace connected, new Python-generated files are synchronized to output/. You may also download any runtime file directly.

Available files

Quick examples

List available files

import os

print(os.listdir("."))

Read a CSV file

import pandas as pd

df = pd.read_csv("student.csv")

print(df.head())
print(df.describe())

Plot data

import matplotlib.pyplot as plt

plt.scatter(df["energy"], df["dipole"])
plt.xlabel("Energy")
plt.ylabel("Dipole moment")
plt.tight_layout()
plt.savefig("plot.pdf", bbox_inches="tight")
plt.show()