polars.Series.dt.mean#

Series.dt.mean() TemporalLiteral | None[source]#

Return mean as python DateTime.

Examples

>>> from datetime import date, datetime
>>> s = pl.Series([date(2001, 1, 1), date(2001, 1, 2)])
>>> s.dt.mean()
datetime.datetime(2001, 1, 1, 12, 0)
>>> s = pl.Series(
...     [datetime(2001, 1, 1), datetime(2001, 1, 2), datetime(2001, 1, 3)]
... )
>>> s.dt.mean()
datetime.datetime(2001, 1, 2, 0, 0)