Ë
    TÇ.h8ñ ã                  ól  — d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d d	lm
Z
 d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ erd dlmZ d dlmZ d dlmZ d;d„Z G d„ d«      Z ede¬«      Z G d„ dee   «      Z G d„ dee   «      Z G d„ dee   «      Z G d„ dee   «      Z G d„ d ee   «      Zd<d!„Z d=d"„Z!d>d#„Z"d>d$„Z#d?d%„Z$d?d&„Z%d?d'„Z&d?d(„Z'd?d)„Z(d@d*„Z)d@d+„Z*d@d,„Z+ G d-„ d.«      Z, G d/„ d0e«      Z-dAd1„Z.d@d2„Z/dBdCd4„Z0d@d5„Z1d@d6„Z2d7d8d9œ	 	 	 	 	 	 	 	 	 dDd:„Z3dgZ4y3)Eé    )Úannotations)ÚTYPE_CHECKING)ÚAny)ÚCallable)ÚGeneric)ÚIterable)ÚLiteral)ÚMapping)ÚSequence)ÚTypeVar)Úis_numpy_array)Ú_validate_dtype)Ú_validate_rolling_arguments)Úflatten)ÚSelf)ÚDType)ÚIntoExprÚExprc                ó„   — ddl m} t        |t        «      r|j	                  | «      S t        ||«      r|j
                  S |S )Nr   )ÚSeries)Únarwhals.seriesr   Ú
isinstancer   Ú_to_compliant_exprÚ_compliant_series)ÚexprÚotherr   s      úa/var/www/html/School_Mangement_New/src/backend/venv/lib/python3.12/site-packages/narwhals/expr.pyÚextract_compliantr      s;   € Ý&ä%œÔØ×'Ñ'¨Ó-Ð-Ü%˜Ô Ø×&Ñ&Ð&Ø€Ló    c                  ó  — e Zd Zdcd„Zddd„Zded„Zdfd„Zdgd„Zdhd„Zdhd„Z	did„Z
did	„Zdid
„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zdid„Zddd„Z ddd„Z!ddd „Z"d!d!d!d!d"d#d$d%œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 djd&„Z#ddd'„Z$ddd(„Z%d#d)œdkd*„Z&	 dl	 	 	 	 	 dmd+„Z'dnd,„Z(dod-„Z)ddd.„Z*ddd/„Z+ddd0„Z,ddd1„Z-ddd2„Z.ddd3„Z/d$d4œdpd5„Z0ddd6„Z1d$d7œdqd8„Z2ddd9„Z3drd:„Z4	 dld!d;œ	 	 	 	 	 	 	 dsd<„Z5d$d$d=œdtd>„Z6	 du	 	 	 	 	 	 	 dvd?„Z7did@„Z8dwdA„Z9dddB„Z:dddC„Z;	 	 	 dx	 	 	 	 	 	 	 dydD„Z<dddE„Z=	 dld!d$d!dFœ	 	 	 	 	 	 	 	 	 	 	 dzdG„Z>d{dH„Z?dddI„Z@dddJ„ZAdddK„ZBdddL„ZCdddM„ZD	 	 	 	 	 	 d|dN„ZEd}drdO„ZFd}drdP„ZGd~ddQ„ZHdddR„ZId~d€dS„ZJ	 	 d	 	 	 	 	 d‚dT„ZKdndU„ZLdndV„ZMd$d7œdqdW„ZNd$d7œdqdX„ZOd$d7œdqdY„ZPd$d7œdqdZ„ZQd!d$d[œ	 	 	 	 	 	 	 	 	 dƒd\„ZRd!d$d[œ	 	 	 	 	 	 	 	 	 dƒd]„ZSeTd„d^„«       ZUeTd…d_„«       ZVeTd†d`„«       ZWeTd‡da„«       ZXeTdˆdb„«       ZYy!)‰r   c                ó   — || _         y ©N)r   )ÚselfÚto_compliant_exprs     r   Ú__init__zExpr.__init__$   s
   € à"3ˆÕr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )Nc                ó^   •— ‰j                  | «      j                  «       j                  «       S r"   )r   ÚabsÚsum©Úplxr#   s    €r   ú<lambda>z$Expr._taxicab_norm.<locals>.<lambda>+   s$   ø€ ¨$×*AÑ*AÀ#Ó*F×*JÑ*JÓ*L×*PÑ*PÓ*R€ r   ©Ú	__class__©r#   s   `r   Ú_taxicab_normzExpr._taxicab_norm(   s   ø€ ð ~‰~ÓRÓSÐSr   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uµ  Rename the expression.

        Arguments:
            name: The new name.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 2], "b": [4, 5]})
            >>> df_pl = pl.DataFrame({"a": [1, 2], "b": [4, 5]})
            >>> df_pa = pa.table({"a": [1, 2], "b": [4, 5]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select((nw.col("b") + 10).alias("c")).to_native()

            We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                c
            0  14
            1  15
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ c   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 14  â”‚
            â”‚ 15  â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            c: int64
            ----
            c: [[14,15]]

        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Úalias)r+   Únamer#   s    €€r   r,   zExpr.alias.<locals>.<lambda>^   s   ø€ ¨$×*AÑ*AÀ#Ó*F×*LÑ*LÈTÓ*R€ r   r-   )r#   r4   s   ``r   r3   z
Expr.alias.   s   ù€ ð` ~‰~ÔRÓSÐSr   c                ó   —  || g|¢­i |¤ŽS )ul  Pipe function call.

        Arguments:
            function: Function to apply.
            args: Positional arguments to pass to function.
            kwargs: Keyword arguments to pass to function.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [1, 2, 3, 4]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Lets define a library-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").pipe(lambda x: x + 1)).to_native()

            We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a
            0  2
            1  3
            2  4
            3  5
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 2   â”‚
            â”‚ 3   â”‚
            â”‚ 4   â”‚
            â”‚ 5   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[2,3,4,5]]
        © )r#   ÚfunctionÚargsÚkwargss       r   Úpipez	Expr.pipe`   s   € ñl ˜Ð.˜tÒ. vÑ.Ð.r   c                óF   ‡ ‡— t        ‰«       ‰ j                  ˆˆ fd„«      S )ug  Redefine an object's data type.

        Arguments:
            dtype: Data type that the object will be cast into.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> from datetime import date
            >>> df_pd = pd.DataFrame({"foo": [1, 2, 3], "bar": [6.0, 7.0, 8.0]})
            >>> df_pl = pl.DataFrame({"foo": [1, 2, 3], "bar": [6.0, 7.0, 8.0]})
            >>> df_pa = pa.table({"foo": [1, 2, 3], "bar": [6.0, 7.0, 8.0]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("foo").cast(nw.Float32), nw.col("bar").cast(nw.UInt8)
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               foo  bar
            0  1.0    6
            1  2.0    7
            2  3.0    8
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ foo â”† bar â”‚
            â”‚ --- â”† --- â”‚
            â”‚ f32 â”† u8  â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1.0 â”† 6   â”‚
            â”‚ 2.0 â”† 7   â”‚
            â”‚ 3.0 â”† 8   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            foo: float
            bar: uint8
            ----
            foo: [[1,2,3]]
            bar: [[6,7,8]]
        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Úcast)r+   Údtyper#   s    €€r   r,   zExpr.cast.<locals>.<lambda>Ð   s   ø€ ˜×/Ñ/°Ó4×9Ñ9¸%Ó@€ r   )r   r.   )r#   r>   s   ``r   r=   z	Expr.cast˜   s"   ù€ ôl 	˜ÔØ~‰~Ü@ó
ð 	
r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__eq__r   ©r+   r   r#   s    €€r   r,   zExpr.__eq__.<locals>.<lambda>Ö   ó&   ø€ ˜×/Ñ/°Ó4×;Ñ;Ô<MÈcÐSXÓ<YÓZ€ r   r-   ©r#   r   s   ``r   rA   zExpr.__eq__Ô   ó   ù€ Ø~‰~ÜZó
ð 	
r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__ne__r   rB   s    €€r   r,   zExpr.__ne__.<locals>.<lambda>Û   rC   r   r-   rD   s   ``r   rH   zExpr.__ne__Ù   rE   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__and__r   rB   s    €€r   r,   zExpr.__and__.<locals>.<lambda>à   ó'   ø€ ˜×/Ñ/°Ó4×<Ñ<Ü! # uÓ-ó€ r   r-   rD   s   ``r   rK   zExpr.__and__Þ   ó   ù€ Ø~‰~ôó
ð 	
r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rand__r   rB   s    €€r   r,   zExpr.__rand__.<locals>.<lambda>ç   ó'   ø€ ˜×/Ñ/°Ó4×=Ñ=Ü! # uÓ-ó€ r   r-   rD   s   ``r   rP   zExpr.__rand__å   rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__or__r   rB   s    €€r   r,   zExpr.__or__.<locals>.<lambda>î   rC   r   r-   rD   s   ``r   rT   zExpr.__or__ì   rE   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__ror__r   rB   s    €€r   r,   zExpr.__ror__.<locals>.<lambda>ó   rL   r   r-   rD   s   ``r   rW   zExpr.__ror__ñ   rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__add__r   rB   s    €€r   r,   zExpr.__add__.<locals>.<lambda>ú   rL   r   r-   rD   s   ``r   rZ   zExpr.__add__ø   rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__radd__r   rB   s    €€r   r,   zExpr.__radd__.<locals>.<lambda>  rQ   r   r-   rD   s   ``r   r]   zExpr.__radd__ÿ   rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__sub__r   rB   s    €€r   r,   zExpr.__sub__.<locals>.<lambda>  rL   r   r-   rD   s   ``r   r`   zExpr.__sub__  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rsub__r   rB   s    €€r   r,   zExpr.__rsub__.<locals>.<lambda>  rQ   r   r-   rD   s   ``r   rc   zExpr.__rsub__  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__truediv__r   rB   s    €€r   r,   z"Expr.__truediv__.<locals>.<lambda>  s'   ø€ ˜×/Ñ/°Ó4×@Ñ@Ü! # uÓ-ó€ r   r-   rD   s   ``r   rf   zExpr.__truediv__  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rtruediv__r   rB   s    €€r   r,   z#Expr.__rtruediv__.<locals>.<lambda>  ó'   ø€ ˜×/Ñ/°Ó4×AÑAÜ! # uÓ-ó€ r   r-   rD   s   ``r   ri   zExpr.__rtruediv__  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__mul__r   rB   s    €€r   r,   zExpr.__mul__.<locals>.<lambda>$  rL   r   r-   rD   s   ``r   rm   zExpr.__mul__"  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rmul__r   rB   s    €€r   r,   zExpr.__rmul__.<locals>.<lambda>+  rQ   r   r-   rD   s   ``r   rp   zExpr.__rmul__)  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__le__r   rB   s    €€r   r,   zExpr.__le__.<locals>.<lambda>2  rC   r   r-   rD   s   ``r   rs   zExpr.__le__0  rE   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__lt__r   rB   s    €€r   r,   zExpr.__lt__.<locals>.<lambda>7  rC   r   r-   rD   s   ``r   rv   zExpr.__lt__5  rE   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__gt__r   rB   s    €€r   r,   zExpr.__gt__.<locals>.<lambda><  rC   r   r-   rD   s   ``r   ry   zExpr.__gt__:  rE   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__ge__r   rB   s    €€r   r,   zExpr.__ge__.<locals>.<lambda>A  rC   r   r-   rD   s   ``r   r|   zExpr.__ge__?  rE   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__pow__r   rB   s    €€r   r,   zExpr.__pow__.<locals>.<lambda>F  rL   r   r-   rD   s   ``r   r   zExpr.__pow__D  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rpow__r   rB   s    €€r   r,   zExpr.__rpow__.<locals>.<lambda>M  rQ   r   r-   rD   s   ``r   r‚   zExpr.__rpow__K  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__floordiv__r   rB   s    €€r   r,   z#Expr.__floordiv__.<locals>.<lambda>T  rj   r   r-   rD   s   ``r   r…   zExpr.__floordiv__R  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rfloordiv__r   rB   s    €€r   r,   z$Expr.__rfloordiv__.<locals>.<lambda>[  s'   ø€ ˜×/Ñ/°Ó4×BÑBÜ! # uÓ-ó€ r   r-   rD   s   ``r   rˆ   zExpr.__rfloordiv__Y  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__mod__r   rB   s    €€r   r,   zExpr.__mod__.<locals>.<lambda>b  rL   r   r-   rD   s   ``r   r‹   zExpr.__mod__`  rM   r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú__rmod__r   rB   s    €€r   r,   zExpr.__rmod__.<locals>.<lambda>i  rQ   r   r-   rD   s   ``r   rŽ   zExpr.__rmod__g  rM   r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )Nc                óB   •— ‰j                  | «      j                  «       S r"   )r   Ú
__invert__r*   s    €r   r,   z!Expr.__invert__.<locals>.<lambda>p  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*QÑ*QÓ*S€ r   r-   r/   s   `r   r‘   zExpr.__invert__o  s   ø€ Ø~‰~ÓSÓTÐTr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uF  Return whether any of the values in the column are `True`.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [True, False], "b": [True, True]})
            >>> df_pl = pl.DataFrame({"a": [True, False], "b": [True, True]})
            >>> df_pa = pa.table({"a": [True, False], "b": [True, True]})

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").any()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                  a     b
            0  True  True
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† b    â”‚
            â”‚ ---  â”† ---  â”‚
            â”‚ bool â”† bool â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
            â”‚ true â”† true â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            b: bool
            ----
            a: [[true]]
            b: [[true]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úanyr*   s    €r   r,   zExpr.any.<locals>.<lambda>ž  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*JÑ*JÓ*L€ r   r-   r/   s   `r   r•   zExpr.anyr  ó   ø€ ðX ~‰~ÓLÓMÐMr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uR  Return whether all values in the column are `True`.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [True, False], "b": [True, True]})
            >>> df_pl = pl.DataFrame({"a": [True, False], "b": [True, True]})
            >>> df_pa = pa.table({"a": [True, False], "b": [True, True]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").all()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                   a     b
            0  False  True
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”† b    â”‚
            â”‚ ---   â”† ---  â”‚
            â”‚ bool  â”† bool â”‚
            â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
            â”‚ false â”† true â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            b: bool
            ----
            a: [[false]]
            b: [[true]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úallr*   s    €r   r,   zExpr.all.<locals>.<lambda>Ì  r–   r   r-   r/   s   `r   rš   zExpr.all   r—   r   NTé   F©ÚcomÚspanÚ	half_lifeÚalphaÚadjustÚmin_periodsÚignore_nullsc          
     óH   ‡ ‡‡‡‡‡‡‡— ‰ j                  ˆˆˆˆˆˆˆ ˆfd„«      S )u×  Compute exponentially-weighted moving average.

        !!! warning
            This functionality is considered **unstable**. It may be changed at any point
            without it being considered a breaking change.

        Arguments:
            com: Specify decay in terms of center of mass, $\gamma$, with <br> $\alpha = \frac{1}{1+\gamma}\forall\gamma\geq0$
            span: Specify decay in terms of span, $\theta$, with <br> $\alpha = \frac{2}{\theta + 1} \forall \theta \geq 1$
            half_life: Specify decay in terms of half-life, $\tau$, with <br> $\alpha = 1 - \exp \left\{ \frac{ -\ln(2) }{ \tau } \right\} \forall \tau > 0$
            alpha: Specify smoothing factor alpha directly, $0 < \alpha \leq 1$.
            adjust: Divide by decaying adjustment factor in beginning periods to account for imbalance in relative weightings

                - When `adjust=True` (the default) the EW function is calculated
                  using weights $w_i = (1 - \alpha)^i$
                - When `adjust=False` the EW function is calculated recursively by
                  $$
                  y_0=x_0
                  $$
                  $$
                  y_t = (1 - \alpha)y_{t - 1} + \alpha x_t
                  $$
            min_periods: Minimum number of observations in window required to have a value, (otherwise result is null).
            ignore_nulls: Ignore missing values when calculating weights.

                - When `ignore_nulls=False` (default), weights are based on absolute
                  positions.
                  For example, the weights of $x_0$ and $x_2$ used in
                  calculating the final weighted average of $[x_0, None, x_2]$ are
                  $(1-\alpha)^2$ and $1$ if `adjust=True`, and
                  $(1-\alpha)^2$ and $\alpha$ if `adjust=False`.
                - When `ignore_nulls=True`, weights are based
                  on relative positions. For example, the weights of
                  $x_0$ and $x_2$ used in calculating the final weighted
                  average of $[x_0, None, x_2]$ are
                  $1-\alpha$ and $1$ if `adjust=True`,
                  and $1-\alpha$ and $\alpha$ if `adjust=False`.

        Returns:
            Expr

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [1, 2, 3]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").ewm_mean(com=1, ignore_nulls=False)
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                      a
            0  1.000000
            1  1.666667
            2  2.428571

            >>> my_library_agnostic_function(df_pl)  # doctest: +NORMALIZE_WHITESPACE
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a        â”‚
            â”‚ ---      â”‚
            â”‚ f64      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1.0      â”‚
            â”‚ 1.666667 â”‚
            â”‚ 2.428571 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c           	     óR   •— ‰j                  | «      j                  ‰‰‰‰‰‰‰¬«      S )Nrœ   )r   Úewm_mean)	r+   r¡   r    r   rŸ   r£   r¢   r#   rž   s	    €€€€€€€€r   r,   zExpr.ewm_mean.<locals>.<lambda>(  s7   ø€ ˜×/Ñ/°Ó4×=Ñ=ØØØ#ØØØ'Ø)ð >ó € r   r-   )r#   r   rž   rŸ   r    r¡   r¢   r£   s   ````````r   r¦   zExpr.ewm_meanÎ  s!   ÿ€ ðr ~‰~÷ò ó

ð 
	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uí  Get mean value.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [-1, 0, 1], "b": [2, 4, 6]})
            >>> df_pl = pl.DataFrame({"a": [-1, 0, 1], "b": [2, 4, 6]})
            >>> df_pa = pa.table({"a": [-1, 0, 1], "b": [2, 4, 6]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").mean()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a    b
            0  0.0  4.0
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ f64 â”† f64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 0.0 â”† 4.0 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[0]]
            b: [[4]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úmeanr*   s    €r   r,   zExpr.mean.<locals>.<lambda>_  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*KÑ*KÓ*M€ r   r-   r/   s   `r   r©   z	Expr.mean3  s   ø€ ðX ~‰~ÓMÓNÐNr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u„  Get median value.

        Returns:
            A new expression.

        Notes:
            Results might slightly differ across backends due to differences in the underlying algorithms used to compute the median.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
            >>> df_pl = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
            >>> df_pa = pa.table({"a": [1, 8, 3], "b": [4, 5, 2]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").median()).to_native()

            We can then pass any supported library such as pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a    b
            0  3.0  4.0
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ f64 â”† f64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 3.0 â”† 4.0 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[3]]
            b: [[4]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úmedianr*   s    €r   r,   zExpr.median.<locals>.<lambda>  s   ø€ ¨$×*AÑ*AÀ#Ó*F×*MÑ*MÓ*O€ r   r-   r/   s   `r   r­   zExpr.mediana  s   ø€ ð^ ~‰~ÓOÓPÐPr   ©Úddofc               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u‘  Get standard deviation.

        Arguments:
            ddof: "Delta Degrees of Freedom": the divisor used in the calculation is N - ddof,
                     where N represents the number of elements. By default ddof is 1.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [20, 25, 60], "b": [1.5, 1, -1.4]})
            >>> df_pl = pl.DataFrame({"a": [20, 25, 60], "b": [1.5, 1, -1.4]})
            >>> df_pa = pa.table({"a": [20, 25, 60], "b": [1.5, 1, -1.4]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").std(ddof=0)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                      a         b
            0  17.79513  1.265789
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a        â”† b        â”‚
            â”‚ ---      â”† ---      â”‚
            â”‚ f64      â”† f64      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 17.79513 â”† 1.265789 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[17.795130420052185]]
            b: [[1.2657891697365016]]

        c                óF   •— ‰j                  | «      j                  ‰¬«      S )Nr®   )r   Ústd)r+   r¯   r#   s    €€r   r,   zExpr.std.<locals>.<lambda>Ã  s!   ø€ ¨$×*AÑ*AÀ#Ó*F×*JÑ*JÐPTÐ*JÓ*U€ r   r-   )r#   r¯   s   ``r   r²   zExpr.std’  s   ù€ ðb ~‰~ÔUÓVÐVr   c                ó4   ‡ ‡‡— ‰ j                  ˆˆˆ fd„«      S )uÖ  Apply a custom python function to a whole Series or sequence of Series.

        The output of this custom function is presumed to be either a Series,
        or a NumPy array (in which case it will be automatically converted into
        a Series).

        Arguments:
            function: Function to apply to Series.
            return_dtype: Dtype of the output Series.
                If not set, the dtype will be inferred based on the first non-null value
                that is returned by the function.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [1, 2, 3], "b": [4, 5, 6]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a", "b").map_batches(
            ...             lambda s: s.to_numpy() + 1, return_dtype=nw.Float64
            ...         )
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a    b
            0  2.0  5.0
            1  3.0  6.0
            2  4.0  7.0
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ f64 â”† f64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 2.0 â”† 5.0 â”‚
            â”‚ 3.0 â”† 6.0 â”‚
            â”‚ 4.0 â”† 7.0 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[2,3,4]]
            b: [[5,6,7]]
        c                óH   •— ‰j                  | «      j                  ‰‰¬«      S )N)r7   Úreturn_dtype)r   Úmap_batches)r+   r7   rµ   r#   s    €€€r   r,   z"Expr.map_batches.<locals>.<lambda>	  s(   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø!°ð Aó € r   r-   )r#   r7   rµ   s   ```r   r¶   zExpr.map_batchesÅ  s   ú€ ðF ~‰~õó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u¦  Calculate the sample skewness of a column.

        Returns:
            An expression representing the sample skewness of the column.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> df_pd = pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 2, 10, 100]})
            >>> df_pl = pl.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 2, 10, 100]})
            >>> df_pa = pa.Table.from_pandas(df_pd)

            Let's define a dataframe-agnostic function:

            >>> @nw.narwhalify
            ... def func(df):
            ...     return df.select(nw.col("a", "b").skew())

            We can then pass pandas, Polars, or PyArrow to `func`:

            >>> func(df_pd)
                 a         b
            0  0.0  1.472427
            >>> func(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b        â”‚
            â”‚ --- â”† ---      â”‚
            â”‚ f64 â”† f64      â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 0.0 â”† 1.472427 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> func(df_pa)
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[0]]
            b: [[1.4724267269058975]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úskewr*   s    €r   r,   zExpr.skew.<locals>.<lambda>9  rª   r   r-   r/   s   `r   r¹   z	Expr.skew  s   ø€ ðV ~‰~ÓMÓNÐNr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uè  Return the sum value.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [5, 10], "b": [50, 100]})
            >>> df_pl = pl.DataFrame({"a": [5, 10], "b": [50, 100]})
            >>> df_pa = pa.table({"a": [5, 10], "b": [50, 100]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").sum()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                a    b
            0  15  150
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 15  â”† 150 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[15]]
            b: [[150]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   r)   r*   s    €r   r,   zExpr.sum.<locals>.<lambda>g  r–   r   r-   r/   s   `r   r)   zExpr.sum;  r—   r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uæ  Returns the minimum value(s) from a column(s).

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 2], "b": [4, 3]})
            >>> df_pl = pl.DataFrame({"a": [1, 2], "b": [4, 3]})
            >>> df_pa = pa.table({"a": [1, 2], "b": [4, 3]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.min("a", "b")).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b
            0  1  3
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1   â”† 3   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[1]]
            b: [[3]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úminr*   s    €r   r,   zExpr.min.<locals>.<lambda>•  r–   r   r-   r/   s   `r   r¾   zExpr.mini  r—   r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uþ  Returns the maximum value(s) from a column(s).

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [10, 20], "b": [50, 100]})
            >>> df_pl = pl.DataFrame({"a": [10, 20], "b": [50, 100]})
            >>> df_pa = pa.table({"a": [10, 20], "b": [50, 100]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.max("a", "b")).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                a    b
            0  20  100
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 20  â”† 100 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[20]]
            b: [[100]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úmaxr*   s    €r   r,   zExpr.max.<locals>.<lambda>Ã  r–   r   r-   r/   s   `r   rÁ   zExpr.max—  r—   r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uã  Returns the index of the minimum value.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [10, 20], "b": [150, 100]})
            >>> df_pl = pl.DataFrame({"a": [10, 20], "b": [150, 100]})
            >>> df_pa = pa.table({"a": [10, 20], "b": [150, 100]})

            Let's define a dataframe-agnostic function:

            >>> def agnostic_arg_min(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a", "b").arg_min().name.suffix("_arg_min")
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow:

            >>> agnostic_arg_min(df_pd)
               a_arg_min  b_arg_min
            0          0          1
            >>> agnostic_arg_min(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a_arg_min â”† b_arg_min â”‚
            â”‚ ---       â”† ---       â”‚
            â”‚ u32       â”† u32       â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 0         â”† 1         â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> agnostic_arg_min(df_pa)
            pyarrow.Table
            a_arg_min: int64
            b_arg_min: int64
            ----
            a_arg_min: [[0]]
            b_arg_min: [[1]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úarg_minr*   s    €r   r,   zExpr.arg_min.<locals>.<lambda>ó  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*NÑ*NÓ*P€ r   r-   r/   s   `r   rÄ   zExpr.arg_minÅ  ó   ø€ ð\ ~‰~ÓPÓQÐQr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uã  Returns the index of the maximum value.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [10, 20], "b": [150, 100]})
            >>> df_pl = pl.DataFrame({"a": [10, 20], "b": [150, 100]})
            >>> df_pa = pa.table({"a": [10, 20], "b": [150, 100]})

            Let's define a dataframe-agnostic function:

            >>> def agnostic_arg_max(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a", "b").arg_max().name.suffix("_arg_max")
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow:

            >>> agnostic_arg_max(df_pd)
               a_arg_max  b_arg_max
            0          1          0
            >>> agnostic_arg_max(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a_arg_max â”† b_arg_max â”‚
            â”‚ ---       â”† ---       â”‚
            â”‚ u32       â”† u32       â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1         â”† 0         â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> agnostic_arg_max(df_pa)
            pyarrow.Table
            a_arg_max: int64
            b_arg_max: int64
            ----
            a_arg_max: [[1]]
            b_arg_max: [[0]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úarg_maxr*   s    €r   r,   zExpr.arg_max.<locals>.<lambda>#  rÅ   r   r-   r/   s   `r   rÉ   zExpr.arg_maxõ  rÆ   r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u	  Returns the number of non-null elements in the column.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 2, 3], "b": [None, 4, 4]})
            >>> df_pl = pl.DataFrame({"a": [1, 2, 3], "b": [None, 4, 4]})
            >>> df_pa = pa.table({"a": [1, 2, 3], "b": [None, 4, 4]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.all().count()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b
            0  3  2
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ u32 â”† u32 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 3   â”† 2   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[3]]
            b: [[2]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úcountr*   s    €r   r,   zExpr.count.<locals>.<lambda>Q  s   ø€ ¨$×*AÑ*AÀ#Ó*F×*LÑ*LÓ*N€ r   r-   r/   s   `r   rÌ   z
Expr.count%  s   ø€ ðX ~‰~ÓNÓOÐOr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Returns count of unique values.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 3, 3, 5]})
            >>> df_pl = pl.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 3, 3, 5]})
            >>> df_pa = pa.table({"a": [1, 2, 3, 4, 5], "b": [1, 1, 3, 3, 5]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").n_unique()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b
            0  5  3
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ u32 â”† u32 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 5   â”† 3   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[5]]
            b: [[3]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Ún_uniquer*   s    €r   r,   zExpr.n_unique.<locals>.<lambda>  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*OÑ*OÓ*Q€ r   r-   r/   s   `r   rÏ   zExpr.n_uniqueS  s   ø€ ðX ~‰~ÓQÓRÐRr   ©Úmaintain_orderc               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u£  Return unique values of this expression.

        Arguments:
            maintain_order: Keep the same order as the original expression. This may be more
                expensive to compute. Settings this to `True` blocks the possibility
                to run on the streaming engine for Polars.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})
            >>> df_pl = pl.DataFrame({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})
            >>> df_pa = pa.table({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").unique(maintain_order=True)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b
            0  1  2
            1  3  4
            2  5  6
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1   â”† 2   â”‚
            â”‚ 3   â”† 4   â”‚
            â”‚ 5   â”† 6   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[1,3,5]]
            b: [[2,4,6]]
        c                óF   •— ‰j                  | «      j                  ‰¬«      S )NrÑ   )r   Úunique)r+   rÒ   r#   s    €€r   r,   zExpr.unique.<locals>.<lambda>·  s    ø€ ˜×/Ñ/°Ó4×;Ñ;È>Ð;ÓZ€ r   r-   )r#   rÒ   s   ``r   rÕ   zExpr.unique  s   ù€ ðj ~‰~ÜZó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Return absolute value of each element.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [1, -2], "b": [-3, 4]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").abs()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b
            0  1  3
            1  2  4
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1   â”† 3   â”‚
            â”‚ 2   â”† 4   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[1,2]]
            b: [[3,4]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   r(   r*   s    €r   r,   zExpr.abs.<locals>.<lambda>é  r–   r   r-   r/   s   `r   r(   zExpr.absº  s   ø€ ð^ ~‰~ÓLÓMÐMr   ©Úreversec               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u>  Return cumulative sum.

        Arguments:
            reverse: reverse the operation

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})
            >>> df_pl = pl.DataFrame({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})
            >>> df_pa = pa.table({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a", "b").cum_sum()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                a   b
            0   1   2
            1   2   6
            2   5  10
            3  10  16
            4  15  22
            >>> my_library_agnostic_function(df_pl)
            shape: (5, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1   â”† 2   â”‚
            â”‚ 2   â”† 6   â”‚
            â”‚ 5   â”† 10  â”‚
            â”‚ 10  â”† 16  â”‚
            â”‚ 15  â”† 22  â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[1,2,5,10,15]]
            b: [[2,6,10,16,22]]
        c                óF   •— ‰j                  | «      j                  ‰¬«      S ©NrØ   )r   Úcum_sum©r+   rÙ   r#   s    €€r   r,   zExpr.cum_sum.<locals>.<lambda>#  ó    ø€ ˜×/Ñ/°Ó4×<Ñ<ÀWÐ<ÓM€ r   r-   ©r#   rÙ   s   ``r   rÝ   zExpr.cum_sumë  s   ù€ ðn ~‰~ÜMó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u%  Returns the difference between each element and the previous one.

        Returns:
            A new expression.

        Notes:
            pandas may change the dtype here, for example when introducing missing
            values in an integer column. To ensure, that the dtype doesn't change,
            you may want to use `fill_null` and `cast`. For example, to calculate
            the diff and fill missing values with `0` in a Int64 column, you could
            do:

                nw.col("a").diff().fill_null(0).cast(nw.Int64)

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 1, 3, 5, 5]})
            >>> df_pl = pl.DataFrame({"a": [1, 1, 3, 5, 5]})
            >>> df_pa = pa.table({"a": [1, 1, 3, 5, 5]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(a_diff=nw.col("a").diff()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a_diff
            0     NaN
            1     0.0
            2     2.0
            3     2.0
            4     0.0
            >>> my_library_agnostic_function(df_pl)
            shape: (5, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a_diff â”‚
            â”‚ ---    â”‚
            â”‚ i64    â”‚
            â•žâ•â•â•â•â•â•â•â•â•¡
            â”‚ null   â”‚
            â”‚ 0      â”‚
            â”‚ 2      â”‚
            â”‚ 2      â”‚
            â”‚ 0      â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a_diff: int64
            ----
            a_diff: [[null,0,2,2,0]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Údiffr*   s    €r   r,   zExpr.diff.<locals>.<lambda>a  rª   r   r-   r/   s   `r   rã   z	Expr.diff&  s   ø€ ðv ~‰~ÓMÓNÐNr   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u`  Shift values by `n` positions.

        Arguments:
            n: Number of positions to shift values by.

        Returns:
            A new expression.

        Notes:
            pandas may change the dtype here, for example when introducing missing
            values in an integer column. To ensure, that the dtype doesn't change,
            you may want to use `fill_null` and `cast`. For example, to shift
            and fill missing values with `0` in a Int64 column, you could
            do:

                nw.col("a").shift(1).fill_null(0).cast(nw.Int64)

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 1, 3, 5, 5]})
            >>> df_pl = pl.DataFrame({"a": [1, 1, 3, 5, 5]})
            >>> df_pa = pa.table({"a": [1, 1, 3, 5, 5]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(a_shift=nw.col("a").shift(n=1)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a_shift
            0      NaN
            1      1.0
            2      1.0
            3      3.0
            4      5.0
            >>> my_library_agnostic_function(df_pl)
            shape: (5, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a_shift â”‚
            â”‚ ---     â”‚
            â”‚ i64     â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•¡
            â”‚ null    â”‚
            â”‚ 1       â”‚
            â”‚ 1       â”‚
            â”‚ 3       â”‚
            â”‚ 5       â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a_shift: int64
            ----
            a_shift: [[null,1,1,3,5]]
        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Úshift©r+   Únr#   s    €€r   r,   zExpr.shift.<locals>.<lambda>¡  s   ø€ ¨$×*AÑ*AÀ#Ó*F×*LÑ*LÈQÓ*O€ r   r-   ©r#   rè   s   ``r   ræ   z
Expr.shiftc  s   ù€ ð| ~‰~ÔOÓPÐPr   ©rµ   c               óÚ   ‡ ‡‡‡— ‰€Ot        ‰t        «      sd}t        |«      ‚t        ‰j	                  «       «      Št        ‰j                  «       «      Š‰ j                  ˆˆˆˆ fd„«      S )u!
  Replace all values by different values.

        This function must replace all non-null input values (else it raises an error).

        Arguments:
            old: Sequence of values to replace. It also accepts a mapping of values to
                their replacement as syntactic sugar for
                `replace_all(old=list(mapping.keys()), new=list(mapping.values()))`.
            new: Sequence of values to replace by. Length must match the length of `old`.
            return_dtype: The data type of the resulting expression. If set to `None`
                (default), the data type is determined automatically based on the other
                inputs.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> df_pd = pd.DataFrame({"a": [3, 0, 1, 2]})
            >>> df_pl = pl.DataFrame({"a": [3, 0, 1, 2]})
            >>> df_pa = pa.table({"a": [3, 0, 1, 2]})

            Let's define dataframe-agnostic functions:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         b=nw.col("a").replace_strict(
            ...             [0, 1, 2, 3],
            ...             ["zero", "one", "two", "three"],
            ...             return_dtype=nw.String,
            ...         )
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a      b
            0  3  three
            1  0   zero
            2  1    one
            3  2    two
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b     â”‚
            â”‚ --- â”† ---   â”‚
            â”‚ i64 â”† str   â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ 3   â”† three â”‚
            â”‚ 0   â”† zero  â”‚
            â”‚ 1   â”† one   â”‚
            â”‚ 2   â”† two   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: string
            ----
            a: [[3,0,1,2]]
            b: [["three","zero","one","two"]]
        zB`new` argument is required if `old` argument is not a Mapping typec                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S )Nrê   )r   Úreplace_strict)r+   ÚnewÚoldrµ   r#   s    €€€€r   r,   z%Expr.replace_strict.<locals>.<lambda>õ  s*   ø€ ˜×/Ñ/°Ó4×CÑCØS |ð Dó € r   )r   r
   Ú	TypeErrorÚlistÚvaluesÚkeysr.   )r#   rï   rî   rµ   Úmsgs   ```` r   rí   zExpr.replace_strict£  sZ   û€ ðR ˆ;Ü˜c¤7Ô+ØZÜ “nÐ$äs—z‘z“|Ó$ˆCÜs—x‘x“zÓ"ˆCà~‰~öó
