class_docstr: Series.dt namespace.
class_docstr_tok: ["Series.dt","namespace","."]
docstr: Set time unit a Series of dtype Datetime or Duration.
  
  This does not modify underlying data, and should be used to fix an incorrect
  time unit.
  
  Parameters
  ----------
  time_unit : {'ns', 'us', 'ms'}
      Unit of time for the `Datetime` Series.
  
  Examples
  --------
  >>> from datetime import datetime
  >>> s = pl.Series(
  ...     "datetime",
  ...     [datetime(2001, 1, 1), datetime(2001, 1, 2), datetime(2001, 1, 3)],
  ...     dtype=pl.Datetime(time_unit="ns"),
  ... )
  >>> s.dt.with_time_unit("us")
  shape: (3,)
  Series: 'datetime' [datetime[μs]]
  [
          +32971-04-28 00:00:00
          +32974-01-22 00:00:00
          +32976-10-18 00:00:00
  ]
code: def with_time_unit(self, time_unit: TimeUnit) -> Series:
      """
      Set time unit a Series of dtype Datetime or Duration.
  
      This does not modify underlying data, and should be used to fix an incorrect
      time unit.
  
      Parameters
      ----------
      time_unit : {'ns', 'us', 'ms'}
          Unit of time for the `Datetime` Series.
  
      Examples
      --------
      >>> from datetime import datetime
      >>> s = pl.Series(
      ...     "datetime",
      ...     [datetime(2001, 1, 1), datetime(2001, 1, 2), datetime(2001, 1, 3)],
      ...     dtype=pl.Datetime(time_unit="ns"),
      ... )
      >>> s.dt.with_time_unit("us")
      shape: (3,)
      Series: 'datetime' [datetime[μs]]
      [
              +32971-04-28 00:00:00
              +32974-01-22 00:00:00
              +32976-10-18 00:00:00
      ]
  
      """
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from polars.datatypes import Date
  from polars.series.utils import expr_dispatch
  from polars.utils._wrap import wrap_s
  from polars.utils.convert import _to_python_date, _to_python_datetime
  from polars.utils.deprecation import deprecate_renamed_function
label_desc: Use image node_id 29 for calling the DateTimeNameSpace obj's underlying member method code with example usage: obj.with_time_unit(time_unit) without return types