1. Pyroom
  2. Tutorials
  3. Python libraries

Python libraries

The Python standard library works immediately. Popular packages such as numpy, pandas and matplotlib load on demand and are cached, so they keep working offline.

When to use it

Use these tutorials when a lesson needs data analysis, charts, maths or another package that is not part of standard Python.

Turn on a library

Open Menu β†’ Settings β†’ Library settings, type a package name such as pandas and select Load library. Then import it in your code as usual. If your program imports a supported package that is not loaded yet, Pyroom offers to load it for you.

import pandas as pd
print(pd.DataFrame({"score": [8, 10, 9]}))

Charts with matplotlib

matplotlib draws into the preview panel next to the console. Build a list of values, call plt.plot() or plt.bar(), and finish with plt.show(). Change the data and run again to see the chart update β€” a great way to make statistics lessons visual.

Learning path

The Beginner tutorial loads a library from Settings. The Intermediate tutorial plots a chart with matplotlib and explains each line.

Good to know

  • The first download of a package needs an internet connection; after that it is cached for offline use.
  • Not every PyPI package works in a browser. Packages that need native binaries, processes, threads, sockets or a real filesystem may be unavailable.
  • Large packages take longer the first time, so load them before a lesson starts.

Feature overview β†’

Beginner

Turn on a Python library like numpy

Beginner

Beginner Video coming soon. The steps below show everything the video will cover.

Load a Python library such as numpy in Pyroom from Library settings, then import and use it in your browser. Cached for offline use.

Open tutorial β†’

Intermediate

Plot a chart with matplotlib

Intermediate

Intermediate Video coming soon. The steps below show everything the video will cover.

Draw a bar chart with matplotlib in your browser: load the library in Pyroom, build the data and show the chart next to your code.

Open tutorial β†’

All tutorials β†’

Try it in the Playground

Nothing to install and no account needed.

Open Playground β†’