ð 	
r   ©Ú
descendingÚ
nulls_lastc               ó4   ‡ ‡‡— ‰ j                  ˆˆˆ fd„«      S )u	  Sort this column. Place null values first.

        Arguments:
            descending: Sort in descending order.
            nulls_last: Place null values last instead of first.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> df_pd = pd.DataFrame({"a": [5, None, 1, 2]})
            >>> df_pl = pl.DataFrame({"a": [5, None, 1, 2]})
            >>> df_pa = pa.table({"a": [5, None, 1, 2]})

            Let's define dataframe-agnostic functions:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").sort()).to_native()

            >>> def func_descend(df):
            ...     df = nw.from_native(df)
            ...     df = df.select(nw.col("a").sort(descending=True))
            ...     return nw.to_native(df)

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a
            1  NaN
            2  1.0
            3  2.0
            0  5.0
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”‚
            â”‚ ---  â”‚
            â”‚ i64  â”‚
            â•žâ•â•â•â•â•â•â•¡
            â”‚ null â”‚
            â”‚ 1    â”‚
            â”‚ 2    â”‚
            â”‚ 5    â”‚
            â””â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[null,1,2,5]]

            >>> func_descend(df_pd)
                 a
            1  NaN
            0  5.0
            3  2.0
            2  1.0
            >>> func_descend(df_pl)
            shape: (4, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”‚
            â”‚ ---  â”‚
            â”‚ i64  â”‚
            â•žâ•â•â•â•â•â•â•¡
            â”‚ null â”‚
            â”‚ 5    â”‚
            â”‚ 2    â”‚
            â”‚ 1    â”‚
            â””â”€â”€â”€â”€â”€â”€â”˜
            >>> func_descend(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[null,5,2,1]]
        c                óH   •— ‰j                  | «      j                  ‰‰¬«      S )Nrõ   )r   Úsort)r+   rö   r÷   r#   s    €€€r   r,   zExpr.sort.<locals>.<lambda>L  s'   ø€ ˜×/Ñ/°Ó4×9Ñ9Ø%°*ð :ó € r   r-   )r#   rö   r÷   s   ```r   rú   z	Expr.sortú  s   ú€ ðb ~‰~õó
