Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        The Work Gym / Playgrounds

        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

        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.

        Embed this playground on your site

        What you can try

        1. Look at the data: sales.info(), sales.describe() and sales["region"].value_counts().
        2. Filter rows: sales[(sales["channel"] == "Online") & (sales["units"] >= 2)].
        3. Total by group: sales.groupby(["region", "category"])["revenue"].sum().
        4. Join the customers: sales.merge(pd.read_csv("customers.csv"), on="customer_id").
        5. Make a pivot table with pd.pivot_table(sales, index="region", columns="channel", values="revenue", aggfunc="sum").
        6. 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

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        New accounts get 12 hours of full access: every course, unit, project and exam. The clock starts when you open your first lesson.

        Plan your practice from a job ad or syllabus

        Have a referral code?

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.