LoomCode AI

Tested example

Python data analysis with AI: Palmer Penguins example

A recorded LoomCode run: one prompt produced a pandas + matplotlib script that loads a public CSV, prints per-species means and draws a chart. Code, output and limits.

Updated Nov 22, 20263 min readtested

This is a real LoomCode AI run with the Python template, which executes code in a notebook-style sandbox and returns printed output and charts instead of a web page. One prompt produced a 30-line script that downloaded the Palmer Penguins dataset, dropped incomplete rows, printed a per-species summary table and drew a scatter plot. The script ran on the first try.

The prompt

Load the Palmer Penguins dataset from https://raw.githubusercontent.com/mwaskom/seaborn-data/master/penguins.csv with pandas. Drop rows with missing values and print how many rows were dropped. Print a table of mean bill length, bill depth, flipper length and body mass per species. Then draw one matplotlib figure: a scatter plot of flipper length vs body mass, colored by species, with a legend and axis labels.

Two details made this work: the data came from a public URL (the LoomCode prompt box accepts images, not CSV files), and the prompt named the exact outputs to print and plot.

Run this prompt in the builder

Generated code

script.py33 lines
import matplotlib.pyplot as plt
import pandas as pd

# Load the dataset and remove rows with any missing value.
url = 'https://raw.githubusercontent.com/mwaskom/seaborn-data/master/penguins.csv'
penguins = pd.read_csv(url)
clean = penguins.dropna()
print(f'Rows dropped: {len(penguins) - len(clean)}')

# Compute and print the requested species means.
measurements = {
    'bill_length_mm': 'Bill length (mm)',
    'bill_depth_mm': 'Bill depth (mm)',
    'flipper_length_mm': 'Flipper length (mm)',
    'body_mass_g': 'Body mass (g)',
}
means = clean.groupby('species')[list(measurements)].mean().rename(columns=measurements)
print('\nMean measurements by species:')
print(means.to_string(float_format=lambda value: f'{value:.2f}'))

# Plot each species separately so it gets its own color and legend entry.
fig, ax = plt.subplots(figsize=(8, 5), layout='constrained')
for species, group in clean.groupby('species'):
    ax.scatter(group['flipper_length_mm'], group['body_mass_g'], label=species, alpha=0.75)

ax.set(
    title='Penguin flipper length and body mass by species',
    xlabel='Flipper length (mm)',
    ylabel='Body mass (g)',
)
ax.legend(title='Species')
plt.show()

The model kept the job small: one dropna(), one groupby().mean(), and a loop that plots each species separately so each gets its own legend entry.

Output

stdout9 lines
Rows dropped: 11

Mean measurements by species:
           Bill length (mm)  Bill depth (mm)  Flipper length (mm)  Body mass (g)
species
Adelie                38.82            18.35               190.10        3706.16
Chinstrap             48.83            18.42               195.82        3733.09
Gentoo                47.57            15.00               217.24        5092.44
Scatter plot of penguin flipper length against body mass, colored by species: Adelie, Chinstrap and Gentoo
The chart returned by the sandbox, unedited. Gentoo penguins cluster at longer flippers and higher body mass.

How we checked it

What this template is good for, and what it is not

The Python template is best for one-off analysis: load data, compute, plot, print. It runs a single cell in Python 3.13 with pandas 2.2, matplotlib 3.11, plotly 6.0 and seaborn 0.13 preinstalled. It does not give you a URL to share, and it does not keep state between runs.

If you want something other people can click on — filters, uploads, downloads — ask for a Streamlit app instead. For a side-by-side of the two Python UI frameworks, see Streamlit vs Gradio.

Sandbox runtime versions
FrameworkRuntimeKey packagesOutputObserved in E2B
ReactNode.js 22.23.5react 19.2.4, react-dom 19.2.4, vite 8.3.8, typescript 5.9.3web previewNov 23, 2026
Next.jsNode.js 21.7.3next 14.2.20, react ^18, tailwindcss ^3.4.1, shadcn/ui componentsweb previewNov 22, 2026
Vue / NuxtNode.js 21.7.3nuxt ^4.0.3, vue ^3.5.20, nuxi 3.28.0web previewNov 22, 2026
Python (code interpreter)Python 3.13pandas 2.2.3, matplotlib 3.11.2, plotly 6.0.1, seaborn 0.13.2notebook outputNov 22, 2026
StreamlitPython 3.9.23streamlit 1.49.1, pandas 2.3.2, numpy 2.0.2, plotly 6.3.0web previewNov 22, 2026
GradioPython 3.9.23gradio 4.44.1web previewNov 22, 2026
PHPPHP 8.2.29Composer 2.8.11, PDO (sqlite, mysql drivers)web previewNov 22, 2026
LaravelPHP 8.2.29Laravel Framework 12.27.0, SQLiteweb previewNov 22, 2026

Reuse it

Download Generated files (.zip) from the Code tab to get script.py, a README with the run steps and the model details. Locally:

pip install pandas matplotlib
python script.py

More runs like this one are on the tested examples page.