polars.Config.set_tbl_column_data_type_inline#

classmethod Config.set_tbl_column_data_type_inline(
active: bool | None = True,
) type[Config][source]#

Display the data type next to the column name (to the right, in parentheses).

Examples

>>> df = pl.DataFrame({"abc": [1.0, 2.5, 5.0], "xyz": [True, False, True]})
>>> pl.Config.set_tbl_column_data_type_inline(True)  
# ...
# shape: (3, 2)        shape: (3, 2)
# ┌─────┬───────┐      ┌───────────┬────────────┐
# │ abc ┆ xyz   │      │ abc (f64) ┆ xyz (bool) │
# │ --- ┆ ---   │      ╞═══════════╪════════════╡
# │ f64 ┆ bool  │      │ 1.0       ┆ true       │
# ╞═════╪═══════╡  >>  │ 2.5       ┆ false      │
# │ 1.0 ┆ true  │      │ 5.0       ┆ true       │
# │ 2.5 ┆ false │      └───────────┴────────────┘
# │ 5.0 ┆ true  │
# └─────┴───────┘