Frame methods#

LiteFrame is a performance-dedicated tabular data object with no index semantics. Column names are flat strings, single-column selection returns a LiteFrame (not a Series), and all operations are column-based with no implicit label alignment. Arrow dtypes are used throughout so that nullable integer columns are preserved rather than promoted to float. Results are lazy — call .execute() to materialize.

Constructor#

LiteFrame([data, columns, dtype, ...])

A performance-dedicated, lazy, distributed tabular data object with no index semantics.

LiteFrame.from_local_df(df[, chunk_size, ...])

Create a LiteFrame from a local pandas DataFrame or similar object.

LiteFrame.from_tensor(tensor[, columns, gpu])

Create a LiteFrame from a MaxFrame tensor.

Attributes and underlying data#

Axes

LiteFrame.columns

Return the column labels of the LiteFrame.

LiteFrame.dtypes

Return the dtype of each column.

LiteFrame.ndim

Return the number of dimensions of the LiteFrame.

LiteFrame.shape

LiteFrame.values

Return the LiteFrame as a tensor.

Conversion#

LiteFrame.astype(dtype[, errors])

Cast a LiteFrame to a specified dtype.

LiteFrame.to_pandas([session])

Convert the LiteFrame to a pandas DataFrame.

LiteFrame.to_tensor([dtype])

Convert the LiteFrame to a MaxFrame tensor.

Indexing, iteration#

LiteFrame.eval(expr[, inplace])

Evaluate a string describing operations on LiteFrame columns.

LiteFrame.query(expr[, inplace])

Query the columns of a LiteFrame with a boolean expression.

LiteFrame.head([n])

Return the first n rows.

LiteFrame.iloc

Binary operator functions#

LiteFrame.add(other)

Element-wise addition of other to the LiteFrame.

LiteFrame.sub(other)

Element-wise subtraction (lf - other).

LiteFrame.mul(other)

Element-wise multiplication (lf * other).

LiteFrame.div(other)

Element-wise true division (lf / other).

LiteFrame.floordiv(other)

