Manipulation/selection#

LazyFrame.approx_n_unique()

Approximate count of unique values.

LazyFrame.bottom_k(k, *, by[, reverse])

Return the k smallest rows.

LazyFrame.cast(dtypes, *[, strict])

Cast LazyFrame column(s) to the specified dtype(s).

LazyFrame.clear([n])

Create an empty copy of the current LazyFrame, with zero to 'n' rows.

LazyFrame.clone()

Create a copy of this LazyFrame.

LazyFrame.drop(*columns[, strict])

Remove columns from the DataFrame.

LazyFrame.drop_nulls([subset])

Drop all rows that contain null values.

LazyFrame.explode(columns, *more_columns)

Explode the DataFrame to long format by exploding the given columns.

LazyFrame.fill_nan(value)

Fill floating point NaN values.

LazyFrame.fill_null([value, strategy, ...])

Fill null values using the specified value or strategy.

LazyFrame.filter(*predicates, **constraints)

Filter the rows in the LazyFrame based on a predicate expression.

LazyFrame.first()

Get the first row of the DataFrame.

LazyFrame.gather_every(n[, offset])

Take every nth row in the LazyFrame and return as a new LazyFrame.

LazyFrame.group_by(*by[, maintain_order])

Start a group by operation.

LazyFrame.group_by_dynamic(index_column, *, ...)

Group based on a time value (or index value of type Int32, Int64).

LazyFrame.head([n])

Get the first n rows.

LazyFrame.inspect([fmt])

Inspect a node in the computation graph.

LazyFrame.interpolate()

Interpolate intermediate values.

LazyFrame.join(other[, on, how, left_on, ...])

Add a join operation to the Logical Plan.

LazyFrame.join_asof(other, *[, left_on, ...])

Perform an asof join.

LazyFrame.join_where(other, *predicates[, ...])

Perform a join based on one or multiple (in)equality predicates.

LazyFrame.last()

Get the last row of the DataFrame.

LazyFrame.limit([n])

Get the first n rows.

LazyFrame.melt([id_vars, value_vars, ...])

Unpivot a DataFrame from wide to long format.

LazyFrame.merge_sorted(other, key)

Take two sorted DataFrames and merge them by the sorted key.

LazyFrame.rename(mapping, *[, strict])

Rename column names.

LazyFrame.reverse()

Reverse the DataFrame.

LazyFrame.rolling(index_column, *, period[, ...])

Create rolling groups based on a temporal or integer column.

LazyFrame.select(*exprs, **named_exprs)

Select columns from this LazyFrame.

LazyFrame.select_seq(*exprs, **named_exprs)

Select columns from this LazyFrame.

LazyFrame.set_sorted(column, *[, descending])

Indicate that one or multiple columns are sorted.

LazyFrame.shift([n, fill_value])

Shift values by the given number of indices.

LazyFrame.slice(offset[, length])

Get a slice of this DataFrame.

LazyFrame.sort(by, *more_by[, descending, ...])

Sort the LazyFrame by the given columns.

LazyFrame.sql(query, *[, table_name])

Execute a SQL query against the LazyFrame.

LazyFrame.tail([n])

Get the last n rows.

LazyFrame.top_k(k, *, by[, reverse])

Return the k largest rows.

LazyFrame.unique([subset, keep, maintain_order])

Drop duplicate rows from this DataFrame.

LazyFrame.unnest(columns, *more_columns)

Decompose struct columns into separate columns for each of their fields.

LazyFrame.unpivot([on, index, ...])

Unpivot a DataFrame from wide to long format.

LazyFrame.update(other[, on, how, left_on, ...])

Update the values in this LazyFrame with the values in other.

LazyFrame.with_columns(*exprs, **named_exprs)

Add columns to this LazyFrame.

LazyFrame.with_columns_seq(*exprs, **named_exprs)

Add columns to this LazyFrame.

LazyFrame.with_context(other)

Add an external context to the computation graph.

LazyFrame.with_row_count([name, offset])

Add a column at index 0 that counts the rows.

LazyFrame.with_row_index([name, offset])

Add a row index as the first column in the LazyFrame.