tabsdata.tableframe.selectors.exclude#

exclude(columns: str | DataTypeClass | DataType | Expr | Collection[str | DataTypeClass | DataType | Expr], *more_columns: str | DataTypeClass | DataType | Expr) SelectorProxy[source]#

Exclude specific columns from selection by name, data type, expression, or selector.

Parameters:
  • columns – A single column identifier or a collection of them. This can include: - Column names as strings - Data types - Selector functions - Supported expressions

  • *more_columns – Additional column identifiers passed as positional arguments.

Example

>>> import tabsdata.tableframe as td_tf
>>>
>>> tf = td_tf.TableFrame({
...     "Id": [1, 2, 3, 4, 5, 6, 7, 8],
...     "Name": ["A", "B", "C", "D", "E", "F", "G", "H"],
...     "Score": [90.0, 85.5, 88.0, 91.0, 86.0, 87.5, 84.0, 89.5],
...     "IsActive": [True, False, True, True, False, True, False, True]
... })

Original: ┌────┬──────┬───────┬──────────┐ │ Id ┆ Name ┆ Score ┆ IsActive │ │ —┆ — ┆ — ┆ — │ │ i64┆ str ┆ f64 ┆ bool │ ╞════╪══════╪═══════╪══════════╡ │ 1 ┆ “A” ┆ 90.0 ┆ true │ │ 2 ┆ “B” ┆ 85.5 ┆ false │ │ 3 ┆ “C” ┆ 88.0 ┆ true │ │ 4 ┆ “D” ┆ 91.0 ┆ true │ │ 5 ┆ “E” ┆ 86.0 ┆ false │ │ 6 ┆ “F” ┆ 87.5 ┆ true │ │ 7 ┆ “G” ┆ 84.0 ┆ false │ │ 8 ┆ “H” ┆ 89.5 ┆ true │ └────┴──────┴───────┴──────────┘

>>> tf.select(td_tf.selectors.exclude("Score", td_tf.selectors.boolean()))

Selected: ┌─────┬──────┐ │ Id ┆ Name │ │ — ┆ — │ │ i64 ┆ str │ ╞═════╪══════╡ │ 1 ┆ “A” │ │ 2 ┆ “B” │ │ 3 ┆ “C” │ │ 4 ┆ “D” │ │ 5 ┆ “E” │ │ 6 ┆ “F” │ │ 7 ┆ “G” │ │ 8 ┆ “H” │ └───═─┴──────┘