Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Construct DataFrames

Construct a DataFrame using the df macro.

shape: (3, 3) ┌───────┬────────┬──────────────┐ │ names ┆ values ┆ values_nulls │ │ --- ┆ --- ┆ --- │ │ str ┆ i32 ┆ i32 │ ╞═══════╪════════╪══════════════╡ │ a ┆ 1 ┆ 1 │ ├╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ b ┆ 2 ┆ null │ ├╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │ c ┆ 3 ┆ 3 │ └───────┴────────┴──────────────┘

Construct a polars DataFrame from a vector of Series.

shape: (3, 2) +-------+--------+ | names | values | | --- | --- | | str | i32 | +=======+========+ | a | 1 | +-------+--------+ | b | null | +-------+--------+ | c | 3 | +-------+--------+