ð 	
r   c                ó8   ‡ ‡‡‡— ‰ j                  ˆˆˆ ˆfd„«      S )u2  Check if this expression is between the given lower and upper bounds.

        Arguments:
            lower_bound: Lower bound value.
            upper_bound: Upper bound value.
            closed: Define which sides of the interval are closed (inclusive).

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 2, 3, 4, 5]})
            >>> df_pl = pl.DataFrame({"a": [1, 2, 3, 4, 5]})
            >>> df_pa = pa.table({"a": [1, 2, 3, 4, 5]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").is_between(2, 4, "right")).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                   a
            0  False
            1  False
            2   True
            3   True
            4  False
            >>> my_library_agnostic_function(df_pl)
            shape: (5, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”‚
            â”‚ ---   â”‚
            â”‚ bool  â”‚
            â•žâ•â•â•â•â•â•â•â•¡
            â”‚ false â”‚
            â”‚ false â”‚
            â”‚ true  â”‚
            â”‚ true  â”‚
            â”‚ false â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            ----
            a: [[false,false,true,true,false]]
        c                óH   •— ‰j                  | «      j                  ‰‰‰«      S r"   )r   Ú
is_between)r+   ÚclosedÚlower_boundr#   Úupper_bounds    €€€€r   r,   z!Expr.is_between.<locals>.<lambda>Œ  s$   ø€ ˜×/Ñ/°Ó4×?Ñ?Ø˜[¨&ó€ r   r-   )r#   rÿ   r   rþ   s   ````r   rý   zExpr.is_betweenR  s   û€ ðr ~‰~öó
ð 	
r   c                ó–   ‡ ‡— t        ‰t        «      r+t        ‰t        t        f«      s‰ j	                  ˆˆ fd„«      S d}t        |«      ‚)u  Check if elements of this expression are present in the other iterable.

        Arguments:
            other: iterable

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [1, 2, 9, 10]})
            >>> df_pl = pl.DataFrame({"a": [1, 2, 9, 10]})
            >>> df_pa = pa.table({"a": [1, 2, 9, 10]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(b=nw.col("a").is_in([1, 2])).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                a      b
            0   1   True
            1   2   True
            2   9  False
            3  10  False

            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b     â”‚
            â”‚ --- â”† ---   â”‚
            â”‚ i64 â”† bool  â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ 1   â”† true  â”‚
            â”‚ 2   â”† true  â”‚
            â”‚ 9   â”† false â”‚
            â”‚ 10  â”† false â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: bool
            ----
            a: [[1,2,9,10]]
            b: [[true,true,false,false]]
        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Úis_inrB   s    €€r   r,   zExpr.is_in.<locals>.<lambda>È  s   ø€ ¨d×.EÑ.EÀcÓ.J×.PÑ.PÐQVÓ.W€ r   zyNarwhals `is_in` doesn't accept expressions as an argument, as opposed to Polars. You should provide an iterable instead.)r   r   ÚstrÚbytesr.   ÚNotImplementedError)r#   r   rô   s   `` r   r  z
Expr.is_in‘  s@   ù€ ôl eœXÔ&¬z¸%Ä#ÄuÀÔ/NØ—>‘>Ô"WÓXÐXð NˆCÜ% cÓ*Ð*r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u«  Filters elements based on a condition, returning a new expression.

        Arguments:
            predicates: Conditions to filter by (which get ANDed together).

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import pandas as pd
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame({"a": [2, 3, 4, 5, 6, 7], "b": [10, 11, 12, 13, 14, 15]})
            >>> df_pl = pl.DataFrame({"a": [2, 3, 4, 5, 6, 7], "b": [10, 11, 12, 13, 14, 15]})
            >>> df_pa = pa.table({"a": [2, 3, 4, 5, 6, 7], "b": [10, 11, 12, 13, 14, 15]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").filter(nw.col("a") > 4),
            ...         nw.col("b").filter(nw.col("b") < 13),
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a   b
            3  5  10
            4  6  11
            5  7  12
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† i64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 5   â”† 10  â”‚
            â”‚ 6   â”† 11  â”‚
            â”‚ 7   â”† 12  â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[5,6,7]]
            b: [[10,11,12]]
        c           	     óŒ   •—  ‰j                  | «      j                  t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )r   Úfilterr   r   )r+   ÚpredÚ
predicatesr#   s     €€r   r,   zExpr.filter.<locals>.<lambda>  s>   ø€ Ð;˜×/Ñ/°Ó4×;Ñ;Ü;BÀ:Ó;NÖO°4Ô# C¨Õ.ÒOð€ ùÚOs   ªAr-   ©r#   r  s   ``r   r	  zExpr.filterÍ  s   ù€ ðl ~‰~ôó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Returns a boolean Series indicating which values are null.

        Returns:
            A new expression.

        Notes:
            pandas, Polars and PyArrow handle null values differently. Polars and PyArrow
            distinguish between NaN and Null, whereas pandas doesn't.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame(
            ...     {"a": [2, 4, None, 3, 5], "b": [2.0, 4.0, float("nan"), 3.0, 5.0]}
            ... )
            >>> df_pl = pl.DataFrame(
            ...     {"a": [2, 4, None, 3, 5], "b": [2.0, 4.0, float("nan"), 3.0, 5.0]}
            ... )
            >>> df_pa = pa.table(
            ...     {"a": [2, 4, None, 3, 5], "b": [2.0, 4.0, float("nan"), 3.0, 5.0]}
            ... )

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_is_null=nw.col("a").is_null(), b_is_null=nw.col("b").is_null()
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a    b  a_is_null  b_is_null
            0  2.0  2.0      False      False
            1  4.0  4.0      False      False
            2  NaN  NaN       True       True
            3  3.0  3.0      False      False
            4  5.0  5.0      False      False

            >>> my_library_agnostic_function(df_pl)  # nan != null for polars
            shape: (5, 4)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† b   â”† a_is_null â”† b_is_null â”‚
            â”‚ ---  â”† --- â”† ---       â”† ---       â”‚
            â”‚ i64  â”† f64 â”† bool      â”† bool      â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2    â”† 2.0 â”† false     â”† false     â”‚
            â”‚ 4    â”† 4.0 â”† false     â”† false     â”‚
            â”‚ null â”† NaN â”† true      â”† false     â”‚
            â”‚ 3    â”† 3.0 â”† false     â”† false     â”‚
            â”‚ 5    â”† 5.0 â”† false     â”† false     â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(df_pa)  # nan != null for pyarrow
            pyarrow.Table
            a: int64
            b: double
            a_is_null: bool
            b_is_null: bool
            ----
            a: [[2,4,null,3,5]]
            b: [[2,4,nan,3,5]]
            a_is_null: [[false,false,true,false,false]]
            b_is_null: [[false,false,false,false,false]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úis_nullr*   s    €r   r,   zExpr.is_null.<locals>.<lambda>O  rÅ   r   r-   r/   s   `r   r  zExpr.is_null	  s   ø€ ðL ~‰~ÓPÓQÐQr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u†  Find elements where boolean expression is True.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [1, None, None, 2]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").is_null().arg_true()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a
            1  1
            2  2
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ u32 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 1   â”‚
            â”‚ 2   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[1,2]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úarg_truer*   s    €r   r,   zExpr.arg_true.<locals>.<lambda>~  rÐ   r   r-   r/   s   `r   r  zExpr.arg_trueQ  s   ø€ ðZ ~‰~ÓQÓRÐRr   c                ó¨   ‡ ‡‡‡— ‰‰d}t        |«      ‚‰€‰€d}t        |«      ‚‰‰dvrd‰› }t        |«      ‚‰ j                  ˆˆ ˆˆfd„«      S )u
  Fill null values with given value.

        Arguments:
            value: Value used to fill null values.
            strategy: Strategy used to fill null values.
            limit: Number of consecutive null values to fill when using the 'forward' or 'backward' strategy.

        Returns:
            A new expression.

        Notes:
            pandas and Polars handle null values differently. Polars distinguishes
            between NaN and Null, whereas pandas doesn't.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> df_pd = pd.DataFrame(
            ...     {
            ...         "a": [2, 4, None, None, 3, 5],
            ...         "b": [2.0, 4.0, float("nan"), float("nan"), 3.0, 5.0],
            ...     }
            ... )
            >>> df_pl = pl.DataFrame(
            ...     {
            ...         "a": [2, 4, None, None, 3, 5],
            ...         "b": [2.0, 4.0, float("nan"), float("nan"), 3.0, 5.0],
            ...     }
            ... )
            >>> df_pa = pa.table(
            ...     {
            ...         "a": [2, 4, None, None, 3, 5],
            ...         "b": [2.0, 4.0, float("nan"), float("nan"), 3.0, 5.0],
            ...     }
            ... )

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(nw.col("a", "b").fill_null(0)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a    b
            0  2.0  2.0
            1  4.0  4.0
            2  0.0  0.0
            3  0.0  0.0
            4  3.0  3.0
            5  5.0  5.0

            >>> my_library_agnostic_function(df_pl)  # nan != null for polars
            shape: (6, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ i64 â”† f64 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 2   â”† 2.0 â”‚
            â”‚ 4   â”† 4.0 â”‚
            â”‚ 0   â”† NaN â”‚
            â”‚ 0   â”† NaN â”‚
            â”‚ 3   â”† 3.0 â”‚
            â”‚ 5   â”† 5.0 â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(df_pa)  # nan != null for pyarrow
            pyarrow.Table
            a: int64
            b: double
            ----
            a: [[2,4,0,0,3,5]]
            b: [[2,4,nan,nan,3,5]]

            Using a strategy:

            >>> def func_strategies(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("a", "b")
            ...         .fill_null(strategy="forward", limit=1)
            ...         .name.suffix("_filled")
            ...     ).to_native()

            >>> func_strategies(df_pd)
                 a    b  a_filled  b_filled
            0  2.0  2.0       2.0       2.0
            1  4.0  4.0       4.0       4.0
            2  NaN  NaN       4.0       4.0
            3  NaN  NaN       NaN       NaN
            4  3.0  3.0       3.0       3.0
            5  5.0  5.0       5.0       5.0

            >>> func_strategies(df_pl)  # nan != null for polars
            shape: (6, 4)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† b   â”† a_filled â”† b_filled â”‚
            â”‚ ---  â”† --- â”† ---      â”† ---      â”‚
            â”‚ i64  â”† f64 â”† i64      â”† f64      â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2    â”† 2.0 â”† 2        â”† 2.0      â”‚
            â”‚ 4    â”† 4.0 â”† 4        â”† 4.0      â”‚
            â”‚ null â”† NaN â”† 4        â”† NaN      â”‚
            â”‚ null â”† NaN â”† null     â”† NaN      â”‚
            â”‚ 3    â”† 3.0 â”† 3        â”† 3.0      â”‚
            â”‚ 5    â”† 5.0 â”† 5        â”† 5.0      â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> func_strategies(df_pa)  # nan != null for pyarrow
            pyarrow.Table
            a: int64
            b: double
            a_filled: int64
            b_filled: double
            ----
            a: [[2,4,null,null,3,5]]
            b: [[2,4,nan,nan,3,5]]
            a_filled: [[2,4,4,null,3,5]]
            b_filled: [[2,4,nan,nan,3,5]]
        z*cannot specify both `value` and `strategy`z0must specify either a fill `value` or `strategy`>   ÚforwardÚbackwardzstrategy not supported: c                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S )N)ÚvalueÚstrategyÚlimit)r   Ú	fill_null)r+   r  r#   r  r  s    €€€€r   r,   z Expr.fill_null.<locals>.<lambda>  s)   ø€ ˜×/Ñ/°Ó4×>Ñ>Ø h°eð ?ó € r   )Ú
ValueErrorr.   )r#   r  r  r  rô   s   ```` r   r  zExpr.fill_null€  ss   û€ ðF Ð Ð!5Ø>ˆCÜ˜S“/Ð!Øˆ=˜XÐ-ØDˆCÜ˜S“/Ð!ØÐ HÐ4KÑ$KØ,¨X¨JÐ7ˆCÜ˜S“/Ð!Ø~‰~öó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u
  Remove missing values.

        Returns:
            A new expression.

        Notes:
            pandas and Polars handle null values differently. Polars distinguishes
            between NaN and Null, whereas pandas doesn't.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa

            >>> df_pd = pd.DataFrame({"a": [2.0, 4.0, float("nan"), 3.0, None, 5.0]})
            >>> df_pl = pl.DataFrame({"a": [2.0, 4.0, float("nan"), 3.0, None, 5.0]})
            >>> df_pa = pa.table({"a": [2.0, 4.0, float("nan"), 3.0, None, 5.0]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").drop_nulls()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a
            0  2.0
            1  4.0
            3  3.0
            5  5.0
            >>> my_library_agnostic_function(df_pl)  # nan != null for polars
            shape: (5, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ f64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 2.0 â”‚
            â”‚ 4.0 â”‚
            â”‚ NaN â”‚
            â”‚ 3.0 â”‚
            â”‚ 5.0 â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)  # nan != null for pyarrow
            pyarrow.Table
            a: double
            ----
            a: [[2,4,nan,3,5]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Ú
drop_nullsr*   s    €r   r,   z!Expr.drop_nulls.<locals>.<lambda>I  r’   r   r-   r/   s   `r   r  zExpr.drop_nulls  s   ø€ ðl ~‰~ÓSÓTÐTr   ©ÚfractionÚwith_replacementÚseedc               ó<   ‡ ‡‡‡‡— ‰ j                  ˆˆˆˆ ˆfd„«      S )u¡  Sample randomly from this expression.

        Arguments:
            n: Number of items to return. Cannot be used with fraction.
            fraction: Fraction of items to return. Cannot be used with n.
            with_replacement: Allow values to be sampled more than once.
            seed: Seed for the random number generator. If set to None (default), a random
                seed is generated for each sample operation.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> df_pd = pd.DataFrame({"a": [1, 2, 3]})
            >>> df_pl = pl.DataFrame({"a": [1, 2, 3]})
            >>> df_pa = pa.table({"a": [1, 2, 3]})

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").sample(fraction=1.0, with_replacement=True)
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)  # doctest: +SKIP
               a
            2  3
            0  1
            2  3
            >>> my_library_agnostic_function(df_pl)  # doctest: +SKIP
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ f64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 2   â”‚
            â”‚ 3   â”‚
            â”‚ 3   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)  # doctest: +SKIP
            pyarrow.Table
            a: int64
            ----
            a: [[1,3,3]]
        c                óL   •— ‰j                  | «      j                  ‰‰‰‰¬«      S )Nr  )r   Úsample)r+   r   rè   r"  r#   r!  s    €€€€€r   r,   zExpr.sample.<locals>.<lambda>Š  s,   ø€ ˜×/Ñ/°Ó4×;Ñ;Ø˜HÐ7GÈdð <ó € r   r-   )r#   rè   r   r!  r"  s   `````r   r%  zExpr.sampleK  s   ü€ ð| ~‰~÷ó
ð 	
r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u-	  Compute expressions over the given groups.

        Arguments:
            keys: Names of columns to compute window expression over.
                  Must be names of columns, as opposed to expressions -
                  so, this is a bit less flexible than Polars' `Expr.over`.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, 3], "b": [1, 1, 2]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_min_per_group=nw.col("a").min().over("b")
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b  a_min_per_group
            0  1  1                1
            1  2  1                1
            2  3  2                3
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 3)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”† a_min_per_group â”‚
            â”‚ --- â”† --- â”† ---             â”‚
            â”‚ i64 â”† i64 â”† i64             â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1   â”† 1   â”† 1               â”‚
            â”‚ 2   â”† 1   â”† 1               â”‚
            â”‚ 3   â”† 2   â”† 3               â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            a_min_per_group: int64
            ----
            a: [[1,2,3]]
            b: [[1,1,2]]
            a_min_per_group: [[1,1,3]]
        c                óV   •— ‰j                  | «      j                  t        ‰«      «      S r"   )r   Úoverr   )r+   ró   r#   s    €€r   r,   zExpr.over.<locals>.<lambda>Ê  s!   ø€ ˜×/Ñ/°Ó4×9Ñ9¼'À$»-ÓH€ r   r-   )r#   ró   s   ``r   r(  z	Expr.over  s   ù€ ðt ~‰~ÜHó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u!  Return a boolean mask indicating duplicated values.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.all().is_duplicated()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                   a      b
            0   True   True
            1  False   True
            2  False  False
            3   True  False
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”† b     â”‚
            â”‚ ---   â”† ---   â”‚
            â”‚ bool  â”† bool  â”‚
            â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ true  â”† true  â”‚
            â”‚ false â”† true  â”‚
            â”‚ false â”† false â”‚
            â”‚ true  â”† false â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            b: bool
            ----
            a: [[true,false,false,true]]
            b: [[true,true,false,false]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úis_duplicatedr*   s    €r   r,   z$Expr.is_duplicated.<locals>.<lambda> 	  s   ø€ ¨$×*AÑ*AÀ#Ó*F×*TÑ*TÓ*V€ r   r-   r/   s   `r   r+  zExpr.is_duplicatedÍ  s   ø€ ðf ~‰~ÓVÓWÐWr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Return a boolean mask indicating unique values.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.all().is_unique()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                   a      b
            0  False  False
            1   True  False
            2   True   True
            3  False   True
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”† b     â”‚
            â”‚ ---   â”† ---   â”‚
            â”‚ bool  â”† bool  â”‚
            â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ false â”† false â”‚
            â”‚ true  â”† false â”‚
            â”‚ true  â”† true  â”‚
            â”‚ false â”† true  â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            b: bool
            ----
            a: [[false,true,true,false]]
            b: [[false,false,true,true]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Ú	is_uniquer*   s    €r   r,   z Expr.is_unique.<locals>.<lambda>5	  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*PÑ*PÓ*R€ r   r-   r/   s   `r   r.  zExpr.is_unique	  s   ø€ ðf ~‰~ÓRÓSÐSr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uu  Count null values.

        Returns:
            A new expression.

        Notes:
            pandas and Polars handle null values differently. Polars distinguishes
            between NaN and Null, whereas pandas doesn't.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, None, 1], "b": ["a", None, "b", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.all().null_count()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a  b
            0  1  2
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a   â”† b   â”‚
            â”‚ --- â”† --- â”‚
            â”‚ u32 â”† u32 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1   â”† 2   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            b: int64
            ----
            a: [[1]]
            b: [[2]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Ú
null_countr*   s    €r   r,   z!Expr.null_count.<locals>.<lambda>h	  r’   r   r-   r/   s   `r   r2  zExpr.null_count7	  s   ø€ ðb ~‰~ÓSÓTÐTr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u=  Return a boolean mask indicating the first occurrence of each distinct value.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.all().is_first_distinct()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                   a      b
            0   True   True
            1   True  False
            2   True   True
            3  False   True
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”† b     â”‚
            â”‚ ---   â”† ---   â”‚
            â”‚ bool  â”† bool  â”‚
            â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ true  â”† true  â”‚
            â”‚ true  â”† false â”‚
            â”‚ true  â”† true  â”‚
            â”‚ false â”† true  â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            b: bool
            ----
            a: [[true,true,true,false]]
            b: [[true,false,true,true]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úis_first_distinctr*   s    €r   r,   z(Expr.is_first_distinct.<locals>.<lambda>ž	  s   ø€ ˜×/Ñ/°Ó4×FÑFÓH€ r   r-   r/   s   `r   r5  zExpr.is_first_distinctj	  s   ø€ ðf ~‰~ÛHó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u;  Return a boolean mask indicating the last occurrence of each distinct value.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.all().is_last_distinct()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                   a      b
            0  False  False
            1   True   True
            2   True   True
            3   True   True
            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”† b     â”‚
            â”‚ ---   â”† ---   â”‚
            â”‚ bool  â”† bool  â”‚
            â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ false â”† false â”‚
            â”‚ true  â”† true  â”‚
            â”‚ true  â”† true  â”‚
            â”‚ true  â”† true  â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: bool
            b: bool
            ----
            a: [[false,true,true,true]]
            b: [[false,true,true,true]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úis_last_distinctr*   s    €r   r,   z'Expr.is_last_distinct.<locals>.<lambda>Ô	  s   ø€ ¨$×*AÑ*AÀ#Ó*F×*WÑ*WÓ*Y€ r   r-   r/   s   `r   r8  zExpr.is_last_distinct¡	  s   ø€ ðf ~‰~ÓYÓZÐZr   c                ó4   ‡ ‡‡— ‰ j                  ˆˆˆ fd„«      S )u›  Get quantile value.

        Arguments:
            quantile: Quantile between 0.0 and 1.0.
            interpolation: Interpolation method.

        Returns:
            A new expression.

        Note:
            - pandas and Polars may have implementation differences for a given interpolation method.
            - [dask](https://docs.dask.org/en/stable/generated/dask.dataframe.Series.quantile.html) has
                its own method to approximate quantile and it doesn't implement 'nearest', 'higher',
                'lower', 'midpoint' as interpolation method - use 'linear' which is closest to the
                native 'dask' - method.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": list(range(50)), "b": list(range(50, 100))}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a", "b").quantile(0.5, interpolation="linear")
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                  a     b
            0  24.5  74.5

            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† b    â”‚
            â”‚ ---  â”† ---  â”‚
            â”‚ f64  â”† f64  â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
            â”‚ 24.5 â”† 74.5 â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[24.5]]
            b: [[74.5]]
        c                óF   •— ‰j                  | «      j                  ‰‰«      S r"   )r   Úquantile)r+   Úinterpolationr;  r#   s    €€€r   r,   zExpr.quantile.<locals>.<lambda>
  s   ø€ ˜×/Ñ/°Ó4×=Ñ=¸hÈÓV€ r   r-   )r#   r;  r<  s   ```r   r;  zExpr.quantileÖ	  s   ú€ ð~ ~‰~ÝVó
ð 	
r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )ué  Get the first `n` rows.

        Arguments:
            n: Number of rows to return.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": list(range(10))}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function that returns the first 3 rows:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").head(3)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a
            0  0
            1  1
            2  2
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 0   â”‚
            â”‚ 1   â”‚
            â”‚ 2   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[0,1,2]]
        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Úheadrç   s    €€r   r,   zExpr.head.<locals>.<lambda>K
  ó   ø€ ¨$×*AÑ*AÀ#Ó*F×*KÑ*KÈAÓ*N€ r   r-   ré   s   ``r   r?  z	Expr.head
  ó   ù€ ðd ~‰~ÔNÓOÐOr   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uç  Get the last `n` rows.

        Arguments:
            n: Number of rows to return.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": list(range(10))}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function that returns the last 3 rows:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").tail(3)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a
            7  7
            8  8
            9  9
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 7   â”‚
            â”‚ 8   â”‚
            â”‚ 9   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[7,8,9]]
        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Útailrç   s    €€r   r,   zExpr.tail.<locals>.<lambda>
  r@  r   r-   ré   s   ``r   rD  z	Expr.tailM
  rA  r   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uÊ  Round underlying floating point data by `decimals` digits.

        Arguments:
            decimals: Number of decimals to round by.

        Returns:
            A new expression.


        Notes:
            For values exactly halfway between rounded decimal values pandas behaves differently than Polars and Arrow.

            pandas rounds to the nearest even value (e.g. -0.5 and 0.5 round to 0.0, 1.5 and 2.5 round to 2.0, 3.5 and
            4.5 to 4.0, etc..).

            Polars and Arrow round away from 0 (e.g. -0.5 to -1.0, 0.5 to 1.0, 1.5 to 2.0, 2.5 to 3.0, etc..).

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1.12345, 2.56789, 3.901234]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function that rounds to the first decimal:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").round(1)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
                 a
            0  1.1
            1  2.6
            2  3.9
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ f64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 1.1 â”‚
            â”‚ 2.6 â”‚
            â”‚ 3.9 â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: double
            ----
            a: [[1.1,2.6,3.9]]
        c                óD   •— ‰j                  | «      j                  ‰«      S r"   )r   Úround)r+   Údecimalsr#   s    €€r   r,   zExpr.round.<locals>.<lambda>¼
  s   ø€ ¨$×*AÑ*AÀ#Ó*F×*LÑ*LÈXÓ*V€ r   r-   )r#   rH  s   ``r   rG  z
