class_docstr: Namespace for datetime related expressions.
docstr: Extract year from underlying Date representation.
  
  Applies to Date and Datetime columns.
  
  Returns the year number in the calendar date.
  
  Returns
  -------
  Expr
      Expression of data type :class:`Int32`.
  
  Examples
  --------
  >>> from datetime import date
  >>> df = pl.DataFrame(
  ...     {"date": [date(1977, 1, 1), date(1978, 1, 1), date(1979, 1, 1)]}
  ... )
  >>> df.select(
  ...     "date",
  ...     pl.col("date").dt.year().alias("calendar_year"),
  ...     pl.col("date").dt.iso_year().alias("iso_year"),
  ... )
  shape: (3, 3)
  ┌────────────┬───────────────┬──────────┐
  │ date       ┆ calendar_year ┆ iso_year │
  │ ---        ┆ ---           ┆ ---      │
  │ date       ┆ i32           ┆ i32      │
  ╞════════════╪═══════════════╪══════════╡
  │ 1977-01-01 ┆ 1977          ┆ 1976     │
  │ 1978-01-01 ┆ 1978          ┆ 1977     │
  │ 1979-01-01 ┆ 1979          ┆ 1979     │
  └────────────┴───────────────┴──────────┘
docstr_tok: ["Extract","year","from","underlying","Date","representation",".","Applies","to","Date","and","Datetime","columns",".","Returns","the","year","number","in","the","calendar","date",".","Returns","--","--","--","-","Expr","Expression","of","data","type",":","class",":","`","Int32","`",".","Examples","--","--","--","--",">",">",">","from","datetime","import","date",">",">",">","df","=","pl.DataFrame","(","...","{","``","date","''",":","[","date","(","1977",",","1",",","1",")",",","date","(","1978",",","1",",","1",")",",","date","(","1979",",","1",",","1",")","]","}","...",")",">",">",">","df.select","(","...","``","date","''",",","...","pl.col","(","``","date","''",")",".dt.year","(",")",".alias","(","``","calendar_year","''",")",",","...","pl.col","(","``","date","''",")",".dt.iso_year","(",")",".alias","(","``","iso_year","''",")",",","...",")","shape",":","(","3",",","3",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","date","\u2506","calendar_year","\u2506","iso_year","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","date","\u2506","i32","\u2506","i32","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","1977-01-01","\u2506","1977","\u2506","1976","\u2502","\u2502","1978-01-01","\u2506","1978","\u2506","1977","\u2502","\u2502","1979-01-01","\u2506","1979","\u2506","1979","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def year(self) -> Expr:
      """
      Extract year from underlying Date representation.
  
      Applies to Date and Datetime columns.
  
      Returns the year number in the calendar date.
  
      Returns
      -------
      Expr
          Expression of data type :class:`Int32`.
  
      Examples
      --------
      >>> from datetime import date
      >>> df = pl.DataFrame(
      ...     {"date": [date(1977, 1, 1), date(1978, 1, 1), date(1979, 1, 1)]}
      ... )
      >>> df.select(
      ...     "date",
      ...     pl.col("date").dt.year().alias("calendar_year"),
      ...     pl.col("date").dt.iso_year().alias("iso_year"),
      ... )
      shape: (3, 3)
      ┌────────────┬───────────────┬──────────┐
      │ date       ┆ calendar_year ┆ iso_year │
      │ ---        ┆ ---           ┆ ---      │
      │ date       ┆ i32           ┆ i32      │
      ╞════════════╪═══════════════╪══════════╡
      │ 1977-01-01 ┆ 1977          ┆ 1976     │
      │ 1978-01-01 ┆ 1978          ┆ 1977     │
      │ 1979-01-01 ┆ 1979          ┆ 1979     │
      └────────────┴───────────────┴──────────┘
  
      """
      return wrap_expr(self._pyexpr.dt_year())
  
imports: from __future__ import annotations
  import datetime
  from typing import TYPE_CHECKING
  import polars._reexport
  from polars import functions
  from polars.datatypes import DTYPE_TEMPORAL_UNITS, Date, Int32
  from polars.utils._parse_expr_input import parse_as_expression
  from polars.utils._wrap import wrap_expr
  from polars.utils.convert import _timedelta_to_pl_duration
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_saturating, issue_deprecation_warning, rename_use_earliest_to_ambiguous
label_desc: Use image node_id 7 for calling the ExprDateTimeNameSpace obj's underlying member method code with example usage: obj.year() and returns: wrap_expr