onlinecompiler.io

Online Python compiler with pandas

Write pandas code below and run it free, in a sandbox on our servers. Paste a CSV into the Input tab and read it with pd.read_csv. NumPy, Matplotlib, seaborn and scikit-learn are installed too. No sign-in, no ads.

Também em portuguêsTambién en español

import sys
import pandas as pd

# Read the CSV from the Input tab
df = pd.read_csv(sys.stdin)

print(df.groupby("city")["sales"].sum().sort_values(ascending=False))
print()
print(df["sales"].describe().round(1))
city,month,sales
Pune,Jan,120
Pune,Feb,135
Delhi,Jan,180
Delhi,Feb,160
Chennai,Jan,95
Chennai,Feb,110
Mumbai,Jan,210
Mumbai,Feb,190

Press Run and the program prints the sales per city, then a summary of the sales column:

Output
city
Mumbai     400
Delhi      340
Pune       255
Chennai    205
Name: sales, dtype: int64

count      8.0
mean     150.0
std       41.3
min       95.0
25%      117.5
50%      147.5
75%      182.5
max      210.0
Name: sales, dtype: float64

What runs your pandas code

Python 3.14 with pandas 3.0.6. These packages are installed and need no setup: numpy 2.5.4, pandas 3.0.6, scipy 1.18.1, scikit-learn 1.9.1, matplotlib 3.11.2, seaborn 0.13.2, statsmodels 0.15.0, sympy 1.14.0, openpyxl 3.1.5, pillow 13.0.0, duckdb 1.5.6, wordcloud 1.9.6, polars 2.1.0, pgmpy 1.1.2, nltk 3.10.4. Their versions are also in the package table. Other packages from PyPI are not installed, and there is no network to install them.

Use your own data or a built-in dataset

Paste a CSV into the Input tab, up to 100 KB, and read it with pd.read_csv(sys.stdin), as the program above does. A few datasets are installed and load without the internet: seaborn's 22 sample datasets through sns.load_dataset, scikit-learn's bundled ones (load_iris, load_digits, load_wine, load_breast_cancer, load_diabetes) and the datasets that ship with statsmodels.

datasets.py
import seaborn as sns
from sklearn.datasets import load_iris

tips = sns.load_dataset("tips")        # one of seaborn's 22 sample datasets
iris = load_iris(as_frame=True).frame   # scikit-learn's bundled datasets
print(tips.shape, iris.shape)

Through the API you can send up to 20 files with a run, 1 MB in total, and read each by its name (see the example below).

pandas 2 and pandas 3

pandas 3 changed some defaults: text columns get a new string dtype, and copy-on-write is always on, so code that changes a slice of a DataFrame can behave differently. For code or exercises written against pandas 2, the API has a second runtime, python-3.14-pandas2, with pandas 2.3.3 and the same other packages. The editor on this page runs pandas 3.0.6.

Check an answer automatically

The Python compiler with test cases runs your code against several inputs and marks each passed or failed. For a table answer, print the DataFrame as CSV and pick "CSV table, rows in any order": it matches the columns by name, ignores row order and pandas' index column, and compares numbers within a small tolerance, so 0.30000000000000004 matches 0.3:

answer.py
totals = df.groupby("city", as_index=False)["sales"].sum()
print(totals.to_csv(index=False))

Course and practice sites can do the same through the API; the data science code execution API page shows how.

Limits

  • Each run gets 30 seconds, 512 MB of memory (up to 2 GB on Pro and Business) and 2 CPUs, and starts fresh: nothing is kept between runs.
  • There is no network, so pd.read_csv of a URL, pip install and scikit-learn's fetch_* loaders fail.
  • Output over 64 KB per stream is cut, so print a summary rather than a whole large DataFrame.

Run pandas from your own app

Send the code and the data files to the API with a key, and the output comes back in the response. It's free up to 100,000 runs a month.

Terminal
curl -X POST https://api.onlinecompiler.io/api/run-code-sync/ \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "compiler": "python-3.14",
    "code": "import pandas as pd\n\ndf = pd.read_csv(\"data.csv\")\nprint(df.groupby(\"city\")[\"sales\"].sum().to_dict())",
    "files": [
      {"name": "data.csv", "content": "city,sales\nPune,120\nPune,135\nDelhi,180\n"}
    ]
  }'

The response's output is "{'Delhi': 180, 'Pune': 255}\n". Charts the program shows come back in files; the API docs cover both.

More for data work

Frequently asked questions

Is this pandas online compiler free?

Yes. Running pandas on this page needs no account and shows no ads. To run pandas from your own app or site, the API and the embeddable editor are free up to 100,000 runs a month, commercial use included.

Which pandas version does it run?

pandas 3.0.6 on Python 3.14, with numpy 2.5.4, pandas 3.0.6, scipy 1.18.1, scikit-learn 1.9.1, matplotlib 3.11.2, seaborn 0.13.2, statsmodels 0.15.0, sympy 1.14.0, openpyxl 3.1.5, pillow 13.0.0, duckdb 1.5.6, wordcloud 1.9.6, polars 2.1.0, pgmpy 1.1.2, nltk 3.10.4. For code written against pandas 2, the API has the compiler id python-3.14-pandas2, which runs pandas 2.3.3.

Can I use my own CSV file?

Yes. Paste the CSV into the Input tab (up to 100 KB) and read it with pd.read_csv(sys.stdin). Through the API you can send up to 20 files, 1 MB in total, and read each one by its name, such as pd.read_csv("data.csv").

Why does read_csv with a URL fail?

Programs run with no network access, so pd.read_csv("https://...") stops with URLError: Temporary failure in name resolution. Paste the data into the Input tab, send it as a file through the API, or use a dataset that is already installed, such as sns.load_dataset("tips").

Can I run pandas 2 code?

Yes, through the API: send the compiler id python-3.14-pandas2 and the code runs on pandas 2.3.3 with the same other packages. This page's editor runs pandas 3.0.6.

Can I plot a DataFrame?

Yes. Matplotlib and seaborn are installed: call df.plot() and then plt.show(), and the chart appears as an image under the output. The Matplotlib online compiler page has more on charts.