Python Package Examples

Explore runnable examples for popular Python packages — open any example and run it instantly in your browser.

getpass

Use the getpass module to enter a secret at runtime

View example →

Pandas

Use the Pandas library to read a CSV file

View example →

Polars

Use the Polars library to read a CSV file from a URL

View example →

Matplotlib

Use the Matplotlib library to create charts.

View example →

Seaborn

Use the Seaborn library to create a simple line plot

View example →

Plotly

Use the Plotly library to create a simple line plot

View example →

GeoPandas

Use the GeoPandas library to load and visualize a map

View example →

Treelib

Use the Treelib library to create a tree of subclasses

View example →

Altair

Use the Altair library to create an interactive scatter plot

View example →

Bokeh

Use the Bokeh library to create a simple scatter plot

View example →

Panel App

How to create a simple Panel app with a slider and a number indicator.

View example →

Bokeh App

Use the Bokeh library to create a simple app with sliders and a plot

View example →

HoloViews + Panel

Use the HoloViews and Panel libraries to create an interactive crossfilter plot

View example →

NetworkX

Use the Python NetworkX library to create a weighted graph and visualize it using Matplotlib

View example →

Folium

Use the Folium library to create a choropleth map

View example →

Faker

Use the Faker library to generate fake data

View example →

Files

How to read and write files in Python.

View example →

Pillow

Use the Pillow library to create a simple image

View example →

Biopython

Use the Biopython library to perform a pairwise sequence alignment

View example →

Scikit-Learn

Use KNeighborsClassifier from scikit-learn

View example →

Scipy

Solving linear equations with scipy

View example →

Numpy

Array operations with NumPy

View example →

Statsmodels

Python statsmodels example for performing linear regression

View example →

Xarray

Working with multi-dimensional labeled data using xarray

View example →

Dask

Parallel computing and large dataset handling using Dask

View example →

OpenCV

Basic image processing using OpenCV

View example →

Scikit-Image

Basic image processing using Scikit-Image

View example →

XGBoost

Training a regression model using XGBoost

View example →

LightGBM

Training a regression model using LightGBM

View example →

Log Parsing with Regex

Using regular expressions to parse log entries and extract structured information

View example →

DuckDB

Query a CSV file using DuckDB

View example →

SQLite3

Create a and use a SQLite database

View example →

SymPy

Use the sympy library to solve inequalities

View example →

Pyinstrument

Profiling Python code with Pyinstrument

View example →

Pygal

Use the Pygal library to create a stacked bar chart

View example →

igraph

Use the Python igraph library to create a network graph and visualize it using Matplotlib

View example →

User Input

How to get user input in Python.

View example →

OpenAI

Use the OpenAI Python library to generate LLM responses

View example →

python-docx

Use the Python docx library to create and update Microsoft Word (.docx) files

View example →

python-pptx

Use the Python pptx library to create and update Microsoft PowerPoint (.pptx) files

View example →

xlsxwriter

Use the Python xlsxwriter library to create and update Microsoft Excel (.xlsx) files

View example →

openpyxl

Use the Python openpyxl library to create and update Microsoft Excel (.xlsx) files

View example →

pyyaml

Use the Python pyyaml library to create and update YAML files

View example →

ReportLab

Use the Python reportlab library to create PDF files

View example →