TableFrame
class TableFrame
Bases: EngineFrame
Categories: tableframe
A lazy, immutable tabular frame -- Tabsdata's wrapper over polars
LazyFrame.
Every operation returns a new TableFrame without mutating the input.
Instances arrive as arguments (and are returned) in @publisher /
@transformer / @subscriber functions; build one directly with
TableFrame.from_polars / from_pandas / from_dict / empty.
Reference columns with col and constants with lit (both from
tabsdatak.tableframe.functions).
Examples
tf = TableFrame.from_dict({"g": ["x", "y", "x"], "v": [1, 2, 3]})
tf.filter(col("v") > 1).group_by("g").agg(col("v").sum().alias("total"))
Properties
Names of this TableFrame's columns, in column order.
#VERIFY: may expose hidden $TD.* system columns; the old API
filtered to user columns only.
Data type of each column, in column order.
#VERIFY: may expose hidden $TD.* system columns; the old API
filtered to user columns only.
schemaSchemaOrdered mapping of column name to data type, as a Schema.
#VERIFY: may expose hidden $TD.* system columns; the old API
filtered to user columns only.
widthintNumber of columns in this TableFrame.
#VERIFY: may count hidden $TD.* system columns; the old API
filtered to user columns only.
Methods
explaindef explain(
*,
format: ExplainFormat = 'plain',
optimized: bool = True,
type_coercion: bool = True,
predicate_pushdown: bool = True,
projection_pushdown: bool = True,
simplify_expression: bool = True,
slice_pushdown: bool = True,
comm_subplan_elim: bool = True,
comm_subexpr_elim: bool = True,
cluster_with_columns: bool = True,
collapse_joins: bool = True,
streaming: bool = False,
engine: EngineType = 'auto',
tree_format: bool | None = None,
optimizations: Any = ...,
) -> str
Return the query plan of this TableFrame as text.
The remaining boolean flags each toggle one query-plan optimization (predicate/projection pushdown, common-subplan elimination, ...); leave them at their defaults unless diagnosing the plan.
Parameters:
formatExplainFormat (Literal['plain', 'tree'])"plain" or "tree" rendering.
type_coercionboolpredicate_pushdownboolprojection_pushdownboolsimplify_expressionboolslice_pushdownboolcomm_subplan_elimboolcomm_subexpr_elimboolcluster_with_columnsboolcollapse_joinsboolengineEngineType (Literal['auto', 'in-memory', 'streaming', 'gpu'])Target engine -- "auto", "in-memory",
"streaming" or "gpu".
tree_formatbool | NoneoptimizationsAnyExample:
tf.filter(col("a") > 2).explain()
The tree rendering is easier to read for a deep plan:
tf.explain(format="tree")
show_graphdef show_graph(
*,
optimized: bool = True,
show: bool = True,
output_path: str | Path | None = None,
raw_output: bool = False,
figsize: tuple[float, float] = (16.0, 12.0),
type_coercion: bool = True,
_type_check: bool = True,
predicate_pushdown: bool = True,
projection_pushdown: bool = True,
simplify_expression: bool = True,
slice_pushdown: bool = True,
comm_subplan_elim: bool = True,
comm_subexpr_elim: bool = True,
cluster_with_columns: bool = True,
collapse_joins: bool = True,
engine: EngineType = 'auto',
plan_stage: PlanStage | None = None,
_check_order: bool = True,
optimizations: Any = ...,
) -> str | None
Render the query plan of this TableFrame as a graph.
The remaining boolean flags toggle individual query-plan optimizations; leave them at their defaults unless diagnosing the plan.
Parameters:
type_coercionbool_type_checkboolpredicate_pushdownboolprojection_pushdownboolsimplify_expressionboolslice_pushdownboolcomm_subplan_elimboolcomm_subexpr_elimboolcluster_with_columnsboolcollapse_joinsboolengineEngineType (Literal['auto', 'in-memory', 'streaming', 'gpu'])Engine whose plan is graphed; "auto" by default.
plan_stagePlanStage | None (Literal['ir', 'physical'] | None)Plan stage to graph, "ir" or "physical". Only the
streaming engine has a separate physical stage. When omitted it
graphs the "ir" stage and polars warns that the default
becomes "physical" in Polars 2.0; pass plan_stage="ir" to
keep the current output without the warning.
_check_orderbooloptimizationsAnyExample:
tf.show_graph() # opens the rendered plan; needs Graphviz
Skip the viewer and take the DOT source instead:
tf.show_graph(show=False, raw_output=True)
inspectdef inspect(fmt: str = '{}') -> TableFrame
Print this TableFrame mid-chain and pass it through unchanged.
Handy for debugging a chained pipeline: it returns the same
TableFrame so it can sit between other operations.
Parameters:
Example:
tf.filter(col("a") > 1).inspect().select("a", "b")
sortdef sort(
by: IntoExpr | Iterable[IntoExpr],
*more_by: IntoExpr = (),
descending: bool | Sequence[bool] = False,
nulls_last: bool | Sequence[bool] = False,
maintain_order: bool = False,
multithreaded: bool = True,
) -> TableFrame
Sort the rows by one or more columns or expressions.
Parameters:
byIntoExpr | Iterable[IntoExpr] (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None | Iterable[int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None])Column name(s) or expression(s) to sort by.
*more_byIntoExpr (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None)Additional sort keys, as positional arguments.
multithreadedboolExample:
tf.sort("k", descending=True)
tf.sort(["k", "n"], descending=[True, False])
castdef cast(
dtypes: Mapping[ColumnNameOrSelector | PolarsDataType, PolarsDataType | PythonDataType] | PolarsDataType | Schema,
*,
strict: bool = True,
) -> TableFrame
Cast columns to new data types.
Data types come from tabsdatak.tableframe.datatypes.
Parameters:
dtypesMapping[ColumnNameOrSelector | PolarsDataType, PolarsDataType | PythonDataType] | PolarsDataType | Schema (Mapping[str | Any | DataType, DataType | type[int] | type[float] | type[bool] | type[str] | type[date] | type[time] | type[datetime] | type[timedelta] | type[list[Any]] | type[tuple[Any, ...]] | type[bytes] | type[object] | type[Decimal] | type[None]] | DataType | Schema)A single data type applied to every column, a mapping of
column (name or selector) to its target data type, or a
Schema.
strictboolIf True (default), raise when a value cannot be cast;
if False, unconvertible values become null.
Example:
tf.cast({"a": Float64, "b": String})
tf.cast({"id": Int8}, strict=False)
cleardef clear(n: int = 0) -> TableFrame
Return a frame with the same schema but no data.
Parameters:
nintNumber of all-null rows to produce. 0 (default) yields a
zero-row frame; a positive n yields n rows of nulls.
Example:
tf.clear()
A positive n keeps the schema and yields that many all-null rows:
tf.clear(3)
filterdef filter(
*predicates: IntoExprColumn | Iterable[IntoExprColumn] | bool | list[bool] = (),
**constraints: Any = {},
) -> TableFrame
Keep only the rows matching every given predicate.
Parameters:
*predicatesIntoExprColumn | Iterable[IntoExprColumn] | bool | list[bool] (Expr | str | Iterable[Expr | str] | bool | list[bool])Boolean expressions; a row is kept only if it satisfies ALL of them (they are AND-ed together).
**constraintsAnyColumn-equality shortcuts as keyword arguments --
filter(g="x") means filter(col("g") == "x").
Example:
tf.filter(col("a") > 2)
tf.filter((col("a") > 1) & (col("a") < 5))
tf.filter(col("g").is_in(["x", "y"]))
tf.filter(g="x")
selectdef select(
*exprs: IntoExpr | Iterable[IntoExpr] = (),
**named_exprs: IntoExpr = {},
) -> TableFrame
Select and/or derive columns, dropping every other column.
Parameters:
*exprsIntoExpr | Iterable[IntoExpr] (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None | Iterable[int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None])Column names or expressions to keep; each expression
becomes a column (name it with Expr.alias).
**named_exprsIntoExpr (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None)Expressions as keyword arguments, where the keyword is the output column name.
Example:
tf.select("a", "b")
tf.select((col("a") * 2).alias("a2"))
tf.select(a2=col("a") * 2)
group_bydef group_by(
*by: IntoExpr | Iterable[IntoExpr] = (),
maintain_order: bool = False,
**named_by: IntoExpr = {},
) -> LazyGroupBy
Group rows by one or more keys for aggregation.
Returns a LazyGroupBy; call .agg(...) on it with reducing
expressions to produce one row per group. Prefer
agg(col(...).<reduction>()) over the LazyGroupBy reduction
shortcuts (see LazyGroupBy).
Parameters:
*byIntoExpr | Iterable[IntoExpr] (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None | Iterable[int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None])Column name(s) or expression(s) to group by.
**named_byIntoExpr (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None)Grouping expressions as keyword arguments, where the keyword names the group column.
Example:
tf.group_by("k").agg(col("v").sum().alias("s"))
joindef join(
other: TableFrame,
on: str | Expr | Sequence[str | Expr] | None = None,
how: JoinStrategy = 'inner',
*,
left_on: str | Expr | Sequence[str | Expr] | None = None,
right_on: str | Expr | Sequence[str | Expr] | None = None,
suffix: str = '_right',
) -> TableFrame
Join this TableFrame with another on one or more keys.
#MANUAL CHANGE POST GEN: dropped the generated params validate,
nulls_equal, coalesce, maintain_order, allow_parallel,
force_parallel -- the runtime does not accept them (TypeError).
Parameters:
Key column(s) present in BOTH frames. Use this OR
left_on/right_on, never both; omit it for
how="cross".
howJoinStrategy (Literal['inner', 'left', 'right', 'full', 'semi', 'anti', 'cross', 'outer'])Join strategy -- one of "inner", "left", "right",
"full" (a.k.a. "outer"), "cross", "semi" or
"anti". "semi" keeps left rows that have a match,
"anti" keeps those that do not, and "cross" is the
cartesian product (takes no keys).
Key column(s) on the left frame, paired positionally with
right_on when the join keys have different names.
Key column(s) on the right frame; use with left_on.
suffixstrSuffix added to right-frame columns whose names collide
with the left frame (default "_right").
Example:
left.join(right, on="id", how="inner")
left.join(right, left_on="id", right_on="rid")
left.join(right, how="cross")
with_columnsdef with_columns(
*exprs: IntoExpr | Iterable[IntoExpr] = (),
**named_exprs: IntoExpr = {},
) -> TableFrame
Add or replace columns, keeping all existing ones.
Like select but non-destructive: the given expressions are added,
and any whose name matches an existing column replaces it in place.
Parameters:
*exprsIntoExpr | Iterable[IntoExpr] (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None | Iterable[int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None])Expressions to add; name each with Expr.alias.
**named_exprsIntoExpr (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None)Expressions as keyword arguments, where the keyword is the output column name.
Example:
tf.with_columns((col("a") + 1).alias("c"))
tf.with_columns(c=col("a") + col("b"))
dropdef drop(
*columns: ColumnNameOrSelector | Iterable[ColumnNameOrSelector] = (),
strict: bool = True,
) -> TableFrame
Remove the named columns.
Parameters:
Column name(s) or selector(s) to drop, as several positional arguments or a single list.
strictboolIf True (default), raise when a named column is
missing; if False, silently ignore missing names.
Example:
tf.drop("a", "b")
tf.drop(["b", "c"])
renamedef rename(
mapping: Mapping[str, str] | Callable[[str], str],
*,
strict: bool = True,
) -> TableFrame
Rename columns.
#VERIFY: the callable form (a function over column names) has a known
system-column divergence (xp failing sub-suite); the dict form is
the reliable one.
Parameters:
A dict of {old_name: new_name} (the reliable form),
or a callable applied to each existing column name to produce
its new name.
Example:
tf.rename({"a": "x", "b": "y"})
slicedef slice(offset: int, length: int | None = None) -> TableFrame
Return length rows starting at row offset.
Parameters:
Example:
tf.slice(1, 2) # two rows, starting at the second
Omit the length to take everything from offset on:
tf.slice(2)
limitdef limit(n: int = 5) -> TableFrame
Return the first n rows (an alias of head).
Parameters:
Example:
tf.limit(3)
headdef head(n: int = 5) -> TableFrame
Return the first n rows.
Parameters:
Example:
tf.head(3)
taildef tail(n: int = 5) -> TableFrame
Return the last n rows.
Parameters:
Example:
tf.tail(3)
lastfirstfill_nulldef fill_null(
value: Any | Expr | None = None,
strategy: FillNullStrategy | None = None,
limit: int | None = None,
*,
matches_supertype: bool = True,
) -> TableFrame
Replace null values with a value or a fill strategy.
Provide either value or strategy, not both.
Parameters:
strategyFillNullStrategy | None (Literal['forward', 'backward', 'min', 'max', 'mean', 'zero', 'one'] | None)Fill rule instead of a value -- one of "forward",
"backward", "min", "max", "mean", "zero"
or "one".
limitint | NoneWith "forward" / "backward", the maximum number of
consecutive nulls to fill.
matches_supertypeboolCast the fill value to the column's supertype when their types differ.
Example:
tf.fill_null(0)
tf.sort("id").fill_null(strategy="forward", limit=1)
fill_nandef fill_nan(value: int | float | Expr | None) -> TableFrame
Replace floating-point NaN values with the given value.
Targets NaN entries in float columns -- distinct from fill_null,
which replaces nulls.
Parameters:
Example:
tf.fill_nan(0.0)
uniquedef unique(
subset: IntoExpr | Collection[IntoExpr] | None = None,
*,
keep: UniqueKeepStrategy = 'any',
maintain_order: bool = False,
) -> TableFrame
Remove duplicate rows.
#VERIFY: omitting subset (dedup on all columns) has a known
system-column divergence (xp failing sub-suite); pass subset
explicitly.
Parameters:
subsetIntoExpr | Collection[IntoExpr] | None (int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None | Collection[int | float | Decimal | date | time | datetime | timedelta | str | bool | bytes | list[Any] | Expr | str | None] | None)Column(s) whose values define a duplicate; pass this explicitly. When omitted, all columns are considered.
keepUniqueKeepStrategy (Literal['first', 'last', 'any', 'none'])Which duplicate to keep -- "any" (default, fastest),
"first", "last" or "none" (drop every duplicated
row).
Example:
tf.unique(subset="a")
tf.unique(subset="k", keep="last")
drop_nansdef drop_nans(
subset: ColumnNameOrSelector | Collection[ColumnNameOrSelector] | None = None,
) -> TableFrame
Drop rows containing floating-point NaN values.
Parameters:
subsetColumnNameOrSelector | Collection[ColumnNameOrSelector] | None (str | Any | Collection[str | Any] | None)Column(s) to check for NaN; when omitted, all columns
are considered.
Example:
tf.drop_nans("v")
Omit the subset to drop a row when any float column holds NaN:
tf.drop_nans()
drop_nullsdef drop_nulls(
subset: ColumnNameOrSelector | Collection[ColumnNameOrSelector] | None = None,
) -> TableFrame
Drop rows containing null values.
Parameters:
subsetColumnNameOrSelector | Collection[ColumnNameOrSelector] | None (str | Any | Collection[str | Any] | None)Column(s) to check for nulls; when omitted, all columns are considered.
Example:
tf.drop_nulls("v")
Omit the subset to drop a row when any column is null:
tf.drop_nulls()
unnestdef unnest(
columns: ColumnNameOrSelector | Collection[ColumnNameOrSelector] | None = None,
*more_columns: ColumnNameOrSelector = (),
separator: str | None = None,
) -> TableFrame
Expand struct columns into one column per field.
Each named struct column is replaced, in place, by its fields as top-level columns. With no columns given, every struct column is expanded.
Parameters:
columnsColumnNameOrSelector | Collection[ColumnNameOrSelector] | None (str | Any | Collection[str | Any] | None)Struct column(s) to expand; all struct columns when omitted.
Additional struct columns, as positional arguments.
separatorstr | NoneIf given, prefix each new column with its parent name and this separator to avoid name clashes.
Example:
tf.unnest("s")
tf.unnest("s", "t")
Expand every struct column at once:
tf.unnest()
grokdef grok(
expr: str | Expr,
pattern: str,
schema: Mapping[str, ColumnDefinition],
) -> TableFrame
Parse unstructured text into columns with a Grok pattern.
Matches pattern against a string column and appends one column
per named capture, keeping every existing column. A row whose text
does not match gets null in each new column, so a bad line never
fails the read. ColumnDefinition (from
tabsdatak.tableframe.grok) names each new column and gives its
data type.
Parameters:
schemaMapping[str, ColumnDefinition]Mapping of capture name to the ColumnDefinition
describing the column it produces. A definition whose
name differs from the capture renames the output column;
its dtype is what the captured text is parsed into.
Returns:
A new TableFrame with one column added per capture.
Example:
tf.grok(
"logs",
r"%{WORD:user}-%{WORD:action}-%{INT:year}",
{
"user": ColumnDefinition("user", String),
"action": ColumnDefinition("action", String),
"year": ColumnDefinition("year", Int64),
},
)
A definition can rename the capture, and the source column may be given as an expression:
tf.grok(
col("logs"),
r"%{WORD:user}-.*",
{"user": ColumnDefinition("who", String)},
)
When a pattern repeats a capture name, the extra columns are
disambiguated with a numeric suffix (field, field[1]).
udfdef udf(on: str | Expr | list[str | Expr], function: UDF) -> TableFrame
Append the columns a user defined function computes.
function reads the columns on selects, and nothing else, and
its output columns are appended to the frame, keeping every
existing column. An output column named like an existing one
replaces it. The function runs as part of the lazy plan, streaming
over the data one batch at a time: on_batch receives a pyarrow
array per input column, and on_element a Python value per input
column, row by row. function is a UDF subclass instance, or a
plain function or lambda turned into one with the on_batch /
on_element decorators; see tabsdatak.tableframe.udf.
Parameters:
Name of the input column, an expression resolving to one or more columns, or a list of them. They are passed to the function in this order, and each column at most once.
functionUDFThe UDF computing the output columns.
Returns:
A new TableFrame with the function's output columns.
Raises:
UDFDefinitionException— Whenonselects no column, a column twice or a column the frame does not have, orfunctionis not aUDFor is not defined correctly.SystemColumnWriteError— When an output column is a$td.*system column.UDFOutputException— When the data is processed, if the function returns a different number of columns or rows than it should, or values that do not fit an output data type.UDFException— When the data is processed, if the function raises an error of its own, which becomes its cause.
Example:
import pyarrow as pa
import pyarrow.compute as pc
class Total(UDF):
def __init__(self):
super().__init__(("total", Int64))
def on_batch(
self, arrays: list[pa.Int64Array]
) -> list[pa.Int64Array]:
return [pc.add(arrays[0], arrays[1])]
tf.udf(["a", "b"], Total())
Row by row, receiving each input as its own argument:
class Ratio(UDFUnpacked):
def __init__(self):
super().__init__(("ratio", Float64))
def on_element(self, numerator: int, denominator: int) -> list[float]:
return [numerator / denominator]
tf.udf(col("a", "n"), Ratio())
A plain function, or an inline lambda:
@on_element(("ratio", Float64))
def ratio(numerator: int, denominator: int) -> float:
return numerator / denominator
tf.udf(["a", "n"], ratio)
tf.udf("name", on_element(("upper", String))(lambda name: name.upper()))
Renaming the output columns, when the function is created or afterwards: every output column gets a new name, a prefix, a suffix or any of them together, and keeps its data type. This lets the same function be applied more than once:
class Bounds(UDF):
def __init__(self):
super().__init__([("low", Int64), ("high", Int64)])
def on_element(self, values: list[int]) -> list[int]:
return [min(values), max(values)]
@on_element(("ratio", Float64))
def ratio(numerator: int, denominator: int) -> float:
return numerator / denominator
tf.udf(["a", "b"], Bounds(output_names=["smallest", "largest"]))
tf.udf(["a", "b"], Bounds().with_names(["smallest", "largest"]))
tf.udf(["a", "n"], ratio.with_names("a_per_n"))
tf.udf(["a", "b"], Bounds(output_prefix="ab_")).udf(
["c", "n"], Bounds(output_prefix="cn_")
)
tf.udf(["b", "n"], ratio.with_names(output_suffix="_b_per_n"))
from_polarsdef from_polars(data = None, schema = None) -> TableFrame
Build a TableFrame from a polars frame.
Takes a polars DataFrame or LazyFrame; any other input type
raises. The system columns are seeded on top of the given data.
Parameters:
dataThe polars DataFrame or LazyFrame to wrap. None
yields an empty frame.
schemaOptional {column: data type} mapping to cast the data
to; the data keeps its own types when omitted.
Returns:
A new TableFrame over the given data.
Example:
TableFrame.from_polars(pl.DataFrame({"a": [1, 2, 3]}))
TableFrame.from_polars(pl.LazyFrame({"a": [1, 2, 3]}))
from_pandasdef from_pandas(data = None, schema = None) -> TableFrame
Build a TableFrame from a pandas DataFrame.
Parameters:
dataThe pandas DataFrame to convert. None yields an
empty frame.
schemaOptional {column: data type} mapping to cast the data
to; the types pandas inferred are kept when omitted.
Returns:
A new TableFrame over the given data.
Example:
TableFrame.from_pandas(pd.DataFrame({"a": [1, 2, 3]}))
from_dictdef from_dict(data = None, schema = None) -> TableFrame
Build a TableFrame from a {column: values} dict.
Every value list must have the same length -- one entry per row.
Parameters:
dataMapping of column name to the column's values. None
yields an empty frame.
schemaOptional {column: data type} mapping to cast the
columns to; types are inferred from the values when omitted.
Returns:
A new TableFrame over the given data.
Example:
TableFrame.from_dict({"g": ["x", "y"], "v": [1, 2]})
Pin the column types instead of having them inferred:
TableFrame.from_dict({"v": [1, 2]}, schema={"v": Float64})
emptydef empty(schema = None) -> TableFrame
Build a TableFrame with no rows.
Parameters:
schemaOptional {column: data type} mapping giving the frame
its columns. Without it the frame has no columns either.
Returns:
A new, empty TableFrame.
Example:
TableFrame.empty(schema={"id": Int64, "name": String})
With no schema the result has neither rows nor columns -- useful
as the starting point of a concat:
TableFrame.empty()
extract_onedef extract_one(
with_connector_columns: bool = False,
fail_if_empty: bool = False,
) -> dict[str, DataType | None] | None
Return the only row as a column-to-value dictionary.
Internal columns are always dropped; connector columns are kept only when with_connector_columns is set. Fails if the TableFrame has more than one row. Returns None when the TableFrame is empty, unless fail_if_empty is set, in which case it fails.
Parameters:
with_connector_columnsboolKeep the connector columns a source attached to the row instead of dropping them.
Returns:
The row as {column: value}, or None when the frame is
Example:
tf.filter(col("id") == 1).extract_one()
Reading a single aggregate out of a frame is the common use:
tf.select(col("v").sum().alias("total")).extract_one()
max_fordef max_for(
*cols: str = (),
fail_if_empty: bool = False,
) -> dict[str, DataType | None] | None
Return the given columns of the row that ranks highest by them.
Each column is compared in its own natural order (numbers numerically, dates chronologically, strings alphabetically). The columns are ordered comparison keys: the first is primary, each subsequent one breaks ties on the previous. Returns None when the TableFrame is empty, unless fail_if_empty is set, in which case it fails.
Parameters:
Returns:
The named columns of the top-ranking row as {column: value},
Example:
tf.max_for("v")
With several keys the later ones break ties on the earlier:
tf.max_for("g", "v")
min_fordef min_for(
*cols: str = (),
fail_if_empty: bool = False,
) -> dict[str, DataType | None] | None
Return the given columns of the row that ranks lowest by them.
Each column is compared in its own natural order (numbers numerically, dates chronologically, strings alphabetically). The columns are ordered comparison keys: the first is primary, each subsequent one breaks ties on the previous. Returns None when the TableFrame is empty, unless fail_if_empty is set, in which case it fails.
Parameters:
Returns:
The named columns of the bottom-ranking row as
Example:
tf.min_for("v")
A cursor over an incremental read is the common use -- the lowest unprocessed key:
tf.filter(col("processed").not_()).min_for("id")