Skip to main content
Version: 1.5.1

alpha

def alpha(ascii_only: bool = False, ignore_spaces: bool = False) -> SelectorProxy

Categories: projection

Select all columns with names made up of only alphabetic characters.

Parameters: ascii_only: Only consider alphabetic the ASCII letters. ignore_spaces: Consider only non-white characters in column names.

Examples

>>> import tabsdata.tableframe as td_tf
>>>
>>> tf = td_tf.TableFrame({
... "Name": ["Alice", "Bob", "Caro", "Dan", "Eve", "Fay", "Gus", "Hana"],
... "Score": [87, 92, 78, 95, 88, 91, 76, 84],
... "Id1": [101, 102, 103, 104, 105, 106, 107, 108]
... })

Original: ┌─────────┬───────┬───────┐ │ Name ┆ Score ┆ Id1 │ │ --- ┆ --- ┆ --- │ │ str ┆ i64 ┆ i64 │ ╞═════════╪═══════╪═══════╡ │ "Alice" ┆ 87 ┆ 101 │ │ "Bob" ┆ 92 ┆ 102 │ │ "Caro" ┆ 78 ┆ 103 │ │ "Dan" ┆ 95 ┆ 104 │ │ "Eve" ┆ 88 ┆ 105 │ │ "Fay" ┆ 91 ┆ 106 │ │ "Gus" ┆ 76 ┆ 107 │ │ "Hana" ┆ 84 ┆ 108 │ └─────────┴───────┴───────┘

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

Selected: ┌─────────┬───────┐ │ Name ┆ Score │ │ --- ┆ --- │ │ str ┆ i64 │ ╞═════════╪═══════╡ │ "Alice" ┆ 87 │ │ "Bob" ┆ 92 │ │ "Caro" ┆ 78 │ │ "Dan" ┆ 95 │ │ "Eve" ┆ 88 │ │ "Fay" ┆ 91 │ │ "Gus" ┆ 76 │ │ "Hana" ┆ 84 │ └─────────┴───────┘