Expr.round
  s   ù€ ðv ~‰~ÔVÓWÐWr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uõ  Return the number of elements in the column.

        Null values count towards the total.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": ["x", "y", "z"], "b": [1, 2, 1]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function that computes the len over different values of "b" column:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").filter(nw.col("b") == 1).len().alias("a1"),
            ...         nw.col("a").filter(nw.col("b") == 2).len().alias("a2"),
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a1  a2
            0   2   1
            >>> my_library_agnostic_function(df_pl)
            shape: (1, 2)
            â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a1  â”† a2  â”‚
            â”‚ --- â”† --- â”‚
            â”‚ u32 â”† u32 â”‚
            â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 2   â”† 1   â”‚
            â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a1: int64
            a2: int64
            ----
            a1: [[2]]
            a2: [[1]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úlenr*   s    €r   r,   zExpr.len.<locals>.<lambda>ð
  r–   r   r-   r/   s   `r   rK  zExpr.len¾
  s   ø€ ðd ~‰~ÓLÓMÐMr   c                ó4   ‡ ‡‡— ‰ j                  ˆˆˆ fd„«      S )uR  Take every nth value in the Series and return as new Series.

        Arguments:
            n: Gather every *n*-th row.
            offset: Starting index.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function in which gather every 2 rows,
            starting from a offset of 1:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").gather_every(n=2, offset=1)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a
            1  2
            3  4
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 2   â”‚
            â”‚ 4   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[2,4]]
        c                óH   •— ‰j                  | «      j                  ‰‰¬«      S )N)rè   Úoffset)r   Úgather_every)r+   rè   rN  r#   s    €€€r   r,   z#Expr.gather_every.<locals>.<lambda>%  s"   ø€ ˜×/Ñ/°Ó4×AÑAÀAÈfÐAÓU€ r   r-   )r#   rè   rN  s   ```r   rO  zExpr.gather_everyò
  s   ú€ ðd ~‰~ÝUó
ð 	
r   c                ó4   ‡ ‡‡— ‰ j                  ˆˆ ˆfd„«      S )uK  Clip values in the Series.

        Arguments:
            lower_bound: Lower bound value.
            upper_bound: Upper bound value.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT

            >>> s = [1, 2, 3]
            >>> df_pd = pd.DataFrame({"s": s})
            >>> df_pl = pl.DataFrame({"s": s})
            >>> df_pa = pa.table({"s": s})

            We define a library agnostic function:

            >>> def func_lower(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("s").clip(2)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func_lower`:

            >>> func_lower(df_pd)
               s
            0  2
            1  2
            2  3
            >>> func_lower(df_pl)
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ s   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 2   â”‚
            â”‚ 2   â”‚
            â”‚ 3   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> func_lower(df_pa)
            pyarrow.Table
            s: int64
            ----
            s: [[2,2,3]]

            We define another library agnostic function:

            >>> def func_upper(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("s").clip(upper_bound=2)).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func_upper`:

            >>> func_upper(df_pd)
               s
            0  1
            1  2
            2  2
            >>> func_upper(df_pl)
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ s   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 1   â”‚
            â”‚ 2   â”‚
            â”‚ 2   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> func_upper(df_pa)
            pyarrow.Table
            s: int64
            ----
            s: [[1,2,2]]

            We can have both at the same time

            >>> s = [-1, 1, -3, 3, -5, 5]
            >>> df_pd = pd.DataFrame({"s": s})
            >>> df_pl = pl.DataFrame({"s": s})
            >>> df_pa = pa.table({"s": s})

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("s").clip(-1, 3)).to_native()

            We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               s
            0 -1
            1  1
            2 -1
            3  3
            4 -1
            5  3
            >>> my_library_agnostic_function(df_pl)
            shape: (6, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ s   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ -1  â”‚
            â”‚ 1   â”‚
            â”‚ -1  â”‚
            â”‚ 3   â”‚
            â”‚ -1  â”‚
            â”‚ 3   â”‚
            â””â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            s: int64
            ----
            s: [[-1,1,-1,3,-1,3]]
        c                óF   •— ‰j                  | «      j                  ‰‰«      S r"   )r   Úclip)r+   rÿ   r#   r   s    €€€r   r,   zExpr.clip.<locals>.<lambda>¬  s   ø€ ˜×/Ñ/°Ó4×9Ñ9¸+À{ÓS€ r   r-   )r#   rÿ   r   s   ```r   rR  z	Expr.clip*  s   ú€ ðB ~‰~ÝSó
ð 	
r   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u¼  Compute the most occurring value(s).

        Can return multiple values.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT

            >>> data = {
            ...     "a": [1, 1, 2, 3],
            ...     "b": [1, 1, 2, 2],
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").mode()).sort("a").to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(df_pd)
               a
            0  1

            >>> my_library_agnostic_function(df_pl)
            shape: (1, 1)
            â”Œâ”€â”€â”€â”€â”€â”
            â”‚ a   â”‚
            â”‚ --- â”‚
            â”‚ i64 â”‚
            â•žâ•â•â•â•â•â•¡
            â”‚ 1   â”‚
            â””â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: int64
            ----
            a: [[1]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Úmoder*   s    €r   r,   zExpr.mode.<locals>.<lambda>â  rª   r   r-   r/   s   `r   rU  z	Expr.mode¯  s   ø€ ðf ~‰~ÓMÓNÐNr   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Returns boolean values indicating which original values are finite.

        Warning:
            Different backend handle null values differently. `is_finite` will return
            False for NaN and Null's in the Dask and pandas non-nullable backend, while
            for Polars, PyArrow and pandas nullable backends null values are kept as such.

        Returns:
            Expression of `Boolean` data type.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [float("nan"), float("inf"), 2.0, None]}

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").is_finite()).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(pd.DataFrame(data))
                   a
            0  False
            1  False
            2   True
            3  False
            >>> my_library_agnostic_function(pl.DataFrame(data))
            shape: (4, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a     â”‚
            â”‚ ---   â”‚
            â”‚ bool  â”‚
            â•žâ•â•â•â•â•â•â•â•¡
            â”‚ false â”‚
            â”‚ false â”‚
            â”‚ true  â”‚
            â”‚ null  â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(pa.table(data))
            pyarrow.Table
            a: bool
            ----
            a: [[false,false,true,null]]
        c                óB   •— ‰j                  | «      j                  «       S r"   )r   Ú	is_finiter*   s    €r   r,   z Expr.is_finite.<locals>.<lambda>  r/  r   r-   r/   s   `r   rX  zExpr.is_finiteä  s   ø€ ðh ~‰~ÓRÓSÐSr   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uÜ	  Return the cumulative count of the non-null values in the column.

        Arguments:
            reverse: reverse the operation

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": ["x", "k", None, "d"]}

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("a").cum_count().alias("cum_count"),
            ...         nw.col("a").cum_count(reverse=True).alias("cum_count_reverse"),
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(pd.DataFrame(data))
                  a  cum_count  cum_count_reverse
            0     x          1                  3
            1     k          2                  2
            2  None          2                  1
            3     d          3                  1

            >>> my_library_agnostic_function(pl.DataFrame(data))
            shape: (4, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† cum_count â”† cum_count_reverse â”‚
            â”‚ ---  â”† ---       â”† ---               â”‚
            â”‚ str  â”† u32       â”† u32               â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ x    â”† 1         â”† 3                 â”‚
            â”‚ k    â”† 2         â”† 2                 â”‚
            â”‚ null â”† 2         â”† 1                 â”‚
            â”‚ d    â”† 3         â”† 1                 â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(pa.table(data))
            pyarrow.Table
            a: string
            cum_count: uint32
            cum_count_reverse: uint32
            ----
            a: [["x","k",null,"d"]]
            cum_count: [[1,2,2,3]]
            cum_count_reverse: [[3,2,1,1]]
        c                óF   •— ‰j                  | «      j                  ‰¬«      S rÜ   )r   Ú	cum_countrÞ   s    €€r   r,   z Expr.cum_count.<locals>.<lambda>U  s    ø€ ˜×/Ñ/°Ó4×>Ñ>ÀwÐ>ÓO€ r   r-   rà   s   ``r   r[  zExpr.cum_count  s   ù€ ðt ~‰~ÜOó
ð 	
r   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uh	  Return the cumulative min of the non-null values in the column.

        Arguments:
            reverse: reverse the operation

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [3, 1, None, 2]}

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("a").cum_min().alias("cum_min"),
            ...         nw.col("a").cum_min(reverse=True).alias("cum_min_reverse"),
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(pd.DataFrame(data))
                 a  cum_min  cum_min_reverse
            0  3.0      3.0              1.0
            1  1.0      1.0              1.0
            2  NaN      NaN              NaN
            3  2.0      1.0              2.0

            >>> my_library_agnostic_function(pl.DataFrame(data))
            shape: (4, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† cum_min â”† cum_min_reverse â”‚
            â”‚ ---  â”† ---     â”† ---             â”‚
            â”‚ i64  â”† i64     â”† i64             â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 3    â”† 3       â”† 1               â”‚
            â”‚ 1    â”† 1       â”† 1               â”‚
            â”‚ null â”† null    â”† null            â”‚
            â”‚ 2    â”† 1       â”† 2               â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(pa.table(data))
            pyarrow.Table
            a: int64
            cum_min: int64
            cum_min_reverse: int64
            ----
            a: [[3,1,null,2]]
            cum_min: [[3,1,null,1]]
            cum_min_reverse: [[1,1,null,2]]
        c                óF   •— ‰j                  | «      j                  ‰¬«      S rÜ   )r   Úcum_minrÞ   s    €€r   r,   zExpr.cum_min.<locals>.<lambda>“  rß   r   r-   rà   s   ``r   r^  zExpr.cum_minX  ó   ù€ ðt ~‰~ÜMó
ð 	
r   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uh	  Return the cumulative max of the non-null values in the column.

        Arguments:
            reverse: reverse the operation

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 3, None, 2]}

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("a").cum_max().alias("cum_max"),
            ...         nw.col("a").cum_max(reverse=True).alias("cum_max_reverse"),
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(pd.DataFrame(data))
                 a  cum_max  cum_max_reverse
            0  1.0      1.0              3.0
            1  3.0      3.0              3.0
            2  NaN      NaN              NaN
            3  2.0      3.0              2.0

            >>> my_library_agnostic_function(pl.DataFrame(data))
            shape: (4, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† cum_max â”† cum_max_reverse â”‚
            â”‚ ---  â”† ---     â”† ---             â”‚
            â”‚ i64  â”† i64     â”† i64             â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1    â”† 1       â”† 3               â”‚
            â”‚ 3    â”† 3       â”† 3               â”‚
            â”‚ null â”† null    â”† null            â”‚
            â”‚ 2    â”† 3       â”† 2               â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(pa.table(data))
            pyarrow.Table
            a: int64
            cum_max: int64
            cum_max_reverse: int64
            ----
            a: [[1,3,null,2]]
            cum_max: [[1,3,null,3]]
            cum_max_reverse: [[3,3,null,2]]
        c                óF   •— ‰j                  | «      j                  ‰¬«      S rÜ   )r   Úcum_maxrÞ   s    €€r   r,   zExpr.cum_max.<locals>.<lambda>Ñ  rß   r   r-   rà   s   ``r   rb  zExpr.cum_max–  r_  r   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )už	  Return the cumulative product of the non-null values in the column.

        Arguments:
            reverse: reverse the operation

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1, 3, None, 2]}

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("a").cum_prod().alias("cum_prod"),
            ...         nw.col("a").cum_prod(reverse=True).alias("cum_prod_reverse"),
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> my_library_agnostic_function(pd.DataFrame(data))
                 a  cum_prod  cum_prod_reverse
            0  1.0       1.0               6.0
            1  3.0       3.0               6.0
            2  NaN       NaN               NaN
            3  2.0       6.0               2.0

            >>> my_library_agnostic_function(pl.DataFrame(data))
            shape: (4, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a    â”† cum_prod â”† cum_prod_reverse â”‚
            â”‚ ---  â”† ---      â”† ---              â”‚
            â”‚ i64  â”† i64      â”† i64              â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1    â”† 1        â”† 6                â”‚
            â”‚ 3    â”† 3        â”† 6                â”‚
            â”‚ null â”† null     â”† null             â”‚
            â”‚ 2    â”† 6        â”† 2                â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> my_library_agnostic_function(pa.table(data))
            pyarrow.Table
            a: int64
            cum_prod: int64
            cum_prod_reverse: int64
            ----
            a: [[1,3,null,2]]
            cum_prod: [[1,3,null,6]]
            cum_prod_reverse: [[6,6,null,2]]
        c                óF   •— ‰j                  | «      j                  ‰¬«      S rÜ   )r   Úcum_prodrÞ   s    €€r   r,   zExpr.cum_prod.<locals>.<lambda>  s    ø€ ˜×/Ñ/°Ó4×=Ñ=ÀgÐ=ÓN€ r   r-   rà   s   ``r   re  zExpr.cum_prodÔ  s   ù€ ðt ~‰~ÜNó
ð 	
r   )r¢   Úcenterc               óX   ‡ ‡‡‡— t        ‰‰¬«      \  ŠŠ‰ j                  ˆˆˆ ˆfd„«      S )u¯
  Apply a rolling sum (moving sum) over the values.

        !!! warning
            This functionality is considered **unstable**. It may be changed at any point
            without it being considered a breaking change.

        A window of length `window_size` will traverse the values. The resulting values
        will be aggregated to their sum.

        The window at a given row will include the row itself and the `window_size - 1`
        elements before it.

        Arguments:
            window_size: The length of the window in number of elements. It must be a
                strictly positive integer.
            min_periods: The number of values in the window that should be non-null before
                computing a result. If set to `None` (default), it will be set equal to
                `window_size`. If provided, it must be a strictly positive integer, and
                less than or equal to `window_size`
            center: Set the labels at the center of the window.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1.0, 2.0, None, 4.0]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            We define a library agnostic function:

            >>> def agnostic_rolling_sum(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         b=nw.col("a").rolling_sum(window_size=3, min_periods=1)
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> agnostic_rolling_sum(df_pd)
                 a    b
            0  1.0  1.0
            1  2.0  3.0
            2  NaN  3.0
            3  4.0  6.0

            >>> agnostic_rolling_sum(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a    â”† b   â”‚
            â”‚ ---  â”† --- â”‚
            â”‚ f64  â”† f64 â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1.0  â”† 1.0 â”‚
            â”‚ 2.0  â”† 3.0 â”‚
            â”‚ null â”† 3.0 â”‚
            â”‚ 4.0  â”† 6.0 â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜

            >>> agnostic_rolling_sum(df_pa)  #  doctest:+ELLIPSIS
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[1,2,null,4]]
            b: [[1,3,3,6]]
        ©Úwindow_sizer¢   c                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S ©N)ri  r¢   rf  )r   Úrolling_sum©r+   rf  r¢   r#   ri  s    €€€€r   r,   z"Expr.rolling_sum.<locals>.<lambda>g  s,   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø'Ø'Øð Aó € r   ©r   r.   ©r#   ri  r¢   rf  s   ````r   rl  zExpr.rolling_sum  ó2   û€ ô` $?Ø#°ô$
Ñ ˆ[ð ~‰~öó
ð 	
r   c               óX   ‡ ‡‡‡— t        ‰‰¬«      \  ŠŠ‰ j                  ˆˆˆ ˆfd„«      S )u»
  Apply a rolling mean (moving mean) over the values.

        !!! warning
            This functionality is considered **unstable**. It may be changed at any point
            without it being considered a breaking change.

        A window of length `window_size` will traverse the values. The resulting values
        will be aggregated to their mean.

        The window at a given row will include the row itself and the `window_size - 1`
        elements before it.

        Arguments:
            window_size: The length of the window in number of elements. It must be a
                strictly positive integer.
            min_periods: The number of values in the window that should be non-null before
                computing a result. If set to `None` (default), it will be set equal to
                `window_size`. If provided, it must be a strictly positive integer, and
                less than or equal to `window_size`
            center: Set the labels at the center of the window.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [1.0, 2.0, None, 4.0]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            We define a library agnostic function:

            >>> def agnostic_rolling_mean(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         b=nw.col("a").rolling_mean(window_size=3, min_periods=1)
            ...     ).to_native()

            We can then pass any supported library such as Pandas, Polars, or PyArrow to `func`:

            >>> agnostic_rolling_mean(df_pd)
                 a    b
            0  1.0  1.0
            1  2.0  1.5
            2  NaN  1.5
            3  4.0  3.0

            >>> agnostic_rolling_mean(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ a    â”† b   â”‚
            â”‚ ---  â”† --- â”‚
            â”‚ f64  â”† f64 â”‚
            â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1.0  â”† 1.0 â”‚
            â”‚ 2.0  â”† 1.5 â”‚
            â”‚ null â”† 1.5 â”‚
            â”‚ 4.0  â”† 3.0 â”‚
            â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜

            >>> agnostic_rolling_mean(df_pa)  #  doctest:+ELLIPSIS
            pyarrow.Table
            a: double
            b: double
            ----
            a: [[1,2,null,4]]
            b: [[1,1.5,1.5,3]]
        rh  c                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S rk  )r   Úrolling_meanrm  s    €€€€r   r,   z#Expr.rolling_mean.<locals>.<lambda>Ã  s,   ø€ ˜×/Ñ/°Ó4×AÑAØ'Ø'Øð Bó € r   rn  ro  s   ````r   rs  zExpr.rolling_meann  rp  r   c                ó   — t        | «      S r"   )ÚExprStringNamespacer/   s    r   r  zExpr.strÊ  s   € ä" 4Ó(Ð(r   c                ó   — t        | «      S r"   )ÚExprDateTimeNamespacer/   s    r   ÚdtzExpr.dtÎ  s   € ä$ TÓ*Ð*r   c                ó   — t        | «      S r"   )ÚExprCatNamespacer/   s    r   ÚcatzExpr.catÒ  s   € ä Ó%Ð%r   c                ó   — t        | «      S r"   )ÚExprNameNamespacer/   s    r   r4   z	Expr.nameÖ  ó   € ä  Ó&Ð&r   c                ó   — t        | «      S r"   )ÚExprListNamespacer/   s    r   rñ   z	Expr.listÚ  r~  r   )r$   zCallable[[Any], Any]ÚreturnÚNone)r  r   )r4   r  r  r   )r7   úCallable[[Any], Self]r8   r   r9   r   r  r   )r#   r   r>   zDType | type[DType]r  r   )r   Úobjectr  r   )r   r   r  r   )r#   r   r   úfloat | Nonerž   r…  rŸ   r…  r    r…  r¡   Úboolr¢   Úintr£   r†  r  r   )r¯   r‡  r  r   r"   )r7   rƒ  rµ   úDType | Noner  r   )r#   r   r  r   ©r  r   )rÒ   r†  r  r   )r#   r   rÙ   r†  r  r   )rè   r‡  r  r   )rï   z!Sequence[Any] | Mapping[Any, Any]rî   zSequence[Any] | Nonerµ   zDType | type[DType] | Noner  r   )rö   r†  r÷   r†  r  r   )Úboth)rÿ   r   r   r   rþ   r  r  r   )r  r   r  r   )NNN)r  ú
Any | Noner  z%Literal['forward', 'backward'] | Noner  ú
int | Noner  r   )r#   r   rè   rŒ  r   r…  r!  r†  r"  rŒ  r  r   )ró   ústr | Iterable[str]r  r   )r;  Úfloatr<  z;Literal['nearest', 'higher', 'lower', 'midpoint', 'linear']r  r   )é
   )r   )rH  r‡  r  r   )r#   r   rè   r‡  rN  r‡  r  r   )NN)rÿ   r‹  r   r‹  r  r   )
r#   r   ri  r‡  r¢   rŒ  rf  r†  r  r   )r#   r   r  zExprStringNamespace[Self])r#   r   r  zExprDateTimeNamespace[Self])r#   r   r  zExprCatNamespace[Self])r#   r   r  zExprNameNamespace[Self])r#   r   r  zExprListNamespace[Self])ZÚ__name__Ú
__module__Ú__qualname__r%   r0   r3   r:   r=   rA   rH   rK   rP   rT   rW   rZ   r]   r`   rc   rf   ri   rm   rp   rs   rv   ry   r|   r   r‚   r…   rˆ   r‹   rŽ   r‘   r•   rš   r¦   r©   r­   r²   r¶   r¹   r)   r¾   rÁ   rÄ   rÉ   rÌ   rÏ   rÕ   r(   rÝ   rã   ræ   rí   rú   rý   r  r	  r  r  r  r  r%  r(  r+  r.  r2  r5  r8  r;  r?  rD  rG  rK  rO  rR  rU  rX  r[  r^  rb  re  rl  rs  Úpropertyr  rx  r{  r4   rñ   r6   r   r   r   r   #   sÉ  „ ó4óTó0Tód6/óp9
óx
ó

ó

ó
ó
ó

ó
ó
ó
ó
ó
ó
ó
ó
ó
ó

ó

ó

ó

ó
ó
ó
ó
ó
óUó,Nó\,Nðb !Ø!Ø"&Ø"ØØØ"ñc
Øðc
ð ðc
ð ð	c
ð
  ðc
ð ðc
ð ðc
ð ðc
ð ðc
ð 
óc
óJ,Oó\/Qðb "#õ 1Wðl &*ðG
à'ðG
ð #ðG
ð 
ó	G
óR+OóZ,Nó\,Nó\,Nó\.Ró`.Ró`,Pó\,Sð\ 05õ 7
ór/Nðb 05õ 9
óv;Oóz>QðF %)ðU
ð
 48ñU
à.ðU
ð "ðU
ð
 1ðU
ð 
óU
ðn */À5õ U
ðr AGð=
Øð=
Ø-0ð=
Ø:=ð=
à	ó=
ó~:+óx:
óxFRóP-Sðb !Ø:>Ø ð	P
àðP
ð 8ðP
ð ð	P
ð
 
óP
óf6Uðt ðB
ð "&Ø!&ØñB
ØðB
àðB
ð ð	B
ð
 ðB
ð ðB
ð 
óB
óH<
ó|3Xój3Tój1Uóf5
ón3[ðjA
àðA
ð SðA
ð 
ó	A
ôF2Pôh2Pôh;Xóz2Nôh4
ðt #'Ø"&ðC
àðC
ð  ðC
ð 
ó	C
óJ3Oój4Tðl 27õ <
ð| 05õ <
ð| 05õ <
ð| 16õ <
ðD #'ØñZ
ØðZ
àðZ
ð  ð	Z
ð
 ðZ
ð 
óZ
ð@ #'ØñZ
ØðZ
àðZ
ð  ð	Z
ð
 ðZ
ð 
óZ
ðx ò)ó ð)ð ò+ó ð+ð ò&ó ð&ð ò'ó ð'ð ò'ó ñ'r   ÚExprT)Úboundc                  ó   — e Zd Zdd„Zdd„Zy)rz  c                ó   — || _         y r"   ©Ú_expr©r#   r   s     r   r%   zExprCatNamespace.__init__ã  ó	   € Øˆ
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uf  Get unique categories from column.

        Returns:
            A new expression.

        Examples:
            Let's create some dataframes:

            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"fruits": ["apple", "mango", "mango"]}
            >>> df_pd = pd.DataFrame(data, dtype="category")
            >>> df_pl = pl.DataFrame(data, schema={"fruits": pl.Categorical})

            We define a dataframe-agnostic function to get unique categories
            from column 'fruits':

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("fruits").cat.get_categories()).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
              fruits
            0  apple
            1  mango
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ fruits â”‚
            â”‚ ---    â”‚
            â”‚ str    â”‚
            â•žâ•â•â•â•â•â•â•â•â•¡
            â”‚ apple  â”‚
            â”‚ mango  â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r{  Úget_categoriesr*   s    €r   r,   z1ExprCatNamespace.get_categories.<locals>.<lambda>  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×MÑMÓO€ r   ©r™  r.   r/   s   `r   rž  zExprCatNamespace.get_categoriesæ  s    ø€ ðR z‰z×#Ñ#ÛOó
