class_docstr: Namespace for string related expressions.
class_docstr_tok: ["Namespace","for","string","related","expressions","."]
docstr: Convert a String column into a Date/Datetime/Time column.
  
  Parameters
  ----------
  dtype
      The data type to convert into. Can be either Date, Datetime, or Time.
  format
      Format to use for conversion. Refer to the `chrono crate documentation
      <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>`_
      for the full specification. Example: `"%Y-%m-%d %H:%M:%S"`.
      If set to None (default), the format is inferred from the data.
  strict
      Raise an error if any conversion fails.
  exact
      Require an exact format match. If False, allow the format to match anywhere
      in the target string. Conversion to the Time type is always exact.
  
      .. note::
          Using `exact=False` introduces a performance penalty - cleaning your
          data beforehand will almost certainly be more performant.
  cache
      Use a cache of unique, converted dates to apply the datetime conversion.
  use_earliest
      Determine how to deal with ambiguous datetimes:
  
      - `None` (default): raise
      - `True`: use the earliest datetime
      - `False`: use the latest datetime
  
      .. deprecated:: 0.19.0
          Use `ambiguous` instead
  ambiguous
      Determine how to deal with ambiguous datetimes:
  
      - `'raise'` (default): raise
      - `'earliest'`: use the earliest datetime
      - `'latest'`: use the latest datetime
  
  Notes
  -----
  When converting to a Datetime type, the time unit is inferred from the format
  string if given, eg: `"%F %T%.3f"` => `Datetime("ms")`. If no fractional
  second component is found, the default is `"us"`.
  
  Examples
  --------
  Dealing with a consistent format:
  
  >>> s = pl.Series(["2020-01-01 01:00Z", "2020-01-01 02:00Z"])
  >>> s.str.strptime(pl.Datetime, "%Y-%m-%d %H:%M%#z")
  shape: (2,)
  Series: '' [datetime[μs, UTC]]
  [
          2020-01-01 01:00:00 UTC
          2020-01-01 02:00:00 UTC
  ]
  
  Dealing with different formats.
  
  >>> s = pl.Series(
  ...     "date",
  ...     [
  ...         "2021-04-22",
  ...         "2022-01-04 00:00:00",
  ...         "01/31/22",
  ...         "Sun Jul  8 00:34:60 2001",
  ...     ],
  ... )
  >>> s.to_frame().select(
  ...     pl.coalesce(
  ...         pl.col("date").str.strptime(pl.Date, "%F", strict=False),
  ...         pl.col("date").str.strptime(pl.Date, "%F %T", strict=False),
  ...         pl.col("date").str.strptime(pl.Date, "%D", strict=False),
  ...         pl.col("date").str.strptime(pl.Date, "%c", strict=False),
  ...     )
  ... ).to_series()
  shape: (4,)
  Series: 'date' [date]
  [
          2021-04-22
          2022-01-04
          2022-01-31
          2001-07-08
  ]
