Python playground
A Python notebook in your browser, with pandas loaded and sample CSV files in the folder. Write code in a cell, press Shift + Enter and see the output. You don't need an account, and there is nothing to install.
Opening the workspace
Opening the workspace
Independent practice environmentNot affiliated with the Python Software Foundation or NumFOCUSDetails
Independent practice environment
This is an independently developed practice environment by The Work Gym for learning pandas. It is not an official pandas tool.
The Work Gym is not affiliated with, sponsored by, endorsed by or certified by the Python Software Foundation or NumFOCUS.
Python is a trademark of the Python Software Foundation; pandas is a NumFOCUS project.
What you can try
- Look at the data:
sales.info(),sales.describe()andsales["region"].value_counts(). - Filter rows:
sales[(sales["channel"] == "Online") & (sales["units"] >= 2)]. - Total by group:
sales.groupby(["region", "category"])["revenue"].sum(). - Join the customers:
sales.merge(pd.read_csv("customers.csv"), on="customer_id"). - Make a pivot table with
pd.pivot_table(sales, index="region", columns="channel", values="revenue", aggfunc="sum"). - Plain Python works too: write a function, a loop or a list comprehension in a new cell.
The sample data
Juniper Lane, a fictional homeware retailer. The first cells import pandas and read sales.csv into a DataFrame called sales: one row per order with the date, customer, region, channel, category, product, units, unit price and revenue. customers.csv and products.csv sit in the same folder for joins.
Learn it step by step
The playground checks nothing. In the course, lessons come in order and every exercise is checked the moment you finish it, with a hint that names the mistake. The first unit is free.
Course: pandasLesson 1: Read a CSV file and look at itLesson 6: Filter rows with a conditionLesson 17: Summarize with groupbyLesson 19: Build pivot tablesTest your level
Questions about the playground
Is it real Python?
Yes. It is Python 3 compiled to WebAssembly (Pyodide), running in your browser tab. Most of the standard library works. Packages built for Pyodide, such as matplotlib, load the first time a cell imports them; packages that need a network or a native install do not.
Why does the first run take a few seconds?
The notebook opens at once, but Python itself downloads the first time you use it. After that your browser keeps it, so the next visit starts faster.
Can I open my own CSV?
Yes. Open Your own CSV above the workspace and choose Open CSV. Use comma-separated UTF-8 text with a header, up to 512 KB, 2,000 data rows, 50 columns and 25,000 cells including the header. You can save named projects in this browser or download the current data as CSV. These saves do not sync to your account. XLSX is not supported.
Is the Python playground free?
Yes. You don't need an account or a card, and it runs in your browser, so there is nothing to install.
Is my work saved?
Only in this browser. The playground keeps your last session on this device so it is there when you come back, and sends nothing to an account. Start again puts the sample data back.
Other playgrounds
- SQL playground
Run any query on a sample store database: products, customers, orders and employees.
- Excel practice sheet online
A spreadsheet that works like Excel, with 30 sample orders for formulas, pivots and charts.
- Linux terminal online
A Bash-style terminal with sample logs, a CSV and a config file to practice commands on.
- Power BI playground: practice DAX
Write DAX measures on a sample sales model and see them in a visual.
- Power Query online playground
Clean and reshape messy sample files in a Power Query Editor.
- Git playground
A sample repository with branches and commits to practice Git commands on.