ð 	
r   N©r#   r   r   r”  r  r‚  ©r#   r   r  r”  )r  r‘  r’  r%   rž  r6   r   r   rz  rz  â  s   „ óô+
r   rz  c                  ó¾   — e Zd Zdd„Zdd„Zdddœ	 	 	 	 	 	 	 	 	 dd„Zddœ	 	 	 	 	 	 	 	 	 dd„Zddd
„Zdd„Zdd„Z	ddœdd„Z
ddd„Zddd„Zddd„Zdd d„Zdd„Zdd„Zy	)!ru  c                ó   — || _         y r"   r˜  rš  s     r   r%   zExprStringNamespace.__init__  r›  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uÊ  Return the length of each string as the number of characters.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"words": ["foo", "CafÃ©", "345", "æ±äº¬", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         words_len=nw.col("words").str.len_chars()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
              words  words_len
            0   foo        3.0
            1  CafÃ©        4.0
            2   345        3.0
            3    æ±äº¬        2.0
            4  None        NaN

            >>> my_library_agnostic_function(df_pl)
            shape: (5, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ words â”† words_len â”‚
            â”‚ ---   â”† ---       â”‚
            â”‚ str   â”† u32       â”‚
            â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ foo   â”† 3         â”‚
            â”‚ CafÃ©  â”† 4         â”‚
            â”‚ 345   â”† 3         â”‚
            â”‚ æ±äº¬  â”† 2         â”‚
            â”‚ null  â”† null      â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r  Ú	len_charsr*   s    €r   r,   z/ExprStringNamespace.len_chars.<locals>.<lambda>H  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×HÑHÓJ€ r   rŸ  r/   s   `r   r¦  zExprStringNamespace.len_chars  s    ø€ ð^ z‰z×#Ñ#ÛJó
ð 	
r   Fr›   ©Úliteralrè   c               óP   ‡ ‡‡‡‡— ‰ j                   j                  ˆˆˆˆ ˆfd„«      S )u  Replace first matching regex/literal substring with a new string value.

        Arguments:
            pattern: A valid regular expression pattern.
            value: String that will replace the matched substring.
            literal: Treat `pattern` as a literal string.
            n: Number of matches to replace.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"foo": ["123abc", "abc abc123"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     df = df.with_columns(replaced=nw.col("foo").str.replace("abc", ""))
            ...     return df.to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                      foo replaced
            0      123abc      123
            1  abc abc123   abc123

            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ foo        â”† replaced â”‚
            â”‚ ---        â”† ---      â”‚
            â”‚ str        â”† str      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 123abc     â”† 123      â”‚
            â”‚ abc abc123 â”†  abc123  â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ót   •— ‰j                   j                  | «      j                  j                  ‰‰‰‰¬«      S )Nr§  )r™  r   r  Úreplace)r+   r¨  rè   Úpatternr#   r  s    €€€€€r   r,   z-ExprStringNamespace.replace.<locals>.<lambda>|  s6   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×FÑFØ˜¨°1ð Gó € r   rŸ  )r#   r¬  r  r¨  rè   s   `````r   r«  zExprStringNamespace.replaceK  s"   ü€ ð` z‰z×#Ñ#÷ó
ð 	
r   ©r¨  c               óL   ‡ ‡‡‡— ‰ j                   j                  ˆˆˆ ˆfd„«      S )uè  Replace all matching regex/literal substring with a new string value.

        Arguments:
            pattern: A valid regular expression pattern.
            value: String that will replace the matched substring.
            literal: Treat `pattern` as a literal string.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"foo": ["123abc", "abc abc123"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     df = df.with_columns(replaced=nw.col("foo").str.replace_all("abc", ""))
            ...     return df.to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                      foo replaced
            0      123abc      123
            1  abc abc123      123

            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ foo        â”† replaced â”‚
            â”‚ ---        â”† ---      â”‚
            â”‚ str        â”† str      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 123abc     â”† 123      â”‚
            â”‚ abc abc123 â”†  123     â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ór   •— ‰j                   j                  | «      j                  j                  ‰‰‰¬«      S ©Nr­  )r™  r   r  Úreplace_all)r+   r¨  r¬  r#   r  s    €€€€r   r,   z1ExprStringNamespace.replace_all.<locals>.<lambda>±  s4   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×JÑJØ˜¨ð Kó € r   rŸ  )r#   r¬  r  r¨  s   ````r   r±  zExprStringNamespace.replace_all  s"   û€ ð^ z‰z×#Ñ#öó
ð 	
r   Nc                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )ag  Remove leading and trailing characters.

        Arguments:
            characters: The set of characters to be removed. All combinations of this set of characters will be stripped from the start and end of the string. If set to None (default), all leading and trailing whitespace is removed instead.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrame
            >>> from typing import Any
            >>> data = {"fruits": ["apple", "\nmango"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrame) -> dict[str, Any]:
            ...     df = nw.from_native(df_native)
            ...     df = df.with_columns(stripped=nw.col("fruits").str.strip_chars())
            ...     return df.to_dict(as_series=False)

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
            {'fruits': ['apple', '\nmango'], 'stripped': ['apple', 'mango']}

            >>> my_library_agnostic_function(df_pl)
            {'fruits': ['apple', '\nmango'], 'stripped': ['apple', 'mango']}
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   r  Ústrip_chars)r+   Ú
charactersr#   s    €€r   r,   z1ExprStringNamespace.strip_chars.<locals>.<lambda>Ù  s'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×JÑJÈ:ÓV€ r   rŸ  )r#   rµ  s   ``r   r´  zExprStringNamespace.strip_chars¶  s    ù€ ðD z‰z×#Ñ#ÜVó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )u{  Check if string values start with a substring.

        Arguments:
            prefix: prefix substring

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"fruits": ["apple", "mango", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         has_prefix=nw.col("fruits").str.starts_with("app")
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
              fruits has_prefix
            0  apple       True
            1  mango      False
            2   None       None

            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ fruits â”† has_prefix â”‚
            â”‚ ---    â”† ---        â”‚
            â”‚ str    â”† bool       â”‚
            â•žâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ apple  â”† true       â”‚
            â”‚ mango  â”† false      â”‚
            â”‚ null   â”† null       â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   r  Ústarts_with©r+   Úprefixr#   s    €€r   r,   z1ExprStringNamespace.starts_with.<locals>.<lambda>  s'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×JÑJÈ6ÓR€ r   rŸ  ©r#   rº  s   ``r   r¸  zExprStringNamespace.starts_withÜ  s    ù€ ð\ z‰z×#Ñ#ÜRó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆ ˆfd„«      S )uw  Check if string values end with a substring.

        Arguments:
            suffix: suffix substring

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"fruits": ["apple", "mango", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         has_suffix=nw.col("fruits").str.ends_with("ngo")
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
              fruits has_suffix
            0  apple      False
            1  mango       True
            2   None       None

            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ fruits â”† has_suffix â”‚
            â”‚ ---    â”† ---        â”‚
            â”‚ str    â”† bool       â”‚
            â•žâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ apple  â”† false      â”‚
            â”‚ mango  â”† true       â”‚
            â”‚ null   â”† null       â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   r  Ú	ends_with©r+   r#   Úsuffixs    €€r   r,   z/ExprStringNamespace.ends_with.<locals>.<lambda>=  s'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×HÑHÈÓP€ r   rŸ  ©r#   rÀ  s   ``r   r¾  zExprStringNamespace.ends_with  s    ù€ ð\ z‰z×#Ñ#ÜPó
ð 	
r   c               óH   ‡ ‡‡— ‰ j                   j                  ˆˆˆ fd„«      S )uê  Check if string contains a substring that matches a pattern.

        Arguments:
            pattern: A Character sequence or valid regular expression pattern.
            literal: If True, treats the pattern as a literal string.
                     If False, assumes the pattern is a regular expression.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"pets": ["cat", "dog", "rabbit and parrot", "dove", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         default_match=nw.col("pets").str.contains("parrot|Dove"),
            ...         case_insensitive_match=nw.col("pets").str.contains("(?i)parrot|Dove"),
            ...         literal_match=nw.col("pets").str.contains(
            ...             "parrot|Dove", literal=True
            ...         ),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                            pets default_match case_insensitive_match literal_match
            0                cat         False                  False         False
            1                dog         False                  False         False
            2  rabbit and parrot          True                   True         False
            3               dove         False                   True         False
            4               None          None                   None          None
            >>> my_library_agnostic_function(df_pl)
            shape: (5, 4)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ pets              â”† default_match â”† case_insensitive_match â”† literal_match â”‚
            â”‚ ---               â”† ---           â”† ---                    â”† ---           â”‚
            â”‚ str               â”† bool          â”† bool                   â”† bool          â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ cat               â”† false         â”† false                  â”† false         â”‚
            â”‚ dog               â”† false         â”† false                  â”† false         â”‚
            â”‚ rabbit and parrot â”† true          â”† true                   â”† false         â”‚
            â”‚ dove              â”† false         â”† true                   â”† false         â”‚
            â”‚ null              â”† null          â”† null                   â”† null          â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óp   •— ‰j                   j                  | «      j                  j                  ‰‰¬«      S r°  )r™  r   r  Úcontains)r+   r¨  r¬  r#   s    €€€r   r,   z.ExprStringNamespace.contains.<locals>.<lambda>x  s2   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×GÑGØ ð Hó € r   rŸ  )r#   r¬  r¨  s   ```r   rÄ  zExprStringNamespace.contains@  s"   ú€ ðn z‰z×#Ñ#õó
