Polars 2 · Basics

Create a DataFrame

Build a DataFrame from a dictionary of columns.

import polars as pl

df = pl.DataFrame({
    "name": ["Ada", "Grace", "Linus"],
    "age": [36, 45, 28],
    "team": ["a", "b", "a"],
})

Official Polars 2 documentation

More basics commands

All basics commands · Polars 2 cheatsheet

Was this page helpful?