Functions#

Conversion#

from_arrow(data[, schema, rechunk, ...])

Create a DataFrame or Series from an Arrow Table or Array.

from_dataframe(df, *[, allow_copy])

Build a Polars DataFrame from any dataframe supporting the interchange protocol.

from_dict(data[, schema, schema_overrides])

Construct a DataFrame from a dictionary of sequences.

from_dicts(data, *[, infer_schema_length, ...])

Construct a DataFrame from a sequence of dictionaries.

from_numpy(data[, schema, schema_overrides, ...])

Construct a DataFrame from a numpy ndarray.

from_pandas()

Construct a Polars DataFrame or Series from a pandas DataFrame or Series.

from_records(data[, schema, ...])

Construct a DataFrame from a sequence of sequences.

Eager/Lazy functions#

arg_where()

Return indices where condition evaluates True.

concat()

Aggregate multiple Dataframes/Series to a single DataFrame/Series.

cut(s, bins[, labels, break_point_label, ...])

Bin values into discrete values.

date_range()

Create a range of type Datetime (or Date).

get_dummies(df, *[, columns, separator])

Convert categorical variables into dummy/indicator variables.

ones(n[, dtype])

Return a new Series of given length and type, filled with ones.

zeros(n[, dtype])

Return a new Series of given length and type, filled with zeros.

Miscellaneous#

align_frames()

Align a sequence of frames using the unique values from one or more columns as a key.

Parallelization#

collect_all(lazy_frames, *[, type_coercion, ...])

Collect multiple LazyFrames at the same time.

StringCache#

toggle_string_cache(toggle)

Turn on/off the global string cache.

StringCache()

Context manager that allows data sources to share the same categorical features.