Element-wise floor division (lf // other).

LiteFrame.mod(other)

Element-wise modulo (lf % other).

LiteFrame.pow(other)

Element-wise exponentiation (lf ** other).

LiteFrame.radd(other)

Reverse element-wise addition (other + lf).

LiteFrame.rsub(other)

Reverse element-wise subtraction (other - lf).

LiteFrame.rmul(other)

Reverse element-wise multiplication (other * lf).

LiteFrame.rdiv(other)

Reverse element-wise true division (other / lf).

LiteFrame.rfloordiv(other)

Reverse element-wise floor division (other // lf).

LiteFrame.rmod(other)

Reverse element-wise modulo (other % lf).

LiteFrame.rpow(other)

Reverse element-wise exponentiation (other ** lf).

LiteFrame.lshift(other)

Element-wise left bit shift (lf << other).

LiteFrame.rshift(other)

Element-wise right bit shift (lf >> other).

LiteFrame.rlshift(other)

Reverse element-wise left bit shift (other << lf).

LiteFrame.rrshift(other)

Reverse element-wise right bit shift (other >> lf).

LiteFrame.lt(other)

Element-wise less-than comparison.

LiteFrame.gt(other)

Element-wise greater-than comparison.

LiteFrame.le(other)

Element-wise less-than-or-equal comparison.

LiteFrame.ge(other)

Element-wise greater-than-or-equal comparison.

LiteFrame.ne(other)

Element-wise not-equal comparison.

LiteFrame.eq(other)

Element-wise equality comparison.

Function application, GroupBy & window#

LiteFrame.apply(func[, axis, result_type, ...])

Apply func per column (axis=0) or per row (axis=1).

LiteFrame.apply_chunk(func, *[, dtypes, ...])

Apply func per execution chunk.

LiteFrame.expanding([min_periods, columns, ...])

Provide expanding window calculations.

LiteFrame.flat_apply(func, *[, dtypes, ...])

Apply func to each row, expanding it to 0-N output rows.

LiteFrame.groupby(by[, sort, dropna, group_keys])

Group the LiteFrame by one or more columns.

LiteFrame.map(func, *[, na_action, dtype, ...])

Apply func element-wise to every value in the LiteFrame.

LiteFrame.rolling(window[, min_periods, ...])

Provide rolling-window calculations.

LiteFrame.transform(func[, axis, ...])

Transform per column (axis=0, default) or per row (axis=1).

LiteFrame.transform_chunk(func, *[, ...])

Apply func per execution block (chunk).

Computations / descriptive stats#

LiteFrame.agg([func, method, numeric_only, ...])

Aggregate using one or more operations over columns.

LiteFrame.all([method, numeric_only])

Return whether all elements in each column are truthy.

LiteFrame.between(left, right[, inclusive])

Return boolean LiteFrame indicating whether each value is between left and right.

LiteFrame.case_when(caselist)

Replace values where conditions are True, evaluated in order.

LiteFrame.mask(cond[, other])

Replace values where cond is True with other.

LiteFrame.where(cond[, other])

Replace values where cond is False with other.

LiteFrame.any([method, numeric_only])

Return whether any element in each column is truthy.

LiteFrame.clip([lower, upper])

Trim values at input threshold(s).

LiteFrame.count([method])

Return the count of non-null values in each column.

LiteFrame.cummax([skipna, columns])

Cumulative max of column values, preserving row order.

LiteFrame.cummin([skipna, columns])

Cumulative min of column values, preserving row order.

LiteFrame.cumprod([skipna, columns])

Cumulative prod of column values, preserving row order.

LiteFrame.cumsum([skipna, columns])

Cumulative sum of column values, preserving row order.

LiteFrame.diff([periods, columns])

Compute x[i] - x[i-periods] for each row.

LiteFrame.kurt([method, numeric_only])

Return the unbiased kurtosis of each column.

LiteFrame.max([method, numeric_only])

Return the maximum of each column.

LiteFrame.mean([method, numeric_only])

Return the mean of each column.

LiteFrame.median([method, numeric_only])

Return the median of each column.

LiteFrame.min([method, numeric_only])

Return the minimum of each column.

LiteFrame.nunique([method, numeric_only, dropna])

Return the number of distinct values in each column.

LiteFrame.pct_change([periods, columns])

Compute (x[i] - x[i-periods]) / x[i-periods] for each row.

LiteFrame.prod([method, numeric_only])

Return the product of each column.

LiteFrame.round([decimals])

Element-wise rounding to decimals decimal places.

LiteFrame.sem([method, numeric_only])

Return the standard error of the mean of each column.

LiteFrame.size([method])

Return the total number of rows.

LiteFrame.skew([method, numeric_only])

Return the unbiased skewness of each column.

LiteFrame.std([method, numeric_only])

Return the sample standard deviation of each column.

LiteFrame.sum([method, numeric_only])

Return the sum of each column.

LiteFrame.var([method, numeric_only])

Return the unbiased variance of each column.

Reindexing / selection / label manipulation#

LiteFrame.add_prefix(prefix)

Prefix all column labels with prefix.

LiteFrame.add_suffix(suffix)

Suffix all column labels with suffix.

LiteFrame.assign(**kwargs)

Add new columns to LiteFrame.

LiteFrame.drop(columns[, errors])

Drop columns from LiteFrame.

LiteFrame.drop_duplicates([subset, keep, method])

Return LiteFrame with duplicate rows removed.

LiteFrame.duplicated([subset, keep, method])

Return boolean mask marking duplicate rows.

LiteFrame.rename(columns)

Rename columns in LiteFrame.

LiteFrame.select(*args)

Dispatch to select or select_expr based on argument types.

Missing data handling#

LiteFrame.dropna([axis, how, subset])

Drop rows or columns with missing values.

LiteFrame.fillna([value])

Fill missing values.

LiteFrame.isna()

Detect missing values.

LiteFrame.isnull()

Detect missing values.

LiteFrame.notna()

Detect non-missing values.

LiteFrame.notnull()

Detect non-missing values.

LiteFrame.replace([to_replace, value])

Replace values in the LiteFrame.

Reshaping, sorting#

LiteFrame.explode(column)

Explode list column(s) into multiple rows.

LiteFrame.rebalance([axis, factor, ...])

Make data more balanced across entire cluster.

LiteFrame.rechunk(chunk_size[, ...])

Rechunk LiteFrame data.

LiteFrame.sort([by, ascending, kind, ...])

Sort the LiteFrame by the specified columns.

Combining / joining / merging#

LiteFrame.merge(right[, how, on, left_on, ...])

Merge LiteFrame with another LiteFrame using a database-style join.