polars.Config.set_fmt_float
-
Control how floating point values are displayed.
- Parameters:
-
-
fmt{“mixed”, “full”} -
How to format floating point numbers:
- “mixed”: Limit the number of decimal places and use scientific notation for large/small values.
- “full”: Print the full precision of the floating point number.
-
Examples
“mixed” float formatting:
>>> s = pl.Series([1.2304980958725870923, 1e6, 1e-8]) >>> with pl.Config(set_fmt_float="mixed"): ... print(s) shape: (3,) Series: '' [f64] [ 1.230498 1e6 1.0000e-8 ]“full” float formatting:
>>> with pl.Config(set_fmt_float="full"): ... print(s) shape: (3,) Series: '' [f64] [ 1.230498095872587 1000000 0.00000001 ]
classmethod Config.set_fmt_float(
fmt: FloatFmt | None = 'mixed',
) → 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_fmt_float.html