docstr_tok: ["Convert","a","String","column","into","a","Date\/Datetime\/Time","column",".","Parameters","--","--","--","--","--","dtype","The","data","type","to","convert","into",".","Can","be","either","Date",",","Datetime",",","or","Time",".","format","Format","to","use","for","conversion",".","Refer","to","the","`","chrono","crate","documentation","<","https",":","\/\/docs.rs\/chrono\/latest\/chrono\/format\/strftime\/index.html",">","`","_","for","the","full","specification",".","Example",":","`","``","%","Y-","%","m-","%","d","%","H",":","%","M",":","%","S","''","`",".","If","set","to","None","(","default",")",",","the","format","is","inferred","from","the","data",".","strict","Raise","an","error","if","any","conversion","fails",".","exact","Require","an","exact","format","match",".","If","False",",","allow","the","format","to","match","anywhere","in","the","target","string",".","Conversion","to","the","Time","type","is","always","exact",".","..","note",":",":","Using","`","exact=False","`","introduces","a","performance","penalty","-","cleaning","your","data","beforehand","will","almost","certainly","be","more","performant",".","cache","Use","a","cache","of","unique",",","converted","dates","to","apply","the","datetime","conversion",".","use_earliest","Determine","how","to","deal","with","ambiguous","datetimes",":","-","`","None","`","(","default",")",":","raise","-","`","True","`",":","use","the","earliest","datetime","-","`","False","`",":","use","the","latest","datetime","..","deprecated",":",":","0.19.0","Use","`","ambiguous","`","instead","ambiguous","Determine","how","to","deal","with","ambiguous","datetimes",":","-","`","'raise","'","`","(","default",")",":","raise","-","`","'earliest","'","`",":","use","the","earliest","datetime","-","`","'latest","'","`",":","use","the","latest","datetime","Notes","--","--","-","When","converting","to","a","Datetime","type",",","the","time","unit","is","inferred","from","the","format","string","if","given",",","eg",":","`","``","%","F","%","T","%",".3f","''","`","=",">","`","Datetime","(","``","ms","''",")","`",".","If","no","fractional","second","component","is","found",",","the","default","is","`","``","us","''","`",".","Examples","--","--","--","--","Dealing","with","a","consistent","format",":",">",">",">","s","=","pl.Series","(","[","``","2020-01-01","01:00Z","''",",","``","2020-01-01","02:00Z","''","]",")",">",">",">","s.str.strptime","(","pl.Datetime",",","``","%","Y-","%","m-","%","d","%","H",":","%","M","%","#","z","''",")","shape",":","(","2",",",")","Series",":","``","[","datetime","[","\u03bcs",",","UTC","]","]","[","2020-01-01","01:00:00","UTC","2020-01-01","02:00:00","UTC","]","Dealing","with","different","formats",".",">",">",">","s","=","pl.Series","(","...","``","date","''",",","...","[","...","``","2021-04-22","''",",","...","``","2022-01-04","00:00:00","''",",","...","``","01\/31\/22","''",",","...","``","Sun","Jul","8","00:34:60","2001","''",",","...","]",",","...",")",">",">",">","s.to_frame","(",")",".select","(","...","pl.coalesce","(","...","pl.col","(","``","date","''",")",".str.strptime","(","pl.Date",",","``","%","F","''",",","strict=False",")",",","...","pl.col","(","``","date","''",")",".str.strptime","(","pl.Date",",","``","%","F","%","T","''",",","strict=False",")",",","...","pl.col","(","``","date","''",")",".str.strptime","(","pl.Date",",","``","%","D","''",",","strict=False",")",",","...","pl.col","(","``","date","''",")",".str.strptime","(","pl.Date",",","``","%","c","''",",","strict=False",")",",","...",")","...",")",".to_series","(",")","shape",":","(","4",",",")","Series",":","'date","'","[","date","]","[","2021-04-22","2022-01-04","2022-01-31","2001-07-08","]"]
code: def strptime(
      self,
      dtype: PolarsTemporalType,
      format: str | None = None,
      *,
      strict: bool = True,
      exact: bool = True,
      cache: bool = True,
      use_earliest: bool | None = None,
      ambiguous: Ambiguous | Expr = "raise",
  ) -> Expr:
      """
      Convert a String column into a Date/Datetime/Time column.
  
      Parameters
      ----------
      dtype
          The data type to convert into. Can be either Date, Datetime, or Time.
      format
          Format to use for conversion. Refer to the `chrono crate documentation
          <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>`_
          for the full specification. Example: `"%Y-%m-%d %H:%M:%S"`.
          If set to None (default), the format is inferred from the data.
      strict
          Raise an error if any conversion fails.
      exact
          Require an exact format match. If False, allow the format to match anywhere
          in the target string. Conversion to the Time type is always exact.
  
          .. note::
              Using `exact=False` introduces a performance penalty - cleaning your
              data beforehand will almost certainly be more performant.
      cache
          Use a cache of unique, converted dates to apply the datetime conversion.
      use_earliest
          Determine how to deal with ambiguous datetimes:
  
          - `None` (default): raise
          - `True`: use the earliest datetime
          - `False`: use the latest datetime
  
          .. deprecated:: 0.19.0
              Use `ambiguous` instead
      ambiguous
          Determine how to deal with ambiguous datetimes:
  
          - `'raise'` (default): raise
          - `'earliest'`: use the earliest datetime
          - `'latest'`: use the latest datetime
  
      Notes
      -----
      When converting to a Datetime type, the time unit is inferred from the format
      string if given, eg: `"%F %T%.3f"` => `Datetime("ms")`. If no fractional
      second component is found, the default is `"us"`.
  
      Examples
      --------
      Dealing with a consistent format:
  
      >>> s = pl.Series(["2020-01-01 01:00Z", "2020-01-01 02:00Z"])
      >>> s.str.strptime(pl.Datetime, "%Y-%m-%d %H:%M%#z")
      shape: (2,)
      Series: '' [datetime[μs, UTC]]
      [
              2020-01-01 01:00:00 UTC
              2020-01-01 02:00:00 UTC
      ]
  
      Dealing with different formats.
  
      >>> s = pl.Series(
      ...     "date",
      ...     [
      ...         "2021-04-22",
      ...         "2022-01-04 00:00:00",
      ...         "01/31/22",
      ...         "Sun Jul  8 00:34:60 2001",
      ...     ],
      ... )
      >>> s.to_frame().select(
      ...     pl.coalesce(
      ...         pl.col("date").str.strptime(pl.Date, "%F", strict=False),
      ...         pl.col("date").str.strptime(pl.Date, "%F %T", strict=False),
      ...         pl.col("date").str.strptime(pl.Date, "%D", strict=False),
      ...         pl.col("date").str.strptime(pl.Date, "%c", strict=False),
      ...     )
      ... ).to_series()
      shape: (4,)
      Series: 'date' [date]
      [
              2021-04-22
              2022-01-04
              2022-01-31
              2001-07-08
      ]
      """
      if dtype == Date:
          return self.to_date(
              format, strict=strict, exact=exact, cache=cache
          )
      elif dtype == Datetime:
          time_unit = dtype.time_unit  # type: ignore[union-attr]
          time_zone = dtype.time_zone  # type: ignore[union-attr]
          return self.to_datetime(
              format,
              time_unit=time_unit,
              time_zone=time_zone,
              strict=strict,
              exact=exact,
              cache=cache,
              use_earliest=use_earliest,
              ambiguous=ambiguous,
          )
      elif dtype == Time:
          return self.to_time(format, strict=strict, cache=cache)
      else:
          raise ValueError(
              "`dtype` must be of type {Date, Datetime, Time}"
          )
  
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING
  import polars._reexport
  from polars import functions
  from polars.datatypes import Date, Datetime, Int32, Time, py_type_to_dtype
  from polars.exceptions import ChronoFormatWarning
  from polars.utils._parse_expr_input import parse_as_expression
  from polars.utils._wrap import wrap_expr
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_renamed_parameter, rename_use_earliest_to_ambiguous
  from polars.utils.various import find_stacklevel
label_desc: Use image node_id 5 for calling the ExprStringNameSpace obj's underlying member method code with example usage: obj.strptime(dtype, format) and returns: self, self, self