TableFrame.drop
methodView source ↗
def drop(
*columns: ColumnNameOrSelector | Iterable[ColumnNameOrSelector],
strict: bool = True,
) -> TdLazyFrame
Categories: projection
Discard columns from the TableFrame.
Parameters
parameter
columnsColumns to drop.
parameter
strictIf True, raises an error if a column does not exist.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
┌──────┬──────┐
│ x ┆ y │
│ --- ┆ --- │
│ f64 ┆ f64 │
╞══════╪══════╡
│ 1.0 ┆ 2.0 │
│ 2.0 ┆ 2.0 │
│ 10.0 ┆ 10.0 │
│ 4.0 ┆ 10.0 │
│ 5.0 ┆ null │
│ null ┆ null │
└──────┴──────┘
>>>
>>> tf.drop("y")
>>>
┌──────┐
│ x │
│ --- │
│ f64 │
╞══════╡
│ 1.0 │
│ 2.0 │
│ NaN │
│ 4.0 │
│ 5.0 │
│ null │
└──────┘