tabsdata.tableframe.selectors.digit#

digit(ascii_only: bool = False) SelectorProxy[source]#

Select all columns whose names consist only of digit characters.

Parameters:

ascii_only – Restrict matching to ASCII digits (“0”–“9”) only, instead of all Unicode digits (`d’).

Example

>>> import tabsdata.tableframe as td_tf
>>>
>>> tf = td_tf.TableFrame({
...     "2023": [100, 200, 300, 400, 500, 600, 700, 800],
...     "Temp": [20.5, 21.0, 22.0, 20.0, 19.5, 18.0, 21.5, 22.5],
...     "01": [1, 2, 3, 4, 5, 6, 7, 8],
...     "Humidity": [60, 65, 55, 70, 75, 80, 68, 66]
... })

Original: ┌──────┬──────┬────┬──────────┐ │ 2023 ┆ Temp ┆ 01 ┆ Humidity │ │ — ┆ — ┆ – ┆ — │ │ i64 ┆ f64 ┆ i64┆ i64 │ ╞══════╪══════╪════╪══════════╡ │ 100 ┆ 20.5 ┆ 1 ┆ 60 │ │ 200 ┆ 21.0 ┆ 2 ┆ 65 │ │ 300 ┆ 22.0 ┆ 3 ┆ 55 │ │ 400 ┆ 20.0 ┆ 4 ┆ 70 │ │ 500 ┆ 19.5 ┆ 5 ┆ 75 │ │ 600 ┆ 18.0 ┆ 6 ┆ 80 │ │ 700 ┆ 21.5 ┆ 7 ┆ 68 │ │ 800 ┆ 22.5 ┆ 8 ┆ 66 │ └──────┴──────┴────┴──────────┘

>>> tf.select(td_tf.selectors.digit())

Selected: ┌──────┬─────┐ │ 2023 ┆ 01 │ │ — ┆ – │ │ i64 ┆ i64 │ ╞══════╪═════╡ │ 100 ┆ 1 │ │ 200 ┆ 2 │ │ 300 ┆ 3 │ │ 400 ┆ 4 │ │ 500 ┆ 5 │ │ 600 ┆ 6 │ │ 700 ┆ 7 │ │ 800 ┆ 8 │ └──────┴─────┘