ð 	
r   c                óH   ‡ ‡‡— ‰ j                   j                  ˆˆˆ fd„«      S )u[  Create subslices of the string values of an expression.

        Arguments:
            offset: Start index. Negative indexing is supported.
            length: Length of the slice. If set to `None` (default), the slice is taken to the
                end of the string.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"s": ["pear", None, "papaya", "dragonfruit"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         s_sliced=nw.col("s").str.slice(4, length=3)
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)  # doctest: +NORMALIZE_WHITESPACE
                         s s_sliced
            0         pear
            1         None     None
            2       papaya       ya
            3  dragonfruit      onf

            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ s           â”† s_sliced â”‚
            â”‚ ---         â”† ---      â”‚
            â”‚ str         â”† str      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ pear        â”†          â”‚
            â”‚ null        â”† null     â”‚
            â”‚ papaya      â”† ya       â”‚
            â”‚ dragonfruit â”† onf      â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            Using negative indexes:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(s_sliced=nw.col("s").str.slice(-3)).to_native()

            >>> my_library_agnostic_function(df_pd)
                         s s_sliced
            0         pear      ear
            1         None     None
            2       papaya      aya
            3  dragonfruit      uit

            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ s           â”† s_sliced â”‚
            â”‚ ---         â”† ---      â”‚
            â”‚ str         â”† str      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ pear        â”† ear      â”‚
            â”‚ null        â”† null     â”‚
            â”‚ papaya      â”† aya      â”‚
            â”‚ dragonfruit â”† uit      â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óp   •— ‰j                   j                  | «      j                  j                  ‰‰¬«      S ©N)rN  Úlength©r™  r   r  Úslice)r+   rÈ  rN  r#   s    €€€r   r,   z+ExprStringNamespace.slice.<locals>.<lambda>Ê  s2   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×DÑDØ fð Eó € r   rŸ  )r#   rN  rÈ  s   ```r   rÊ  zExprStringNamespace.slice}  s"   ú€ ðX z‰z×#Ñ#õó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )uÄ  Take the first n elements of each string.

        Arguments:
            n: Number of elements to take. Negative indexing is **not** supported.

        Returns:
            A new expression.

        Notes:
            If the length of the string has fewer than `n` characters, the full string is returned.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"lyrics": ["Atatata", "taata", "taatatata", "zukkyun"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         lyrics_head=nw.col("lyrics").str.head()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                  lyrics lyrics_head
            0    Atatata       Atata
            1      taata       taata
            2  taatatata       taata
            3    zukkyun       zukky

            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ lyrics    â”† lyrics_head â”‚
            â”‚ ---       â”† ---         â”‚
            â”‚ str       â”† str         â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ Atatata   â”† Atata       â”‚
            â”‚ taata     â”† taata       â”‚
            â”‚ taatatata â”† taata       â”‚
            â”‚ zukkyun   â”† zukky       â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ón   •— ‰j                   j                  | «      j                  j                  d‰«      S )Nr   rÉ  rç   s    €€r   r,   z*ExprStringNamespace.head.<locals>.<lambda>  s)   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×DÑDÀQÈÓJ€ r   rŸ  ré   s   ``r   r?  zExprStringNamespace.headÏ  s    ù€ ðf z‰z×#Ñ#ÜJó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )uÃ  Take the last n elements of each string.

        Arguments:
            n: Number of elements to take. Negative indexing is **not** supported.

        Returns:
            A new expression.

        Notes:
            If the length of the string has fewer than `n` characters, the full string is returned.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"lyrics": ["Atatata", "taata", "taatatata", "zukkyun"]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         lyrics_tail=nw.col("lyrics").str.tail()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                  lyrics lyrics_tail
            0    Atatata       atata
            1      taata       taata
            2  taatatata       atata
            3    zukkyun       kkyun

            >>> my_library_agnostic_function(df_pl)
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ lyrics    â”† lyrics_tail â”‚
            â”‚ ---       â”† ---         â”‚
            â”‚ str       â”† str         â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ Atatata   â”† atata       â”‚
            â”‚ taata     â”† taata       â”‚
            â”‚ taatatata â”† atata       â”‚
            â”‚ zukkyun   â”† kkyun       â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ór   •— ‰j                   j                  | «      j                  j                  ‰ d ¬«      S rÇ  rÉ  rç   s    €€r   r,   z*ExprStringNamespace.tail.<locals>.<lambda>:  s4   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×DÑDØr $ð Eó € r   rŸ  ré   s   ``r   rD  zExprStringNamespace.tail  s"   ù€ ðf z‰z×#Ñ#ôó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )uv	  Convert to Datetime dtype.

        Warning:
            As different backends auto-infer format in different ways, if `format=None`
            there is no guarantee that the result will be equal.

        Arguments:
            format: Format to use for conversion. If set to None (default), the format is
                inferred from the data.

        Returns:
            A new expression.

        Notes:
            pandas defaults to nanosecond time unit, Polars to microsecond.
            Prior to pandas 2.0, nanoseconds were the only time unit supported
            in pandas, with no ability to set any other one. The ability to
            set the time unit in pandas, if the version permits, will arrive.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = ["2020-01-01", "2020-01-02"]
            >>> df_pd = pd.DataFrame({"a": data})
            >>> df_pl = pl.DataFrame({"a": data})
            >>> df_pa = pa.table({"a": data})

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").str.to_datetime(format="%Y-%m-%d")
            ...     ).to_native()

            We can then pass any supported library such as pandas, Polars, or PyArrow:

            >>> my_library_agnostic_function(df_pd)
                       a
            0 2020-01-01
            1 2020-01-02
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a                   â”‚
            â”‚ ---                 â”‚
            â”‚ datetime[Î¼s]        â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2020-01-01 00:00:00 â”‚
            â”‚ 2020-01-02 00:00:00 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: timestamp[us]
            ----
            a: [[2020-01-01 00:00:00.000000,2020-01-02 00:00:00.000000]]
        c                ón   •— ‰j                   j                  | «      j                  j                  ‰¬«      S )N)Úformat)r™  r   r  Úto_datetime©r+   rÑ  r#   s    €€r   r,   z1ExprStringNamespace.to_datetime.<locals>.<lambda>}  s+   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×JÑJÐRXÐJÓY€ r   rŸ  ©r#   rÑ  s   ``r   rÒ  zExprStringNamespace.to_datetime?  s    ù€ ðz z‰z×#Ñ#ÜYó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u<  Transform string to uppercase variant.

        Returns:
            A new expression.

        Notes:
            The PyArrow backend will convert 'ÃŸ' to 'áºž' instead of 'SS'.
            For more info see [the related issue](https://github.com/apache/arrow/issues/34599).
            There may be other unicode-edge-case-related variations across implementations.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"fruits": ["apple", "mango", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         upper_col=nw.col("fruits").str.to_uppercase()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
              fruits upper_col
            0  apple     APPLE
            1  mango     MANGO
            2   None      None

            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ fruits â”† upper_col â”‚
            â”‚ ---    â”† ---       â”‚
            â”‚ str    â”† str       â”‚
            â•žâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ apple  â”† APPLE     â”‚
            â”‚ mango  â”† MANGO     â”‚
            â”‚ null   â”† null      â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r  Úto_uppercaser*   s    €r   r,   z2ExprStringNamespace.to_uppercase.<locals>.<lambda>²  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×>Ñ>×KÑKÓM€ r   rŸ  r/   s   `r   r×  z ExprStringNamespace.to_uppercase€  s    ø€ ðb z‰z×#Ñ#ÛMó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u"  Transform string to lowercase variant.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"fruits": ["APPLE", "MANGO", None]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         lower_col=nw.col("fruits").str.to_lowercase()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
              fruits lower_col
            0  APPLE     apple
            1  MANGO     mango
            2   None      None

            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ fruits â”† lower_col â”‚
            â”‚ ---    â”† ---       â”‚
            â”‚ str    â”† str       â”‚
            â•žâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ APPLE  â”† apple     â”‚
            â”‚ MANGO  â”† mango     â”‚
            â”‚ null   â”† null      â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r  Úto_lowercaser*   s    €r   r,   z2ExprStringNamespace.to_lowercase.<locals>.<lambda>á  rØ  r   rŸ  r/   s   `r   rÛ  z ExprStringNamespace.to_lowercaseµ  s    ø€ ðV z‰z×#Ñ#ÛMó
ð 	
r   r   r¡  )
r¬  r  r  r  r¨  r†  rè   r‡  r  r”  )
r#   r   r¬  r  r  r  r¨  r†  r  r”  r"   )r#   r   rµ  ú
str | Noner  r”  ©r#   r   rº  r  r  r”  ©r#   r   rÀ  r  r  r”  )r#   r   r¬  r  r¨  r†  r  r”  )r#   r   rN  r‡  rÈ  rŒ  r  r”  )é   )r#   r   rè   r‡  r  r”  )r#   r   rÑ  rÜ  r  r”  )r  r‘  r’  r%   r¦  r«  r±  r´  r¸  r¾  rÄ  rÊ  r?  rD  rÒ  r×  rÛ  r6   r   r   ru  ru    sº   „ óó1
ðh <AÈ1ñ4
Øð4
Ø#&ð4
Ø48ð4
ØEHð4
à	ó4
ðn BGñ3
Øð3
Ø ð3
Ø),ð3
Ø:>ð3
à	ó3
ôj$
óL0
ód0
ðd ?Dõ ;
ôzP
ôd5
ôn7
ôr?
óB3
ôj-
r   ru  c                  ó¶   — e Zd Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dd„Z
dd	„Zdd
„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zddd„Zy)rw  c                ó   — || _         y r"   r˜  rš  s     r   r%   zExprDateTimeNamespace.__init__æ  r›  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uò  Extract the date from underlying DateTime representation.

        Returns:
            A new expression.

        Raises:
            NotImplementedError: If pandas default backend is being used.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [datetime(2012, 1, 7, 10, 20), datetime(2023, 3, 10, 11, 32)]}
            >>> df_pd = pd.DataFrame(data).convert_dtypes(dtype_backend="pyarrow")
            >>> df_pl = pl.DataFrame(data)

            We define a library agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("a").dt.date()).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                        a
            0  2012-01-07
            1  2023-03-10

            >>> my_library_agnostic_function(df_pl)  # docetst
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a          â”‚
            â”‚ ---        â”‚
            â”‚ date       â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2012-01-07 â”‚
            â”‚ 2023-03-10 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Údater*   s    €r   r,   z,ExprDateTimeNamespace.date.<locals>.<lambda>  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×BÑBÓD€ r   rŸ  r/   s   `r   rä  zExprDateTimeNamespace.dateé  s    ø€ ðV z‰z×#Ñ#ÛDó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u¾  Extract year from underlying DateTime representation.

        Returns the year number in the calendar date.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 6, 1),
            ...         datetime(2024, 12, 13),
            ...         datetime(2065, 1, 1),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.year().alias("year")
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                datetime  year
            0 1978-06-01  1978
            1 2024-12-13  2024
            2 2065-01-01  2065
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime            â”† year â”‚
            â”‚ ---                 â”† ---  â”‚
            â”‚ datetime[Î¼s]        â”† i32  â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
            â”‚ 1978-06-01 00:00:00 â”† 1978 â”‚
            â”‚ 2024-12-13 00:00:00 â”† 2024 â”‚
            â”‚ 2065-01-01 00:00:00 â”† 2065 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úyearr*   s    €r   r,   z,ExprDateTimeNamespace.year.<locals>.<lambda>L  rå  r   rŸ  r/   s   `r   rè  zExprDateTimeNamespace.year  ó    ø€ ðf z‰z×#Ñ#ÛDó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uÈ  Extract month from underlying DateTime representation.

        Returns the month number starting from 1. The return value ranges from 1 to 12.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 6, 1),
            ...         datetime(2024, 12, 13),
            ...         datetime(2065, 1, 1),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.year().alias("year"),
            ...         nw.col("datetime").dt.month().alias("month"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                datetime  year  month
            0 1978-06-01  1978      6
            1 2024-12-13  2024     12
            2 2065-01-01  2065      1
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime            â”† year â”† month â”‚
            â”‚ ---                 â”† ---  â”† ---   â”‚
            â”‚ datetime[Î¼s]        â”† i32  â”† i8    â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ 1978-06-01 00:00:00 â”† 1978 â”† 6     â”‚
            â”‚ 2024-12-13 00:00:00 â”† 2024 â”† 12    â”‚
            â”‚ 2065-01-01 00:00:00 â”† 2065 â”† 1     â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úmonthr*   s    €r   r,   z-ExprDateTimeNamespace.month.<locals>.<lambda>„  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×CÑCÓE€ r   rŸ  r/   s   `r   rì  zExprDateTimeNamespace.monthO  s    ø€ ðh z‰z×#Ñ#ÛEó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u­	  Extract day from underlying DateTime representation.

        Returns the day of month starting from 1. The return value ranges from 1 to 31. (The last day of month differs by months.)

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 6, 1),
            ...         datetime(2024, 12, 13),
            ...         datetime(2065, 1, 1),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.year().alias("year"),
            ...         nw.col("datetime").dt.month().alias("month"),
            ...         nw.col("datetime").dt.day().alias("day"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                datetime  year  month  day
            0 1978-06-01  1978      6    1
            1 2024-12-13  2024     12   13
            2 2065-01-01  2065      1    1
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 4)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
            â”‚ datetime            â”† year â”† month â”† day â”‚
            â”‚ ---                 â”† ---  â”† ---   â”† --- â”‚
            â”‚ datetime[Î¼s]        â”† i32  â”† i8    â”† i8  â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
            â”‚ 1978-06-01 00:00:00 â”† 1978 â”† 6     â”† 1   â”‚
            â”‚ 2024-12-13 00:00:00 â”† 2024 â”† 12    â”† 13  â”‚
            â”‚ 2065-01-01 00:00:00 â”† 2065 â”† 1     â”† 1   â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Údayr*   s    €r   r,   z+ExprDateTimeNamespace.day.<locals>.<lambda>½  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×AÑAÓC€ r   rŸ  r/   s   `r   rï  zExprDateTimeNamespace.day‡  s    ø€ ðj z‰z×#Ñ#ÛCó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uä  Extract hour from underlying DateTime representation.

        Returns the hour number from 0 to 23.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 1, 1, 1),
            ...         datetime(2024, 10, 13, 5),
            ...         datetime(2065, 1, 1, 10),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.hour().alias("hour")
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                         datetime  hour
            0 1978-01-01 01:00:00     1
            1 2024-10-13 05:00:00     5
            2 2065-01-01 10:00:00    10
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime            â”† hour â”‚
            â”‚ ---                 â”† ---  â”‚
            â”‚ datetime[Î¼s]        â”† i8   â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
            â”‚ 1978-01-01 01:00:00 â”† 1    â”‚
            â”‚ 2024-10-13 05:00:00 â”† 5    â”‚
            â”‚ 2065-01-01 10:00:00 â”† 10   â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úhourr*   s    €r   r,   z,ExprDateTimeNamespace.hour.<locals>.<lambda>ô  rå  r   rŸ  r/   s   `r   rò  zExprDateTimeNamespace.hourÀ  ré  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uð  Extract minutes from underlying DateTime representation.

        Returns the minute number from 0 to 59.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 1, 1, 1, 1),
            ...         datetime(2024, 10, 13, 5, 30),
            ...         datetime(2065, 1, 1, 10, 20),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.hour().alias("hour"),
            ...         nw.col("datetime").dt.minute().alias("minute"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                         datetime  hour  minute
            0 1978-01-01 01:01:00     1       1
            1 2024-10-13 05:30:00     5      30
            2 2065-01-01 10:20:00    10      20
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime            â”† hour â”† minute â”‚
            â”‚ ---                 â”† ---  â”† ---    â”‚
            â”‚ datetime[Î¼s]        â”† i8   â”† i8     â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•¡
            â”‚ 1978-01-01 01:01:00 â”† 1    â”† 1      â”‚
            â”‚ 2024-10-13 05:30:00 â”† 5    â”† 30     â”‚
            â”‚ 2065-01-01 10:20:00 â”† 10   â”† 20     â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úminuter*   s    €r   r,   z.ExprDateTimeNamespace.minute.<locals>.<lambda>,  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×DÑDÓF€ r   rŸ  r/   s   `r   rõ  zExprDateTimeNamespace.minute÷  s    ø€ ðh z‰z×#Ñ#ÛFó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uÅ	  Extract seconds from underlying DateTime representation.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 1, 1, 1, 1, 1),
            ...         datetime(2024, 10, 13, 5, 30, 14),
            ...         datetime(2065, 1, 1, 10, 20, 30),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.hour().alias("hour"),
            ...         nw.col("datetime").dt.minute().alias("minute"),
            ...         nw.col("datetime").dt.second().alias("second"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                         datetime  hour  minute  second
            0 1978-01-01 01:01:01     1       1       1
            1 2024-10-13 05:30:14     5      30      14
            2 2065-01-01 10:20:30    10      20      30
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 4)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime            â”† hour â”† minute â”† second â”‚
            â”‚ ---                 â”† ---  â”† ---    â”† ---    â”‚
            â”‚ datetime[Î¼s]        â”† i8   â”† i8     â”† i8     â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•¡
            â”‚ 1978-01-01 01:01:01 â”† 1    â”† 1      â”† 1      â”‚
            â”‚ 2024-10-13 05:30:14 â”† 5    â”† 30     â”† 14     â”‚
            â”‚ 2065-01-01 10:20:30 â”† 10   â”† 20     â”† 30     â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úsecondr*   s    €r   r,   z.ExprDateTimeNamespace.second.<locals>.<lambda>c  rö  r   rŸ  r/   s   `r   rù  zExprDateTimeNamespace.second/  s    ø€ ðf z‰z×#Ñ#ÛFó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uŒ  Extract milliseconds from underlying DateTime representation.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 1, 1, 1, 1, 1, 0),
            ...         datetime(2024, 10, 13, 5, 30, 14, 505000),
            ...         datetime(2065, 1, 1, 10, 20, 30, 67000),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.hour().alias("hour"),
            ...         nw.col("datetime").dt.minute().alias("minute"),
            ...         nw.col("datetime").dt.second().alias("second"),
            ...         nw.col("datetime").dt.millisecond().alias("millisecond"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                             datetime  hour  minute  second  millisecond
            0 1978-01-01 01:01:01.000     1       1       1            0
            1 2024-10-13 05:30:14.505     5      30      14          505
            2 2065-01-01 10:20:30.067    10      20      30           67
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 5)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime                â”† hour â”† minute â”† second â”† millisecond â”‚
            â”‚ ---                     â”† ---  â”† ---    â”† ---    â”† ---         â”‚
            â”‚ datetime[Î¼s]            â”† i8   â”† i8     â”† i8     â”† i32         â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1978-01-01 01:01:01     â”† 1    â”† 1      â”† 1      â”† 0           â”‚
            â”‚ 2024-10-13 05:30:14.505 â”† 5    â”† 30     â”† 14     â”† 505         â”‚
            â”‚ 2065-01-01 10:20:30.067 â”† 10   â”† 20     â”† 30     â”† 67          â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úmillisecondr*   s    €r   r,   z3ExprDateTimeNamespace.millisecond.<locals>.<lambda>›  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×IÑIÓK€ r   rŸ  r/   s   `r   rü  z!ExprDateTimeNamespace.millisecondf  ó    ø€ ðh z‰z×#Ñ#ÛKó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uŒ  Extract microseconds from underlying DateTime representation.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 1, 1, 1, 1, 1, 0),
            ...         datetime(2024, 10, 13, 5, 30, 14, 505000),
            ...         datetime(2065, 1, 1, 10, 20, 30, 67000),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.hour().alias("hour"),
            ...         nw.col("datetime").dt.minute().alias("minute"),
            ...         nw.col("datetime").dt.second().alias("second"),
            ...         nw.col("datetime").dt.microsecond().alias("microsecond"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                             datetime  hour  minute  second  microsecond
            0 1978-01-01 01:01:01.000     1       1       1            0
            1 2024-10-13 05:30:14.505     5      30      14       505000
            2 2065-01-01 10:20:30.067    10      20      30        67000
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 5)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime                â”† hour â”† minute â”† second â”† microsecond â”‚
            â”‚ ---                     â”† ---  â”† ---    â”† ---    â”† ---         â”‚
            â”‚ datetime[Î¼s]            â”† i8   â”† i8     â”† i8     â”† i32         â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1978-01-01 01:01:01     â”† 1    â”† 1      â”† 1      â”† 0           â”‚
            â”‚ 2024-10-13 05:30:14.505 â”† 5    â”† 30     â”† 14     â”† 505000      â”‚
            â”‚ 2065-01-01 10:20:30.067 â”† 10   â”† 20     â”† 30     â”† 67000       â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úmicrosecondr*   s    €r   r,   z3ExprDateTimeNamespace.microsecond.<locals>.<lambda>Ó  rý  r   rŸ  r/   s   `r   r  z!ExprDateTimeNamespace.microsecondž  rþ  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uv  Extract Nanoseconds from underlying DateTime representation.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "datetime": [
            ...         datetime(1978, 1, 1, 1, 1, 1, 0),
            ...         datetime(2024, 10, 13, 5, 30, 14, 500000),
            ...         datetime(2065, 1, 1, 10, 20, 30, 60000),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("datetime").dt.hour().alias("hour"),
            ...         nw.col("datetime").dt.minute().alias("minute"),
            ...         nw.col("datetime").dt.second().alias("second"),
            ...         nw.col("datetime").dt.nanosecond().alias("nanosecond"),
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                             datetime  hour  minute  second  nanosecond
            0 1978-01-01 01:01:01.000     1       1       1           0
            1 2024-10-13 05:30:14.500     5      30      14   500000000
            2 2065-01-01 10:20:30.060    10      20      30    60000000
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 5)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ datetime                â”† hour â”† minute â”† second â”† nanosecond â”‚
            â”‚ ---                     â”† ---  â”† ---    â”† ---    â”† ---        â”‚
            â”‚ datetime[Î¼s]            â”† i8   â”† i8     â”† i8     â”† i32        â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1978-01-01 01:01:01     â”† 1    â”† 1      â”† 1      â”† 0          â”‚
            â”‚ 2024-10-13 05:30:14.500 â”† 5    â”† 30     â”† 14     â”† 500000000  â”‚
            â”‚ 2065-01-01 10:20:30.060 â”† 10   â”† 20     â”† 30     â”† 60000000   â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Ú
nanosecondr*   s    €r   r,   z2ExprDateTimeNamespace.nanosecond.<locals>.<lambda>  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×HÑHÓJ€ r   rŸ  r/   s   `r   r  z ExprDateTimeNamespace.nanosecondÖ  s    ø€ ðh z‰z×#Ñ#ÛJó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u  Get ordinal day.

        Returns:
            A new expression.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import datetime
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [datetime(2020, 1, 1), datetime(2020, 8, 3)]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_ordinal_day=nw.col("a").dt.ordinal_day()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                       a  a_ordinal_day
            0 2020-01-01              1
            1 2020-08-03            216
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a                   â”† a_ordinal_day â”‚
            â”‚ ---                 â”† ---           â”‚
            â”‚ datetime[Î¼s]        â”† i16           â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2020-01-01 00:00:00 â”† 1             â”‚
            â”‚ 2020-08-03 00:00:00 â”† 216           â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Úordinal_dayr*   s    €r   r,   z3ExprDateTimeNamespace.ordinal_day.<locals>.<lambda>8  rý  r   rŸ  r/   s   `r   r  z!ExprDateTimeNamespace.ordinal_day  s    ø€ ðR z‰z×#Ñ#ÛKó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uæ  Get total minutes.

        Returns:
            A new expression.

        Notes:
            The function outputs the total minutes in the int dtype by default,
            however, pandas may change the dtype to float when there are missing values,
            consider using `fill_null()` and `cast` in this case.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import timedelta
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [timedelta(minutes=10), timedelta(minutes=20, seconds=40)]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_total_minutes=nw.col("a").dt.total_minutes()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                            a  a_total_minutes
            0 0 days 00:10:00               10
            1 0 days 00:20:40               20
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a            â”† a_total_minutes â”‚
            â”‚ ---          â”† ---             â”‚
            â”‚ duration[Î¼s] â”† i64             â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 10m          â”† 10              â”‚
            â”‚ 20m 40s      â”† 20              â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Útotal_minutesr*   s    €r   r,   z5ExprDateTimeNamespace.total_minutes.<locals>.<lambda>j  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×KÑKÓM€ r   rŸ  r/   s   `r   r
  z#ExprDateTimeNamespace.total_minutes;  ó    ø€ ð\ z‰z×#Ñ#ÛMó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u   Get total seconds.

        Returns:
            A new expression.

        Notes:
            The function outputs the total seconds in the int dtype by default,
            however, pandas may change the dtype to float when there are missing values,
            consider using `fill_null()` and `cast` in this case.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import timedelta
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {"a": [timedelta(seconds=10), timedelta(seconds=20, milliseconds=40)]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_total_seconds=nw.col("a").dt.total_seconds()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                                   a  a_total_seconds
            0        0 days 00:00:10               10
            1 0 days 00:00:20.040000               20
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a            â”† a_total_seconds â”‚
            â”‚ ---          â”† ---             â”‚
            â”‚ duration[Î¼s] â”† i64             â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 10s          â”† 10              â”‚
            â”‚ 20s 40ms     â”† 20              â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Útotal_secondsr*   s    €r   r,   z5ExprDateTimeNamespace.total_seconds.<locals>.<lambda>œ  r  r   rŸ  r/   s   `r   r  z#ExprDateTimeNamespace.total_secondsm  r  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uá  Get total milliseconds.

        Returns:
            A new expression.

        Notes:
            The function outputs the total milliseconds in the int dtype by default,
            however, pandas may change the dtype to float when there are missing values,
            consider using `fill_null()` and `cast` in this case.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import timedelta
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "a": [
            ...         timedelta(milliseconds=10),
            ...         timedelta(milliseconds=20, microseconds=40),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_total_milliseconds=nw.col("a").dt.total_milliseconds()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                                   a  a_total_milliseconds
            0 0 days 00:00:00.010000                    10
            1 0 days 00:00:00.020040                    20
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a            â”† a_total_milliseconds â”‚
            â”‚ ---          â”† ---                  â”‚
            â”‚ duration[Î¼s] â”† i64                  â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 10ms         â”† 10                   â”‚
            â”‚ 20040Âµs      â”† 20                   â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Útotal_millisecondsr*   s    €r   r,   z:ExprDateTimeNamespace.total_milliseconds.<locals>.<lambda>Ó  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×PÑPÓR€ r   rŸ  r/   s   `r   r  z(ExprDateTimeNamespace.total_millisecondsŸ  ó    ø€ ðf z‰z×#Ñ#ÛRó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uâ  Get total microseconds.

        Returns:
            A new expression.

        Notes:
            The function outputs the total microseconds in the int dtype by default,
            however, pandas may change the dtype to float when there are missing values,
            consider using `fill_null()` and `cast` in this case.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import timedelta
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = {
            ...     "a": [
            ...         timedelta(microseconds=10),
            ...         timedelta(milliseconds=1, microseconds=200),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_total_microseconds=nw.col("a").dt.total_microseconds()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                                   a  a_total_microseconds
            0 0 days 00:00:00.000010                    10
            1 0 days 00:00:00.001200                  1200
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a            â”† a_total_microseconds â”‚
            â”‚ ---          â”† ---                  â”‚
            â”‚ duration[Î¼s] â”† i64                  â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 10Âµs         â”† 10                   â”‚
            â”‚ 1200Âµs       â”† 1200                 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Útotal_microsecondsr*   s    €r   r,   z:ExprDateTimeNamespace.total_microseconds.<locals>.<lambda>
  r  r   rŸ  r/   s   `r   r  z(ExprDateTimeNamespace.total_microsecondsÖ  r  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )u1
  Get total nanoseconds.

        Returns:
            A new expression.

        Notes:
            The function outputs the total nanoseconds in the int dtype by default,
            however, pandas may change the dtype to float when there are missing values,
            consider using `fill_null()` and `cast` in this case.

        Examples:
            >>> import pandas as pd
            >>> import polars as pl
            >>> from datetime import timedelta
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = ["2024-01-01 00:00:00.000000001", "2024-01-01 00:00:00.000000002"]
            >>> df_pd = pd.DataFrame({"a": pd.to_datetime(data)})
            >>> df_pl = pl.DataFrame({"a": data}).with_columns(
            ...     pl.col("a").str.to_datetime(time_unit="ns")
            ... )

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         a_diff_total_nanoseconds=nw.col("a").diff().dt.total_nanoseconds()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                                          a  a_diff_total_nanoseconds
            0 2024-01-01 00:00:00.000000001                       NaN
            1 2024-01-01 00:00:00.000000002                       1.0
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a                             â”† a_diff_total_nanoseconds â”‚
            â”‚ ---                           â”† ---                      â”‚
            â”‚ datetime[ns]                  â”† i64                      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2024-01-01 00:00:00.000000001 â”† null                     â”‚
            â”‚ 2024-01-01 00:00:00.000000002 â”† 1                        â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rx  Útotal_nanosecondsr*   s    €r   r,   z9ExprDateTimeNamespace.total_nanoseconds.<locals>.<lambda>>  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×OÑOÓQ€ r   rŸ  r/   s   `r   r  z'ExprDateTimeNamespace.total_nanoseconds  s    ø€ ð` z‰z×#Ñ#ÛQó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )uÌ  Convert a Date/Time/Datetime column into a String column with the given format.

        Arguments:
            format: Format to format temporal column with.

        Returns:
            A new expression.

        Notes:
            Unfortunately, different libraries interpret format directives a bit
            differently.

            - Chrono, the library used by Polars, uses `"%.f"` for fractional seconds,
              whereas pandas and Python stdlib use `".%f"`.
            - PyArrow interprets `"%S"` as "seconds, including fractional seconds"
              whereas most other tools interpret it as "just seconds, as 2 digits".

            Therefore, we make the following adjustments:

            - for pandas-like libraries, we replace `"%S.%f"` with `"%S%.f"`.
            - for PyArrow, we replace `"%S.%f"` with `"%S"`.

            Workarounds like these don't make us happy, and we try to avoid them as
            much as possible, but here we feel like it's the best compromise.

            If you just want to format a date/datetime Series as a local datetime
            string, and have it work as consistently as possible across libraries,
            we suggest using:

            - `"%Y-%m-%dT%H:%M:%S%.f"` for datetimes
            - `"%Y-%m-%d"` for dates

            though note that, even then, different tools may return a different number
            of trailing zeros. Nonetheless, this is probably consistent enough for
            most applications.

            If you have an application where this is not enough, please open an issue
            and let us know.

        Examples:
            >>> from datetime import datetime
            >>> import pandas as pd
            >>> import polars as pl
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> data = [
            ...     datetime(2020, 3, 1),
            ...     datetime(2020, 4, 1),
            ...     datetime(2020, 5, 1),
            ... ]
            >>> df_pd = pd.DataFrame({"a": data})
            >>> df_pl = pl.DataFrame({"a": data})

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").dt.to_string("%Y/%m/%d %H:%M:%S")
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd)
                                 a
            0  2020/03/01 00:00:00
            1  2020/04/01 00:00:00
            2  2020/05/01 00:00:00

            >>> my_library_agnostic_function(df_pl)
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a                   â”‚
            â”‚ ---                 â”‚
            â”‚ str                 â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2020/03/01 00:00:00 â”‚
            â”‚ 2020/04/01 00:00:00 â”‚
            â”‚ 2020/05/01 00:00:00 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   rx  Ú	to_stringrÓ  s    €€r   r,   z1ExprDateTimeNamespace.to_string.<locals>.<lambda>”  s'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×GÑGÈÓO€ r   rŸ  rÔ  s   ``r   r  zExprDateTimeNamespace.to_stringA  s    ù€ ðd z‰z×#Ñ#ÜOó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆ ˆfd„«      S )u¼  Replace time zone.

        Arguments:
            time_zone: Target time zone.

        Returns:
            A new expression.

        Examples:
            >>> from datetime import datetime, timezone
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {
            ...     "a": [
            ...         datetime(2024, 1, 1, tzinfo=timezone.utc),
            ...         datetime(2024, 1, 2, tzinfo=timezone.utc),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").dt.replace_time_zone("Asia/Kathmandu")
            ...     ).to_native()

            We can then pass pandas / PyArrow / Polars / any other supported library:

            >>> my_library_agnostic_function(df_pd)
                                      a
            0 2024-01-01 00:00:00+05:45
            1 2024-01-02 00:00:00+05:45
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a                            â”‚
            â”‚ ---                          â”‚
            â”‚ datetime[Î¼s, Asia/Kathmandu] â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2024-01-01 00:00:00 +0545    â”‚
            â”‚ 2024-01-02 00:00:00 +0545    â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: timestamp[us, tz=Asia/Kathmandu]
            ----
            a: [[2023-12-31 18:15:00.000000Z,2024-01-01 18:15:00.000000Z]]
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   rx  Úreplace_time_zone©r+   r#   Ú	time_zones    €€r   r,   z9ExprDateTimeNamespace.replace_time_zone.<locals>.<lambda>Ð  ó(   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×OÑOÐPYÓZ€ r   rŸ  )r#   r"  s   ``r   r   z'ExprDateTimeNamespace.replace_time_zone—  s    ù€ ðp z‰z×#Ñ#ÜZó
ð 	
r   c                ób   ‡ ‡— ‰€d}t        |«      ‚‰ j                  j                  ˆ ˆfd„«      S )u6	  Convert to a new time zone.

        If converting from a time-zone-naive column, then conversion happens
        as if converting from UTC.

        Arguments:
            time_zone: Target time zone.

        Returns:
            A new expression.

        Examples:
            >>> from datetime import datetime, timezone
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {
            ...     "a": [
            ...         datetime(2024, 1, 1, tzinfo=timezone.utc),
            ...         datetime(2024, 1, 2, tzinfo=timezone.utc),
            ...     ]
            ... }
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("a").dt.convert_time_zone("Asia/Kathmandu")
            ...     ).to_native()

            We can then pass pandas / PyArrow / Polars / any other supported library:

            >>> my_library_agnostic_function(df_pd)
                                      a
            0 2024-01-01 05:45:00+05:45
            1 2024-01-02 05:45:00+05:45
            >>> my_library_agnostic_function(df_pl)
            shape: (2, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a                            â”‚
            â”‚ ---                          â”‚
            â”‚ datetime[Î¼s, Asia/Kathmandu] â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2024-01-01 05:45:00 +0545    â”‚
            â”‚ 2024-01-02 05:45:00 +0545    â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            a: timestamp[us, tz=Asia/Kathmandu]
            ----
            a: [[2024-01-01 00:00:00.000000Z,2024-01-02 00:00:00.000000Z]]
        z…Target `time_zone` cannot be `None` in `convert_time_zone`. Please use `replace_time_zone(None)` if you want to remove the time zone.c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   rx  Úconvert_time_zoner!  s    €€r   r,   z9ExprDateTimeNamespace.convert_time_zone.<locals>.<lambda>  r#  r   )rð   r™  r.   )r#   r"  rô   s   `` r   r&  z'ExprDateTimeNamespace.convert_time_zoneÓ  s8   ù€ ðv Ðð ZˆCÜ˜C“.Ð Øz‰z×#Ñ#ÜZó
ð 	
r   c                ón   ‡ ‡— ‰dvrd‰›d}t        |«      ‚‰ j                  j                  ˆ ˆfd„«      S )uÖ
  Return a timestamp in the given time unit.

        Arguments:
            time_unit: {'ns', 'us', 'ms'}
                Time unit.

        Returns:
            A new expression.

        Examples:
            >>> from datetime import date
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"date": [date(2001, 1, 1), None, date(2001, 1, 3)]}
            >>> df_pd = pd.DataFrame(data, dtype="datetime64[ns]")
            >>> df_pl = pl.DataFrame(data)
            >>> df_pa = pa.table(data)

            Let's define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(
            ...         nw.col("date").dt.timestamp().alias("timestamp_us"),
            ...         nw.col("date").dt.timestamp("ms").alias("timestamp_ms"),
            ...     ).to_native()

            We can then pass pandas / PyArrow / Polars / any other supported library:

            >>> my_library_agnostic_function(df_pd)
                    date  timestamp_us  timestamp_ms
            0 2001-01-01  9.783072e+14  9.783072e+11
            1        NaT           NaN           NaN
            2 2001-01-03  9.784800e+14  9.784800e+11
            >>> my_library_agnostic_function(df_pl)
            shape: (3, 3)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ date       â”† timestamp_us    â”† timestamp_ms â”‚
            â”‚ ---        â”† ---             â”† ---          â”‚
            â”‚ date       â”† i64             â”† i64          â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 2001-01-01 â”† 978307200000000 â”† 978307200000 â”‚
            â”‚ null       â”† null            â”† null         â”‚
            â”‚ 2001-01-03 â”† 978480000000000 â”† 978480000000 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
            >>> my_library_agnostic_function(df_pa)
            pyarrow.Table
            date: date32[day]
            timestamp_us: int64
            timestamp_ms: int64
            ----
            date: [[2001-01-01,null,2001-01-03]]
            timestamp_us: [[978307200000000,null,978480000000000]]
            timestamp_ms: [[978307200000,null,978480000000]]
        >   ÚmsÚnsÚusz=invalid `time_unit`

