Skip to main content
Version: 0.9.6

TableFrame.drop

def drop(
*columns: ColumnNameOrSelector | Iterable[ColumnNameOrSelector],
strict: bool = True,
) -> TableFrame

Categories: projection

Discard columns from the TableFrame.

Parameters

parameter
columns

Columns to drop.

parameter
strict

If True, raises an error if a column does not exist.

Examples

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
┌──────┬──────┐
│ x ┆ y │
------
│ f64 ┆ f64 │
╞══════╪══════╡
1.02.0
2.02.0
10.010.0
4.010.0
5.0 ┆ null │
│ null ┆ null │
└──────┴──────┘
>>>
>>> tf.drop("y")
>>>
┌──────┐
│ x │
---
│ f64 │
╞══════╡
1.0
2.0
│ NaN │
4.0
5.0
│ null │
└──────┘