polars.Config.set_tbl_cell_numeric_alignment
-
Set table cell alignment for numeric columns.
- Parameters:
-
-
formatstr -
- “LEFT”: left aligned
- “CENTER”: center aligned
- “RIGHT”: right aligned
-
- Raises:
-
- KeyError: if alignment string not recognised.
Examples
>>> from datetime import date >>> df = pl.DataFrame( ... { ... "abc": [11, 2, 333], ... "mno": [date(2023, 10, 29), None, date(2001, 7, 5)], ... "xyz": [True, False, None], ... } ... ) >>> pl.Config.set_tbl_cell_numeric_alignment("RIGHT") >>> print(df) shape: (3, 3) ┌─────┬────────────┬───────┐ │ abc ┆ mno ┆ xyz │ │ --- ┆ --- ┆ --- │ │ i64 ┆ date ┆ bool │ ╞═════╪════════════╪═══════╡ │ 11 ┆ 2023-10-29 ┆ true │ │ 2 ┆ null ┆ false │ │ 333 ┆ 2001-07-05 ┆ null │ └─────┴────────────┴───────┘
classmethod Config.set_tbl_cell_numeric_alignment(
format: Alignment | None,
) → type[Config]
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/api/polars.Config.set_tbl_cell_numeric_alignment.html