Expected one of {'ns', 'us', 'ms'}, got ú.c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   rx  Ú	timestamp)r+   r#   Ú	time_units    €€r   r,   z1ExprDateTimeNamespace.timestamp.<locals>.<lambda>W  s'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×=Ñ=×GÑGÈ	ÓR€ r   )r  r™  r.   )r#   r.  rô   s   `` r   r-  zExprDateTimeNamespace.timestamp  sM   ù€ ðv Ð.Ñ.ðAØAJÀÈQðPð ô ˜S“/Ð!Øz‰z×#Ñ#ÜRó
ð 	
r   Nr   r¡  )r#   r   rÑ  r  r  r”  )r#   r   r"  rÜ  r  r”  )r#   r   r"  r  r  r”  )r*  )r#   r   r.  zLiteral['ns', 'us', 'ms']r  r”  )r  r‘  r’  r%   rä  rè  rì  rï  rò  rõ  rù  rü  r  r  r  r
  r  r  r  r  r  r   r&  r-  r6   r   r   rw  rw  å  s   „ óó-
ó^5
ón6
óp7
ór5
ón6
óp5
ón6
óp6
óp6
óp+
óZ0
ód0
ód5
ón5
ón2
óhT
ól:
óx@
õDC
r   rw  c                  óD   — e Zd Zd	d„Zd
d„Zdd„Zdd„Zdd„Zd
d„Zd
d„Z	y)r}  c                ó   — || _         y r"   r˜  rš  s     r   r%   zExprNameNamespace.__init__\  r›  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )a  Keep the original root name of the expression.

        Returns:
            A new expression.

        Notes:
            This will undo any previous renaming operations on the expression.
            Due to implementation constraints, this method can only be called as the last
            expression in a chain. Only one name operation per expression will work.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> data = {"foo": [1, 2], "BAR": [4, 5]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(
            ...         nw.col("foo").alias("alias_for_foo").name.keep()
            ...     ).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd).columns
            Index(['foo'], dtype='object')
            >>> my_library_agnostic_function(df_pl).columns
            ['foo']
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r4   Úkeepr*   s    €r   r,   z(ExprNameNamespace.keep.<locals>.<lambda>ƒ  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×?Ñ?×DÑDÓF€ r   rŸ  r/   s   `r   r3  zExprNameNamespace.keep_  s    ø€ ðF z‰z×#Ñ#ÛFó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )aŸ  Rename the output of an expression by mapping a function over the root name.

        Arguments:
            function: Function that maps a root name to a new name.

        Returns:
            A new expression.

        Notes:
            This will undo any previous renaming operations on the expression.
            Due to implementation constraints, this method can only be called as the last
            expression in a chain. Only one name operation per expression will work.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> data = {"foo": [1, 2], "BAR": [4, 5]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> renaming_func = lambda s: s[::-1]  # reverse column name
            >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("foo", "BAR").name.map(renaming_func)).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> my_library_agnostic_function(df_pd).columns
            Index(['oof', 'RAB'], dtype='object')
            >>> my_library_agnostic_function(df_pl).columns
            ['oof', 'RAB']
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   r4   Úmap)r+   r7   r#   s    €€r   r,   z'ExprNameNamespace.map.<locals>.<lambda>¬  s'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×?Ñ?×CÑCÀHÓM€ r   rŸ  )r#   r7   s   ``r   r6  zExprNameNamespace.map†  s    ù€ ðJ z‰z×#Ñ#ÜMó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆˆ fd„«      S )at  Add a prefix to the root column name of the expression.

        Arguments:
            prefix: Prefix to add to the root column name.

        Returns:
            A new expression.

        Notes:
            This will undo any previous renaming operations on the expression.
            Due to implementation constraints, this method can only be called as the last
            expression in a chain. Only one name operation per expression will work.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> data = {"foo": [1, 2], "BAR": [4, 5]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def add_colname_prefix(df_native: IntoFrameT, prefix: str) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("foo", "BAR").name.prefix(prefix)).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> add_colname_prefix(df_pd, "with_prefix_").columns
            Index(['with_prefix_foo', 'with_prefix_BAR'], dtype='object')

            >>> add_colname_prefix(df_pl, "with_prefix_").columns
            ['with_prefix_foo', 'with_prefix_BAR']
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   r4   rº  r¹  s    €€r   r,   z*ExprNameNamespace.prefix.<locals>.<lambda>Õ  ó'   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×?Ñ?×FÑFÀvÓN€ r   rŸ  r»  s   ``r   rº  zExprNameNamespace.prefix¯  s    ù€ ðJ z‰z×#Ñ#ÜNó
ð 	
r   c                óD   ‡ ‡— ‰ j                   j                  ˆ ˆfd„«      S )as  Add a suffix to the root column name of the expression.

        Arguments:
            suffix: Suffix to add to the root column name.

        Returns:
            A new expression.

        Notes:
            This will undo any previous renaming operations on the expression.
            Due to implementation constraints, this method can only be called as the last
            expression in a chain. Only one name operation per expression will work.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> data = {"foo": [1, 2], "BAR": [4, 5]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def add_colname_suffix(df_native: IntoFrameT, suffix: str) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("foo", "BAR").name.suffix(suffix)).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> add_colname_suffix(df_pd, "_with_suffix").columns
            Index(['foo_with_suffix', 'BAR_with_suffix'], dtype='object')
            >>> add_colname_suffix(df_pl, "_with_suffix").columns
            ['foo_with_suffix', 'BAR_with_suffix']
        c                ól   •— ‰j                   j                  | «      j                  j                  ‰«      S r"   )r™  r   r4   rÀ  r¿  s    €€r   r,   z*ExprNameNamespace.suffix.<locals>.<lambda>ý  r9  r   rŸ  rÁ  s   ``r   rÀ  zExprNameNamespace.suffixØ  s    ù€ ðH z‰z×#Ñ#ÜNó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )a–  Make the root column name lowercase.

        Returns:
            A new expression.

        Notes:
            This will undo any previous renaming operations on the expression.
            Due to implementation constraints, this method can only be called as the last
            expression in a chain. Only one name operation per expression will work.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> data = {"foo": [1, 2], "BAR": [4, 5]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def to_lower(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("foo", "BAR").name.to_lowercase()).to_native()

            We can then pass either pandas or Polars to `func`:

            >>> to_lower(df_pd).columns
            Index(['foo', 'bar'], dtype='object')
            >>> to_lower(df_pl).columns
            ['foo', 'bar']
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r4   rÛ  r*   s    €r   r,   z0ExprNameNamespace.to_lowercase.<locals>.<lambda>"  ó%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×?Ñ?×LÑLÓN€ r   rŸ  r/   s   `r   rÛ  zExprNameNamespace.to_lowercase   s    ø€ ðB z‰z×#Ñ#ÛNó
ð 	
r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )a•  Make the root column name uppercase.

        Returns:
            A new expression.

        Notes:
            This will undo any previous renaming operations on the expression.
            Due to implementation constraints, this method can only be called as the last
            expression in a chain. Only one name operation per expression will work.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> data = {"foo": [1, 2], "BAR": [4, 5]}
            >>> df_pd = pd.DataFrame(data)
            >>> df_pl = pl.DataFrame(data)

            We define a dataframe-agnostic function:

            >>> def to_upper(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.select(nw.col("foo", "BAR").name.to_uppercase()).to_native()

            We can then pass either pandas or Polars to `func`:
            >>> to_upper(df_pd).columns
            Index(['FOO', 'BAR'], dtype='object')
            >>> to_upper(df_pl).columns
            ['FOO', 'BAR']
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   r4   r×  r*   s    €r   r,   z0ExprNameNamespace.to_uppercase.<locals>.<lambda>F  r>  r   rŸ  r/   s   `r   r×  zExprNameNamespace.to_uppercase%  s    ø€ ð@ z‰z×#Ñ#ÛNó
ð 	
r   Nr   r¡  )r#   r   r7   zCallable[[str], str]r  r”  rÝ  rÞ  )
r  r‘  r’  r%   r3  r6  rº  rÀ  rÛ  r×  r6   r   r   r}  r}  [  s*   „ óó%
óN'
óR'
óR&
óP#
ôJ"
r   r}  c                  ó   — e Zd Zdd„Zdd„Zy)r€  c                ó   — || _         y r"   r˜  rš  s     r   r%   zExprListNamespace.__init__K  r›  r   c                ó@   ‡ — ‰ j                   j                  ˆ fd„«      S )uð  Return the number of elements in each list.

        Null values count towards the total.

        Returns:
            A new expression.

        Examples:
            >>> import narwhals as nw
            >>> from narwhals.typing import IntoFrameT
            >>> import pandas as pd
            >>> import polars as pl
            >>> import pyarrow as pa
            >>> data = {"a": [[1, 2], [3, 4, None], None, []]}

            Let's define a dataframe-agnostic function:

            >>> def agnostic_list_len(df_native: IntoFrameT) -> IntoFrameT:
            ...     df = nw.from_native(df_native)
            ...     return df.with_columns(a_len=nw.col("a").list.len()).to_native()

            We can then pass pandas / PyArrow / Polars / any other supported library:

            >>> agnostic_list_len(
            ...     pd.DataFrame(data).astype({"a": pd.ArrowDtype(pa.list_(pa.int64()))})
            ... )  # doctest: +SKIP
                           a  a_len
            0        [1. 2.]      2
            1  [ 3.  4. nan]      3
            2           <NA>   <NA>
            3             []      0

            >>> agnostic_list_len(pl.DataFrame(data))
            shape: (4, 2)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a            â”† a_len â”‚
            â”‚ ---          â”† ---   â”‚
            â”‚ list[i64]    â”† u32   â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
            â”‚ [1, 2]       â”† 2     â”‚
            â”‚ [3, 4, null] â”† 3     â”‚
            â”‚ null         â”† null  â”‚
            â”‚ []           â”† 0     â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜

            >>> agnostic_list_len(pa.table(data))
            pyarrow.Table
            a: list<item: int64>
              child 0, item: int64
            a_len: uint32
            ----
            a: [[[1,2],[3,4,null],null,[]]]
            a_len: [[2,3,null,0]]
        c                ój   •— ‰j                   j                  | «      j                  j                  «       S r"   )r™  r   rñ   rK  r*   s    €r   r,   z'ExprListNamespace.len.<locals>.<lambda>†  s%   ø€ ˜Ÿ
™
×5Ñ5°cÓ:×?Ñ?×CÑCÓE€ r   rŸ  r/   s   `r   rK  zExprListNamespace.lenN  s    ø€ ðn z‰z×#Ñ#ÛEó
ð 	
r   Nr   r¡  )r  r‘  r’  r%   rK  r6   r   r   r€  r€  J  s   „ óô9
r   r€  c                 ó&   ‡ — dˆ fd„}t        |«      S )us  Creates an expression that references one or more columns by their name(s).

    Arguments:
        names: Name(s) of the columns to use in the aggregation function.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pl = pl.DataFrame({"a": [1, 2], "b": [3, 4]})
        >>> df_pd = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
        >>> df_pa = pa.table({"a": [1, 2], "b": [3, 4]})

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.col("a") * nw.col("b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a
        0  3
        1  8
        >>> my_library_agnostic_function(df_pl)
        shape: (2, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 3   â”‚
        â”‚ 8   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        ----
        a: [[3,8]]
    c                ó4   •—  | j                   t        ‰«      Ž S r"   )Úcolr   )r+   Únamess    €r   Úfunczcol.<locals>.funcº  s   ø€ Øˆsw‰wœ ›Ð'Ð'r   ©r+   r   r  r   ©r   )rH  rI  s   ` r   rG  rG  Š  s   ø€ õ`(ô ‹:Ðr   c                 ó&   ‡ — dˆ fd„}t        |«      S )uÞ  Creates an expression that references one or more columns by their index(es).

    Notes:
        `nth` is not supported for Polars version<1.0.0. Please use [`col`](/api-reference/narwhals/#narwhals.col) instead.

    Arguments:
        indices: One or more indices representing the columns to retrieve.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> data = {"a": [1, 2], "b": [3, 4]}
        >>> df_pl = pl.DataFrame(data)
        >>> df_pd = pd.DataFrame(data)
        >>> df_pa = pa.table(data)

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.nth(0) * 2).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a
        0  2
        1  4
        >>> my_library_agnostic_function(df_pl)
        shape: (2, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 2   â”‚
        â”‚ 4   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        ----
        a: [[2,4]]
    c                ó4   •—  | j                   t        ‰«      Ž S r"   )Únthr   )r+   Úindicess    €r   rI  znth.<locals>.funcô  s   ø€ Øˆsw‰wœ Ó(Ð)Ð)r   rJ  rK  )rO  rI  s   ` r   rN  rN  À  s   ø€ õh*ô ‹:Ðr   c                 ó   — t        d„ «      S )uÊ  Instantiate an expression representing all columns.

    Returns:
        A new expression.

    Examples:
        >>> import polars as pl
        >>> import pandas as pd
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pd = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
        >>> df_pl = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
        >>> df_pa = pa.table({"a": [1, 2, 3], "b": [4, 5, 6]})

        Let's define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.all() * 2).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a   b
        0  2   8
        1  4  10
        2  6  12
        >>> my_library_agnostic_function(df_pl)
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
        â”‚ a   â”† b   â”‚
        â”‚ --- â”† --- â”‚
        â”‚ i64 â”† i64 â”‚
        â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•¡
        â”‚ 2   â”† 8   â”‚
        â”‚ 4   â”† 10  â”‚
        â”‚ 6   â”† 12  â”‚
        â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        b: int64
        ----
        a: [[2,4,6]]
        b: [[8,10,12]]
    c                ó"   — | j                  «       S r"   )rš   ©r+   s    r   r,   zall_.<locals>.<lambda>+  s   € ˜CŸG™G›I€ r   rK  r6   r   r   Úall_rS  û  s   € ô` Ñ%Ó&Ð&r   c                 ó    — dd„} t        | «      S )uÂ  Return the number of rows.

    Returns:
        A new expression.

    Examples:
        >>> import polars as pl
        >>> import pandas as pd
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pd = pd.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> df_pl = pl.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> df_pa = pa.table({"a": [1, 2], "b": [5, 10]})

        Let's define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.len()).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           len
        0    2
        >>> my_library_agnostic_function(df_pl)
        shape: (1, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ len â”‚
        â”‚ --- â”‚
        â”‚ u32 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 2   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        len: int64
        ----
        len: [[2]]
    c                ó"   — | j                  «       S r"   )rK  rR  s    r   rI  zlen_.<locals>.funcZ  s   € Øw‰w‹yÐr   rJ  rK  )rI  s    r   Úlen_rV  /  s   € óVô ‹:Ðr   c                 ó    ‡ — t        ˆ fd„«      S )u!  Sum all values.

    Note:
        Syntactic sugar for ``nw.col(columns).sum()``

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pl = pl.DataFrame({"a": [1, 2]})
        >>> df_pd = pd.DataFrame({"a": [1, 2]})
        >>> df_pa = pa.table({"a": [1, 2]})

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.sum("a")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a
        0  3
        >>> my_library_agnostic_function(df_pl)
        shape: (1, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 3   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        ----
        a: [[3]]
    c                ó"   •—  | j                   ‰Ž S r"   )r)   ©r+   Úcolumnss    €r   r,   zsum.<locals>.<lambda>  ó   ø€ ˜G˜CŸG™G WÐ-€ r   rK  ©rZ  s   `r   r)   r)   `  ó   ø€ ô` Ó-Ó.Ð.r   c                 ó    ‡ — t        ˆ fd„«      S )u5  Get the mean value.

    Note:
        Syntactic sugar for ``nw.col(columns).mean()``

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pl = pl.DataFrame({"a": [1, 8, 3]})
        >>> df_pd = pd.DataFrame({"a": [1, 8, 3]})
        >>> df_pa = pa.table({"a": [1, 8, 3]})

        We define a dataframe agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.mean("a")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
             a
        0  4.0
        >>> my_library_agnostic_function(df_pl)
        shape: (1, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ f64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 4.0 â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: double
        ----
        a: [[4]]
    c                ó"   •—  | j                   ‰Ž S r"   )r©   rY  s    €r   r,   zmean.<locals>.<lambda>Ã  s   ø€ ˜H˜CŸH™H gÐ.€ r   rK  r\  s   `r   r©   r©   “  s   ø€ ô` Ó.Ó/Ð/r   c                 ó    ‡ — t        ˆ fd„«      S )uÊ  Get the median value.

    Notes:
        - Syntactic sugar for ``nw.col(columns).median()``
        - Results might slightly differ across backends due to differences in the underlying algorithms used to compute the median.

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pd = pd.DataFrame({"a": [4, 5, 2]})
        >>> df_pl = pl.DataFrame({"a": [4, 5, 2]})
        >>> df_pa = pa.table({"a": [4, 5, 2]})

        Let's define a dataframe agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.median("a")).to_native()

        We can then pass any supported library such as pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
             a
        0  4.0
        >>> my_library_agnostic_function(df_pl)
        shape: (1, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ f64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 4.0 â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: double
        ----
        a: [[4]]
    c                ó"   •—  | j                   ‰Ž S r"   )r­   rY  s    €r   r,   zmedian.<locals>.<lambda>÷  s   ø€ ˜J˜CŸJ™J¨Ð0€ r   rK  r\  s   `r   r­   r­   Æ  s   ø€ ôb Ó0Ó1Ð1r   c                 ó    ‡ — t        ˆ fd„«      S )uY  Return the minimum value.

    Note:
       Syntactic sugar for ``nw.col(columns).min()``.

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function.

    Returns:
        A new expression.

    Examples:
        >>> import polars as pl
        >>> import pandas as pd
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pd = pd.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> df_pl = pl.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> df_pa = pa.table({"a": [1, 2], "b": [5, 10]})

        Let's define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.min("b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           b
        0  5
        >>> my_library_agnostic_function(df_pl)
        shape: (1, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ b   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 5   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        b: int64
        ----
        b: [[5]]
    c                ó"   •—  | j                   ‰Ž S r"   )r¾   rY  s    €r   r,   zmin.<locals>.<lambda>*  r[  r   rK  r\  s   `r   r¾   r¾   ú  r]  r   c                 ó    ‡ — t        ˆ fd„«      S )uY  Return the maximum value.

    Note:
       Syntactic sugar for ``nw.col(columns).max()``.

    Arguments:
        columns: Name(s) of the columns to use in the aggregation function.

    Returns:
        A new expression.

    Examples:
        >>> import polars as pl
        >>> import pandas as pd
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pd = pd.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> df_pl = pl.DataFrame({"a": [1, 2], "b": [5, 10]})
        >>> df_pa = pa.table({"a": [1, 2], "b": [5, 10]})

        Let's define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.max("a")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a
        0  2
        >>> my_library_agnostic_function(df_pl)
        shape: (1, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 2   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        ----
        a: [[2]]
    c                ó"   •—  | j                   ‰Ž S r"   )rÁ   rY  s    €r   r,   zmax.<locals>.<lambda>]  r[  r   rK  r\  s   `r   rÁ   rÁ   -  r]  r   c                 ó>   ‡ — ‰ sd}t        |«      ‚t        ˆ fd„«      S )uû  Sum all values horizontally across columns.

    Warning:
        Unlike Polars, we support horizontal sum over numeric columns only.

    Arguments:
        exprs: Name(s) of the columns to use in the aggregation function. Accepts
            expression input.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> data = {"a": [1, 2, 3], "b": [5, 10, None]}
        >>> df_pl = pl.DataFrame(data)
        >>> df_pd = pd.DataFrame(data)
        >>> df_pa = pa.table(data)

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.sum_horizontal("a", "b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
              a
        0   6.0
        1  12.0
        2   3.0
        >>> my_library_agnostic_function(df_pl)
        shape: (3, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 6   â”‚
        â”‚ 12  â”‚
        â”‚ 3   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        ----
        a: [[6,12,3]]
    z:At least one expression must be passed to `sum_horizontal`c           	     ón   •—  | j                   t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )Úsum_horizontalr   r   ©r+   ÚvÚexprss     €r   r,   z sum_horizontal.<locals>.<lambda>š  ó2   ø€ Ð&C×&Ñ&Ü18¸³Ö@¨AÔ  QÕ'Ò@ð
€ ùÚ@ó   ›2©r  r   ©rk  rô   s   ` r   rh  rh  `  s*   ø€ ñl ØJˆÜ˜‹oÐÜó	
óð r   c                 ó>   ‡ — ‰ sd}t        |«      ‚t        ˆ fd„«      S )u4  Get the minimum value horizontally across columns.

    Notes:
        We support `min_horizontal` over numeric columns only.

    Arguments:
        exprs: Name(s) of the columns to use in the aggregation function. Accepts
            expression input.

    Returns:
        A new expression.

    Examples:
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> data = {
        ...     "a": [1, 8, 3],
        ...     "b": [4, 5, None],
        ...     "c": ["x", "y", "z"],
        ... }

        We define a dataframe-agnostic function that computes the horizontal min of "a"
        and "b" columns:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.min_horizontal("a", "b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(pd.DataFrame(data))
             a
        0  1.0
        1  5.0
        2  3.0
        >>> my_library_agnostic_function(pl.DataFrame(data))
        shape: (3, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 1   â”‚
        â”‚ 5   â”‚
        â”‚ 3   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(pa.table(data))
        pyarrow.Table
        a: int64
        ----
        a: [[1,5,3]]
    z:At least one expression must be passed to `min_horizontal`c           	     ón   •—  | j                   t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )Úmin_horizontalr   r   ri  s     €r   r,   z min_horizontal.<locals>.<lambda>Ü  rl  rm  rn  ro  s   ` r   rr  rr     ó*   ø€ ñp ØJˆÜ˜‹oÐÜó	
óð r   c                 ó>   ‡ — ‰ sd}t        |«      ‚t        ˆ fd„«      S )u4  Get the maximum value horizontally across columns.

    Notes:
        We support `max_horizontal` over numeric columns only.

    Arguments:
        exprs: Name(s) of the columns to use in the aggregation function. Accepts
            expression input.

    Returns:
        A new expression.

    Examples:
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> data = {
        ...     "a": [1, 8, 3],
        ...     "b": [4, 5, None],
        ...     "c": ["x", "y", "z"],
        ... }

        We define a dataframe-agnostic function that computes the horizontal max of "a"
        and "b" columns:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.max_horizontal("a", "b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(pd.DataFrame(data))
             a
        0  4.0
        1  8.0
        2  3.0
        >>> my_library_agnostic_function(pl.DataFrame(data))
        shape: (3, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 4   â”‚
        â”‚ 8   â”‚
        â”‚ 3   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(pa.table(data))
        pyarrow.Table
        a: int64
        ----
        a: [[4,8,3]]
    z:At least one expression must be passed to `max_horizontal`c           	     ón   •—  | j                   t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )Úmax_horizontalr   r   ri  s     €r   r,   z max_horizontal.<locals>.<lambda>  rl  rm  rn  ro  s   ` r   rv  rv  â  rs  r   c                  ó$   — e Zd Zdd„Zdd„Zdd„Zy)ÚWhenc                ó&   — t        |g«      | _        y r"   )r   Ú_predicatesr  s     r   r%   zWhen.__init__%  s   € Ü" J <Ó0ˆÕr   c                óT   — | j                   D cg c]  }t        ||«      ‘Œ c}S c c}w r"   )rz  r   )r#   r+   rj  s      r   Ú_extract_predicateszWhen._extract_predicates(  s$   € Ø37×3CÑ3CÖD¨aÔ! # qÕ)ÒDÐDùÒDs   %c                ó$   ‡ ‡— t        ˆ ˆfd„«      S )Nc                ór   •—  | j                   ‰j                  | «      Ž j                  t        | ‰«      «      S r"   )Úwhenr|  Úthenr   ©r+   r#   r  s    €€r   r,   zWhen.then.<locals>.<lambda>-  s2   ø€ ˜˜Ÿ™ $×":Ñ":¸3Ó"?Ð@×EÑEÜ! # uÓ-ó€ r   )ÚThen©r#   r  s   ``r   r€  z	When.then+  ó   ù€ Üôó
ð 	
r   N)r  úIntoExpr | Iterable[IntoExpr]r  r‚  rJ  )r  r   r  r‚  )r  r‘  r’  r%   r|  r€  r6   r   r   rx  rx  $  s   „ ó1óEô
r   rx  c                  ó   — e Zd Zdd„Zy)r‚  c                ó$   ‡ ‡— t        ˆ ˆfd„«      S )Nc                óX   •— ‰j                  | «      j                  t        | ‰«      «      S r"   )r   Ú	otherwiser   r  s    €€r   r,   z Then.otherwise.<locals>.<lambda>6  s'   ø€ ˜×/Ñ/°Ó4×>Ñ>Ü! # uÓ-ó€ r   rK  rƒ  s   ``r   r‰  zThen.otherwise4  r„  r   N)r  r   r  r   )r  r‘  r’  r‰  r6   r   r   r‚  r‚  3  s   „ ô
r   r‚  c                 ó   — t        | Ž S )u¦
  Start a `when-then-otherwise` expression.

    Expression similar to an `if-else` statement in Python. Always initiated by a
    `pl.when(<condition>).then(<value if condition>)`, and optionally followed by
    chaining one or more `.when(<condition>).then(<value>)` statements.
    Chained when-then operations should be read as Python `if, elif, ... elif`
    blocks, not as `if, if, ... if`, i.e. the first condition that evaluates to
    `True` will be picked.
    If none of the conditions are `True`, an optional
    `.otherwise(<value if all statements are false>)` can be appended at the end.
    If not appended, and none of the conditions are `True`, `None` will be returned.

    Arguments:
        predicates: Condition(s) that must be met in order to apply the subsequent statement.
            Accepts one or more boolean expressions, which are implicitly combined with `&`.
            String input is parsed as a column name.

    Returns:
        A "when" object, which `.then` can be called on.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pl = pl.DataFrame({"a": [1, 2, 3], "b": [5, 10, 15]})
        >>> df_pd = pd.DataFrame({"a": [1, 2, 3], "b": [5, 10, 15]})
        >>> df_pa = pa.table({"a": [1, 2, 3], "b": [5, 10, 15]})

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.with_columns(
        ...         nw.when(nw.col("a") < 3).then(5).otherwise(6).alias("a_when")
        ...     ).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a   b  a_when
        0  1   5       5
        1  2  10       5
        2  3  15       6
        >>> my_library_agnostic_function(df_pl)
        shape: (3, 3)
        â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a   â”† b   â”† a_when â”‚
        â”‚ --- â”† --- â”† ---    â”‚
        â”‚ i64 â”† i64 â”† i32    â”‚
        â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•¡
        â”‚ 1   â”† 5   â”† 5      â”‚
        â”‚ 2   â”† 10  â”† 5      â”‚
        â”‚ 3   â”† 15  â”† 6      â”‚
        â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        b: int64
        a_when: int64
        ----
        a: [[1,2,3]]
        b: [[5,10,15]]
        a_when: [[5,5,6]]
    )rx  )r  s    r   r  r  <  s   € ôF ÐÐr   c                 ó>   ‡ — ‰ sd}t        |«      ‚t        ˆ fd„«      S )u	  Compute the bitwise AND horizontally across columns.

    Arguments:
        exprs: Name(s) of the columns to use in the aggregation function. Accepts expression input.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> data = {
        ...     "a": [False, False, True, True, False, None],
        ...     "b": [False, True, True, None, None, None],
        ... }
        >>> df_pl = pl.DataFrame(data)
        >>> df_pd = pd.DataFrame(data).convert_dtypes(dtype_backend="pyarrow")
        >>> df_pa = pa.table(data)

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select("a", "b", all=nw.all_horizontal("a", "b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
               a      b    all
        0  False  False  False
        1  False   True  False
        2   True   True   True
        3   True   <NA>   <NA>
        4  False   <NA>  False
        5   <NA>   <NA>   <NA>

        >>> my_library_agnostic_function(df_pl)
        shape: (6, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a     â”† b     â”† all   â”‚
        â”‚ ---   â”† ---   â”† ---   â”‚
        â”‚ bool  â”† bool  â”† bool  â”‚
        â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ false â”† false â”† false â”‚
        â”‚ false â”† true  â”† false â”‚
        â”‚ true  â”† true  â”† true  â”‚
        â”‚ true  â”† null  â”† null  â”‚
        â”‚ false â”† null  â”† false â”‚
        â”‚ null  â”† null  â”† null  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜

        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: bool
        b: bool
        all: bool
        ----
        a: [[false,false,true,true,false,null]]
        b: [[false,true,true,null,null,null]]
        all: [[false,false,true,null,false,null]]
    z:At least one expression must be passed to `all_horizontal`c           	     ón   •—  | j                   t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )Úall_horizontalr   r   ri  s     €r   r,   z all_horizontal.<locals>.<lambda>Ç  rl  rm  rn  ro  s   ` r   r  r  ‚  ó*   ø€ ñB ØJˆÜ˜‹oÐÜó	
óð r   Nc                ó    ‡ ‡— t        ‰ «      rd}t        |«      ‚t        ‰ t        t        f«      rd‰ › }t        |«      ‚t        ˆˆ fd„«      S )uP  Return an expression representing a literal value.

    Arguments:
        value: The value to use as literal.
        dtype: The data type of the literal value. If not provided, the data type will be inferred.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> df_pl = pl.DataFrame({"a": [1, 2]})
        >>> df_pd = pd.DataFrame({"a": [1, 2]})
        >>> df_pa = pa.table({"a": [1, 2]})

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.with_columns(nw.lit(3)).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
           a  literal
        0  1        3
        1  2        3
        >>> my_library_agnostic_function(df_pl)
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a   â”† literal â”‚
        â”‚ --- â”† ---     â”‚
        â”‚ i64 â”† i32     â”‚
        â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•¡
        â”‚ 1   â”† 3       â”‚
        â”‚ 2   â”† 3       â”‚
        â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: int64
        literal: int64
        ----
        a: [[1,2]]
        literal: [[3,3]]
    zvnumpy arrays are not supported as literal values. Consider using `with_columns` to create a new column from the array.z,Nested datatypes are not supported yet. Got c                ó(   •— | j                  ‰‰«      S r"   )Úlit)r+   r>   r  s    €€r   r,   zlit.<locals>.<lambda>
  s   ø€ ˜CŸG™G E¨5Ó1€ r   )r   r  r   rñ   Útupler  r   )r  r>   rô   s   `` r   r‘  r‘  Í  sV   ù€ ôd eÔðSð 	ô ˜‹oÐä%œ$¤˜Ô'Ø<¸U¸GÐDˆÜ! #Ó&Ð&äÔ1Ó2Ð2r   c                 ó>   ‡ — ‰ sd}t        |«      ‚t        ˆ fd„«      S )u	  Compute the bitwise OR horizontally across columns.

    Arguments:
        exprs: Name(s) of the columns to use in the aggregation function. Accepts expression input.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> data = {
        ...     "a": [False, False, True, True, False, None],
        ...     "b": [False, True, True, None, None, None],
        ... }
        >>> df_pl = pl.DataFrame(data)
        >>> df_pd = pd.DataFrame(data).convert_dtypes(dtype_backend="pyarrow")
        >>> df_pa = pa.table(data)

        We define a dataframe-agnostic function:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select("a", "b", any=nw.any_horizontal("a", "b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
               a      b    any
        0  False  False  False
        1  False   True   True
        2   True   True   True
        3   True   <NA>   True
        4  False   <NA>   <NA>
        5   <NA>   <NA>   <NA>

        >>> my_library_agnostic_function(df_pl)
        shape: (6, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a     â”† b     â”† any   â”‚
        â”‚ ---   â”† ---   â”† ---   â”‚
        â”‚ bool  â”† bool  â”† bool  â”‚
        â•žâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ false â”† false â”† false â”‚
        â”‚ false â”† true  â”† true  â”‚
        â”‚ true  â”† true  â”† true  â”‚
        â”‚ true  â”† null  â”† true  â”‚
        â”‚ false â”† null  â”† null  â”‚
        â”‚ null  â”† null  â”† null  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜

        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: bool
        b: bool
        any: bool
        ----
        a: [[false,false,true,true,false,null]]
        b: [[false,true,true,null,null,null]]
        any: [[false,true,true,true,null,null]]
    z:At least one expression must be passed to `any_horizontal`c           	     ón   •—  | j                   t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )Úany_horizontalr   r   ri  s     €r   r,   z any_horizontal.<locals>.<lambda>R  rl  rm  rn  ro  s   ` r   r•  r•    rŽ  r   c                 ó>   ‡ — ‰ sd}t        |«      ‚t        ˆ fd„«      S )uI  Compute the mean of all values horizontally across columns.

    Arguments:
        exprs: Name(s) of the columns to use in the aggregation function. Accepts
            expression input.

    Returns:
        A new expression.

    Examples:
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> data = {
        ...     "a": [1, 8, 3],
        ...     "b": [4, 5, None],
        ...     "c": ["x", "y", "z"],
        ... }
        >>> df_pl = pl.DataFrame(data)
        >>> df_pd = pd.DataFrame(data)
        >>> df_pa = pa.table(data)

        We define a dataframe-agnostic function that computes the horizontal mean of "a"
        and "b" columns:

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(nw.mean_horizontal("a", "b")).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(df_pd)
             a
        0  2.5
        1  6.5
        2  3.0

        >>> my_library_agnostic_function(df_pl)
        shape: (3, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ f64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 2.5 â”‚
        â”‚ 6.5 â”‚
        â”‚ 3.0 â”‚
        â””â”€â”€â”€â”€â”€â”˜

        >>> my_library_agnostic_function(df_pa)
        pyarrow.Table
        a: double
        ----
        a: [[2.5,6.5,3]]
    z;At least one expression must be passed to `mean_horizontal`c           	     ón   •—  | j                   t        ‰«      D cg c]  }t        | |«      ‘Œ c}Ž S c c}w r"   )Úmean_horizontalr   r   ri  s     €r   r,   z!mean_horizontal.<locals>.<lambda>–  s2   ø€ Ð'C×'Ñ'Ü18¸³Ö@¨AÔ  QÕ'Ò@ð
€ ùÚ@rm  rn  ro  s   ` r   r˜  r˜  X  s*   ø€ ñt ØKˆÜ˜‹oÐÜó	
óð r   Ú F©Ú	separatorr£   c               ó,   ‡ ‡‡‡— t        ˆ ˆˆˆfd„«      S )uJ
  Horizontally concatenate columns into a single string column.

    Arguments:
        exprs: Columns to concatenate into a single string column. Accepts expression
            input. Strings are parsed as column names, other non-expression inputs are
            parsed as literals. Non-`String` columns are cast to `String`.
        *more_exprs: Additional columns to concatenate into a single string column,
            specified as positional arguments.
        separator: String that will be used to separate the values of each column.
        ignore_nulls: Ignore null values (default is `False`).
            If set to `False`, null values will be propagated and if the row contains any
            null values, the output is null.

    Returns:
        A new expression.

    Examples:
        >>> import narwhals as nw
        >>> from narwhals.typing import IntoFrameT
        >>> import pandas as pd
        >>> import polars as pl
        >>> import pyarrow as pa
        >>> data = {
        ...     "a": [1, 2, 3],
        ...     "b": ["dogs", "cats", None],
        ...     "c": ["play", "swim", "walk"],
        ... }

        We define a dataframe-agnostic function that computes the horizontal string
        concatenation of different columns

        >>> def my_library_agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
        ...     df = nw.from_native(df_native)
        ...     return df.select(
        ...         nw.concat_str(
        ...             [
        ...                 nw.col("a") * 2,
        ...                 nw.col("b"),
        ...                 nw.col("c"),
        ...             ],
        ...             separator=" ",
        ...         ).alias("full_sentence")
        ...     ).to_native()

        We can pass any supported library such as Pandas, Polars, or PyArrow to `func`:

        >>> my_library_agnostic_function(pd.DataFrame(data))
          full_sentence
        0   2 dogs play
        1   4 cats swim
        2          None

        >>> my_library_agnostic_function(pl.DataFrame(data))
        shape: (3, 1)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ full_sentence â”‚
        â”‚ ---           â”‚
        â”‚ str           â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ 2 dogs play   â”‚
        â”‚ 4 cats swim   â”‚
        â”‚ null          â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        >>> my_library_agnostic_function(pa.table(data))
        pyarrow.Table
        full_sentence: string
        ----
        full_sentence: [["2 dogs play","4 cats swim",null]]
    c           
     óº   •—  | j                   t        ‰g«      D cg c]  }t        | |«      ‘Œ c}g‰D cg c]  }t        | |«      ‘Œ c}¢­‰‰dœŽS c c}w c c}w )Nrš  )Ú
