_frame_equal.html)
    * [ polars.testing.assert_frame_not_equal ](../../api/polars.testing.assert_frame_not_equal.html)
    * [ polars.testing.assert_series_equal ](../../api/polars.testing.assert_series_equal.html)
    * [ polars.testing.assert_series_not_equal ](../../api/polars.testing.assert_series_not_equal.html)
    * [ polars.testing.parametric.dataframes ](../../api/polars.testing.parametric.dataframes.html)
    * [ polars.testing.parametric.series ](../../api/polars.testing.parametric.series.html)
    * [ polars.testing.parametric.column ](../../api/polars.testing.parametric.column.html)
    * [ polars.testing.parametric.columns ](../../api/polars.testing.parametric.columns.html)
    * [ polars.testing.parametric.create_list_strategy ](../../api/polars.testing.parametric.create_list_strategy.html)
    * [ polars.testing.parametric.load_profile ](../../api/polars.testing.parametric.load_profile.html)
    * [ polars.testing.parametric.set_profile ](../../api/polars.testing.parametric.set_profile.html)

  * [ Metadata ](../../metadata.html) __
    * [ polars.build_info ](../../api/polars.build_info.html)
    * [ polars.get_index_type ](../../api/polars.get_index_type.html)
    * [ polars.show_versions ](../../api/polars.show_versions.html)
    * [ polars.thread_pool_size ](../../api/polars.thread_pool_size.html)
    * [ polars.threadpool_size ](../../api/polars.threadpool_size.html)

  * [ __ ](../../../index.html)
  * [ Python API reference ](../../index.html)
  * __
  * [ Temporal ](../temporal.html)
  * polars.Expr.... 

#  polars.Expr.dt.iso_year  #

Expr.dt.  iso_year  (  )  →  Expr  [ [source]  ](https://github.com/pola-
rs/polars/blob/main/py-polars/polars/expr/datetime.py#L839-L875) #

    

Extract ISO year from underlying Date representation.

Applies to Date and Datetime columns.

Returns the year number in the ISO standard. This may not correspond with the
calendar year.

Returns  :

    

Expr

    

Expression of data type ` 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     │
    └────────────┴───────────────┴──────────┘
    

[ __ previous  polars.Expr.dt.is_leap_year  ](polars.Expr.dt.is_leap_year.html
"previous page") [ next  polars.Expr.dt.microsecond  __
](polars.Expr.dt.microsecond.html "next page")

__ On this page

  * ` Expr.dt.iso_year()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.