polars.DataFrame.glimpse#

DataFrame.glimpse() str[source]#

Print a dense preview of the dataframe.

Printing is done one line per column, so wide dataframes show nicely. Each line will show the column name, the data type and the first few values.

See also

describe, head, tail

Examples

>>> from datetime import date
>>> df = pl.DataFrame(
...     {
...         "a": [1.0, 2.8, 3.0],
...         "b": [4, 5, None],
...         "c": [True, False, True],
...         "d": [None, "b", "c"],
...         "e": ["usd", "eur", None],
...         "f": [date(2020, 1, 1), date(2021, 1, 2), date(2022, 1, 1)],
...     }
... )
>>> print(df.glimpse())
Rows: 3
Columns: 6
$ a  <f64> 1.0, 2.8, 3.0
$ b  <i64> 4, 5, None
$ c <bool> True, False, True
$ d  <str> None, b, c
$ e  <str> usd, eur, None
$ f <date> 2020-01-01, 2021-01-02, 2022-01-01