concat_strr   r   )r+   rj  rk  r£   Ú
more_exprsr›  s     €€€€r   r,   zconcat_str.<locals>.<lambda>é  s]   ø€ NC—N‘NÜ07¸¸Ó0@ÖA¨1Ô˜s AÕ&ÒAð
à1;Ö<¨AÔ  QÕ'Ò<ñ
ð  Ø%ò	
€ ùÚAùÚ<s
   œA¶A
rK  )rk  r›  r£   rŸ  s   ````r   rž  rž  œ  s   û€ ôX ö	
óð r   )r   r   r   r   r  r   )rH  r  r  r   )rO  zint | Sequence[int]r  r   r‰  )rZ  r  r  r   )rk  r…  r  r   )r  r…  r  rx  r"   )r  r   r>   rˆ  r  r   )
rk  r…  rŸ  r   r›  r  r£   r†  r  r   )5Ú
__future__r   Útypingr   r   r   r   r   r	   r
   r   r   Únarwhals.dependenciesr   Únarwhals.dtypesr   Únarwhals.utilsr   r   Útyping_extensionsr   r   Únarwhals.typingr   r   r   r”  rz  ru  rw  r}  r€  rG  rN  rS  rV  r)   r©   r­   r¾   rÁ   rh  rr  rv  rx  r‚  r  r  r‘  r•  r˜  rž  Ú__all__r6   r   r   ú<module>r¨     s…  ðÝ "å  Ý Ý Ý Ý Ý Ý Ý Ý å 0Ý +Ý 6Ý "áÝ&å%Ý(ó÷y6'ñ y6'ñxm 	˜tÔ$€ô/
w˜u‘~ô /
ôdN
˜' %™.ô N
ôbs
˜G E™Nô s
ôl#l
˜ ™ô l
ô^=
˜ ™ô =
ó@3ól7óv0'óh.ób0/óf00óf12óh0/óf0/óf=ó@?óD?÷D
ñ 
ô
ˆ4ô 
óCóLHôV=3ó@HóVAðN Øñ	SØ(ðSàðSð ðSð ð	Sð
 
óSðn ðr   