Ë
    WËh‚ ã                  óÆ  — U d dl mZ d dlZd dlZd dlmZmZmZ d dl	m
Z
mZmZ d dlmZmZmZ d dlmZmZmZ d dlmZ d dlmZ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
rcd dl	m(Z(m)Z) d dl*m+Z+m,Z,m-Z-m.Z. d dl/m0Z0m1Z1 d dlm2Z2 d dl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>  e,d«      Z? e)d«      Z@ee1eef   ge0eef   f   ZAdeBd<    G d„ d«      ZCdgZDy)é    )ÚannotationsN)ÚIterableÚMappingÚSequence)ÚTYPE_CHECKINGÚAnyÚCallable)ÚExprMetadataÚapply_n_ary_operationÚcombine_metadata)Ú_validate_rolling_argumentsÚensure_typeÚflatten)Ú_validate_dtype)ÚComputeErrorÚInvalidOperationError©ÚExprCatNamespace©ÚExprDateTimeNamespace©ÚExprListNamespace©ÚExprNameNamespace©ÚExprStringNamespace©ÚExprStructNamespace)Ú	to_native)ÚNoReturnÚTypeVar)ÚConcatenateÚ	ParamSpecÚSelfÚ	TypeAlias)ÚCompliantExprÚCompliantNamespace)ÚDType)ÚClosedIntervalÚFillNullStrategyÚ	IntoDTypeÚIntoExprÚModeKeepStrategyÚNonNestedLiteralÚNumericLiteralÚ
RankMethodÚRollingInterpolationMethodÚTemporalLiteralÚ_1DArrayÚPSÚRr%   Ú_ToCompliantc                  ó.  — e Zd Zdyd„Zdzd„Zdzd„Z	 	 	 	 dzd„Zdzd„Zdzd„Zdzd„Z	dzd„Z
	 	 	 	 	 	 d{d	„Zd|d
„Zd}d„Zd~d„Zdd„Z	 	 	 	 	 	 	 	 d€d„Zdd„Zddœ	 	 	 	 	 	 	 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&„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.d.dd/d0d1œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d…d2„Z.d~d3„Z/d~d4„Z0d/d5œd†d6„Z1d/d5œd†d7„Z2	 d‡d0d8œ	 	 	 	 	 	 	 dˆd9„Z3d~d:„Z4d~d;„Z5d‰d<„Z6d~d=„Z7d~d>„Z8d~d?„Z9d~d@„Z:d~dA„Z;d~dB„Z<d0dCœdŠdD„Z=d~dE„Z>d‹dF„Z?	 d‡d.dGœ	 	 	 	 	 	 	 dŒdH„Z@	 d	 	 	 	 	 	 	 dŽdI„ZAd„dJ„ZBddK„ZCd~dL„ZDd~dM„ZE	 	 	 d	 	 	 	 	 	 	 d‘dN„ZFd’dO„ZGd~dP„ZHd.dQœ	 	 	 	 	 d“dR„ZId~dS„ZJd~dT„ZKd~dU„ZLd~dV„ZMd~dW„ZN	 	 	 	 	 	 d”dX„ZOd•d–dY„ZPd~dZ„ZQ	 	 d—	 	 	 	 	 d˜d[„ZRd\d]œd™d^„ZSd~d_„ZTd0dCœdŠd`„ZUd0dCœdŠda„ZVd0dCœdŠdb„ZWd0dCœdŠdc„ZXd.d0ddœ	 	 	 	 	 	 	 dšde„ZYd.d0ddœ	 	 	 	 	 	 	 dšdf„ZZd.d0d/dgœ	 	 	 	 	 	 	 	 	 d›dh„Z[d.d0d/dgœ	 	 	 	 	 	 	 	 	 d›di„Z\dœd0djœddk„Z]e^j¾                  fdždl„Z`d~dm„Zad~dn„Zbdodpd0dqœ	 	 	 	 	 	 	 	 	 dŸdr„Zcedd ds„«       Zeedd¡dt„«       Zfedd¢du„«       Zgedd£dv„«       Zhedd¤dw„«       Ziedd¥dx„«       Zjy.)¦ÚExprc                ó2   ‡ ‡— dˆ ˆfd„}|‰ _         |‰ _        y )Nc                ó:   •—  ‰| «      }‰j                   |_         |S ©N©Ú	_metadata)ÚplxÚresultÚselfÚto_compliant_exprs     €€úG/var/www/html/jupyter_env/lib/python3.12/site-packages/narwhals/expr.pyÚfunczExpr.__init__.<locals>.func7   s   ø€ Ù& sÓ+ˆFØ#Ÿ~™~ˆFÔØˆMó    )r>   zCompliantNamespace[Any, Any]ÚreturnzCompliantExpr[Any, Any])Ú_to_compliant_exprr=   )r@   rA   ÚmetadatarC   s   ``  rB   Ú__init__zExpr.__init__5   s   ù€ ö	ð
 15ˆÔØ!ˆrD   c                óV   — | j                  || j                  j                  «       «      S r;   )Ú	__class__r=   Úwith_elementwise_op©r@   rA   s     rB   Ú_with_elementwisezExpr._with_elementwise?   s!   € Ø~‰~Ð/°·±×1SÑ1SÓ1UÓVÐVrD   c                óV   — | j                  || j                  j                  «       «      S r;   )rJ   r=   Úwith_aggregationrL   s     rB   Ú_with_aggregationzExpr._with_aggregationB   s!   € Ø~‰~Ð/°·±×1PÑ1PÓ1RÓSÐSrD   c                óV   — | j                  || j                  j                  «       «      S r;   )rJ   r=   Úwith_orderable_aggregationrL   s     rB   Ú_with_orderable_aggregationz Expr._with_orderable_aggregationE   s'   € ð ~‰~Ø˜tŸ~™~×HÑHÓJó
ð 	
rD   c                óV   — | j                  || j                  j                  «       «      S r;   )rJ   r=   Úwith_orderable_windowrL   s     rB   Ú_with_orderable_windowzExpr._with_orderable_windowL   s!   € Ø~‰~Ð/°·±×1UÑ1UÓ1WÓXÐXrD   c                óV   — | j                  || j                  j                  «       «      S r;   )rJ   r=   Úwith_windowrL   s     rB   Ú_with_windowzExpr._with_windowO   s!   € Ø~‰~Ð/°·±×1KÑ1KÓ1MÓNÐNrD   c                óV   — | j                  || j                  j                  «       «      S r;   )rJ   r=   Úwith_filtrationrL   s     rB   Ú_with_filtrationzExpr._with_filtrationR   s!   € Ø~‰~Ð/°·±×1OÑ1OÓ1QÓRÐRrD   c                óV   — | j                  || j                  j                  «       «      S r;   )rJ   r=   Úwith_orderable_filtrationrL   s     rB   Ú_with_orderable_filtrationzExpr._with_orderable_filtrationU   s%   € Ø~‰~Ø˜tŸ~™~×GÑGÓIó
ð 	
rD   c           
     óT   ‡ ‡‡— ‰ j                  ˆˆˆ fd„t        ‰ g‰¢­ddddœŽ«      S )Nc                ó&   •— t        | ‰‰g‰¢­ddiŽS )NÚ
str_as_litF©r   )r>   ÚargsÚn_ary_functionr@   s    €€€rB   ú<lambda>z!Expr._with_nary.<locals>.<lambda>`   s$   ø€ Ô-Ø^ TðØ,0òØ=Bñ€ rD   F©rb   Úallow_multi_outputÚto_single_output)rJ   r   )r@   re   rd   s   ```rB   Ú
_with_naryzExpr._with_naryZ   s@   ú€ ð
 ~‰~õô Øðàñð !Ø#(Ø!&òó	
ð 	
rD   c                ó"   — d| j                   › dS )NzNarwhals Expr
metadata: ú
r<   ©r@   s    rB   Ú__repr__zExpr.__repr__l   s   € Ø*¨4¯>©>Ð*:¸"Ð=Ð=rD   c                ó6   — dt        | «      › d}t        |«      ‚)Nzthe truth value of a–   is ambiguous

You probably got here by using a Python standard library function instead of the native expressions API.
Here are some things you might want to try:
- instead of `nw.col('a') and nw.col('b')`, use `nw.col('a') & nw.col('b')`
- instead of `nw.col('a') in [y, z]`, use `nw.col('a').is_in([y, z])`
- instead of `max(nw.col('a'), nw.col('b'))`, use `nw.max_horizontal(nw.col('a'), nw.col('b'))`
)ÚtypeÚ	TypeError)r@   Úmsgs     rB   Ú__bool__zExpr.__bool__o   s*   € à!¤$ t£* ð .pð pð 	ô ˜‹nÐrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )Nc                ó^   •— ‰j                  | «      j                  «       j                  «       S r;   )rF   ÚabsÚsum©r>   r@   s    €rB   rf   z$Expr._taxicab_norm.<locals>.<lambda>€   s$   ø€ ˜×/Ñ/°Ó4×8Ñ8Ó:×>Ñ>Ó@€ rD   ©rP   rm   s   `rB   Ú_taxicab_normzExpr._taxicab_norm|   s   ø€ ð ×%Ñ%Û@ó
ð 	
rD   c                óF   ‡ ‡— ‰ j                  ˆˆ fd„‰ j                  «      S )u”  Rename the expression.

        Arguments:
            name: The new name.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2], "b": [4, 5]})
            >>> df = nw.from_native(df_native)
            >>> df.select((nw.col("b") + 10).alias("c"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |          c       |
            |      0  14       |
            |      1  15       |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óD   •— ‰j                  | «      j                  ‰«      S r;   )rF   Úalias)r>   Únamer@   s    €€rB   rf   zExpr.alias.<locals>.<lambda>š   s   ø€ ˜×/Ñ/°Ó4×:Ñ:¸4Ó@€ rD   )rJ   r=   )r@   r~   s   ``rB   r}   z
Expr.alias„   s   ù€ ð* ~‰~Ü@À$Ç.Á.ó
ð 	
rD   c                ó   —  || g|¢­i |¤ŽS )u^  Pipe function call.

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

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 4]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_piped=nw.col("a").pipe(lambda x: x + 1))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |     a  a_piped   |
            |  0  1        2   |
            |  1  2        3   |
            |  2  3        4   |
            |  3  4        5   |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        © )r@   Úfunctionrd   Úkwargss       rB   Úpipez	Expr.pipe   s   € ñ: ˜Ð.˜tÒ. vÑ.Ð.rD   c                óF   ‡ ‡— t        ‰«       ‰ j                  ˆˆ fd„«      S )u  Redefine an object's data type.

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

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"foo": [1, 2, 3], "bar": [6.0, 7.0, 8.0]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("foo").cast(nw.Float32), nw.col("bar").cast(nw.UInt8))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |      foo  bar    |
            |   0  1.0    6    |
            |   1  2.0    7    |
            |   2  3.0    8    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óD   •— ‰j                  | «      j                  ‰«      S r;   )rF   Úcast)r>   Údtyper@   s    €€rB   rf   zExpr.cast.<locals>.<lambda>Ó   s   ø€ ˜×/Ñ/°Ó4×9Ñ9¸%Ó@€ rD   )r   rM   )r@   r‡   s   ``rB   r†   z	Expr.cast¼   s#   ù€ ô* 	˜ÔØ×%Ñ%Ü@ó
ð 	
rD   T©rb   c               ób   ‡ ‡‡‡— ‰ j                  ˆˆˆ ˆfd„t        j                  ‰ ‰«      «      S )Nc                ó$   •— t        | ‰‰‰‰¬«      S )Nrˆ   rc   )r>   r   Úotherr@   rb   s    €€€€rB   rf   z#Expr._with_binary.<locals>.<lambda>ß   s   ø€ Ô-ØX˜t U°zô€ rD   )rJ   r
   Úfrom_binary_op)r@   r   r‹   rb   s   ````rB   Ú_with_binaryzExpr._with_binary×   s-   û€ ð ~‰~öô ×'Ñ'¨¨eÓ4ó	
ð 	
rD   c                óB   — | j                  t        j                  |«      S r;   )r   ÚopÚeq©r@   r‹   s     rB   Ú__eq__zExpr.__eq__å   ó   € Ø× Ñ ¤§¡¨Ó.Ð.rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úner‘   s     rB   Ú__ne__zExpr.__ne__è   r“   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úand_r‘   s     rB   Ú__and__zExpr.__and__ë   s   € Ø× Ñ ¤§¡¨%Ó0Ð0rD   c                ó*   — | |z  j                  d«      S ©NÚliteral©r}   r‘   s     rB   Ú__rand__zExpr.__rand__î   ó   € Øu‘×#Ñ# IÓ.Ð.rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úor_r‘   s     rB   Ú__or__zExpr.__or__ñ   ó   € Ø× Ñ ¤§¡¨Ó/Ð/rD   c                ó*   — | |z  j                  d«      S r›   r   r‘   s     rB   Ú__ror__zExpr.__ror__ô   rŸ   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úaddr‘   s     rB   Ú__add__zExpr.__add__÷   r£   rD   c                ó*   — | |z   j                  d«      S r›   r   r‘   s     rB   Ú__radd__zExpr.__radd__ú   rŸ   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úsubr‘   s     rB   Ú__sub__zExpr.__sub__ý   r£   rD   c                ó(   — | j                  d„ |«      S )Nc                ó$   — | j                  |«      S r;   )Ú__rsub__©ÚxÚys     rB   rf   zExpr.__rsub__.<locals>.<lambda>  ó   € ¨a¯j©j¸«m€ rD   ©r   r‘   s     rB   r°   zExpr.__rsub__   ó   € Ø× Ñ Ñ!;¸UÓCÐCrD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Útruedivr‘   s     rB   Ú__truediv__zExpr.__truediv__  s   € Ø× Ñ ¤§¡¨UÓ3Ð3rD   c                ó(   — | j                  d„ |«      S )Nc                ó$   — | j                  |«      S r;   )Ú__rtruediv__r±   s     rB   rf   z#Expr.__rtruediv__.<locals>.<lambda>  s   € ¨a¯n©n¸QÓ.?€ rD   rµ   r‘   s     rB   r¼   zExpr.__rtruediv__  s   € Ø× Ñ Ñ!?ÀÓGÐGrD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úmulr‘   s     rB   Ú__mul__zExpr.__mul__	  r£   rD   c                ó*   — | |z  j                  d«      S r›   r   r‘   s     rB   Ú__rmul__zExpr.__rmul__  rŸ   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úler‘   s     rB   Ú__le__zExpr.__le__  r“   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Últr‘   s     rB   Ú__lt__zExpr.__lt__  r“   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úgtr‘   s     rB   Ú__gt__zExpr.__gt__  r“   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úger‘   s     rB   Ú__ge__zExpr.__ge__  r“   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úpowr‘   s     rB   Ú__pow__zExpr.__pow__  r£   rD   c                ó(   — | j                  d„ |«      S )Nc                ó$   — | j                  |«      S r;   )Ú__rpow__r±   s     rB   rf   zExpr.__rpow__.<locals>.<lambda>  r´   rD   rµ   r‘   s     rB   rÓ   zExpr.__rpow__  r¶   rD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úfloordivr‘   s     rB   Ú__floordiv__zExpr.__floordiv__!  s   € Ø× Ñ ¤§¡¨eÓ4Ð4rD   c                ó(   — | j                  d„ |«      S )Nc                ó$   — | j                  |«      S r;   )Ú__rfloordiv__r±   s     rB   rf   z$Expr.__rfloordiv__.<locals>.<lambda>%  s   € ¨a¯o©o¸aÓ.@€ rD   rµ   r‘   s     rB   rÙ   zExpr.__rfloordiv__$  s   € Ø× Ñ Ñ!@À%ÓHÐHrD   c                óB   — | j                  t        j                  |«      S r;   )r   r   Úmodr‘   s     rB   Ú__mod__zExpr.__mod__'  r£   rD   c                ó(   — | j                  d„ |«      S )Nc                ó$   — | j                  |«      S r;   )Ú__rmod__r±   s     rB   rf   zExpr.__rmod__.<locals>.<lambda>+  r´   rD   rµ   r‘   s     rB   rß   zExpr.__rmod__*  r¶   rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )Nc                óB   •— ‰j                  | «      j                  «       S r;   )rF   Ú
__invert__rx   s    €rB   rf   z!Expr.__invert__.<locals>.<lambda>0  ó   ø€ ˜×/Ñ/°Ó4×?Ñ?ÓA€ rD   ©rM   rm   s   `rB   râ   zExpr.__invert__.  s   ø€ Ø×%Ñ%ÛAó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u¬  Return whether any of the values in the column are `True`.

        If there are no non-null elements, the result is `False`.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [True, False], "b": [True, True]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").any())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a     b   |
            |  0  True  True   |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úanyrx   s    €rB   rf   zExpr.any.<locals>.<lambda>E  ó   ø€ °$×2IÑ2IÈ#Ó2N×2RÑ2RÓ2T€ rD   ry   rm   s   `rB   rç   zExpr.any3  ó   ø€ ð$ ×%Ñ%Ó&TÓUÐUrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u¤  Return whether all values in the column are `True`.

        If there are no non-null elements, the result is `True`.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [True, False], "b": [True, True]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").all())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |         a     b  |
            |  0  False  True  |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úallrx   s    €rB   rf   zExpr.all.<locals>.<lambda>Y  rè   rD   ry   rm   s   `rB   rì   zExpr.allG  ré   rD   Né   F©ÚcomÚspanÚ	half_lifeÚalphaÚadjustÚmin_samplesÚignore_nullsc          
     óH   ‡ ‡‡‡‡‡‡‡— ‰ j                  ˆˆˆˆˆˆˆ ˆfd„«      S )u  Compute exponentially-weighted moving average.

        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_samples: 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`.

        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 agnostic_ewm_mean(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 `agnostic_ewm_mean`:

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

            >>> agnostic_ewm_mean(df_pl)  # doctest: +NORMALIZE_WHITESPACE
            shape: (3, 1)
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            â”‚ a        â”‚
            â”‚ ---      â”‚
            â”‚ f64      â”‚
            â•žâ•â•â•â•â•â•â•â•â•â•â•¡
            â”‚ 1.0      â”‚
            â”‚ 1.666667 â”‚
            â”‚ 2.428571 â”‚
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c           	     óR   •— ‰j                  | «      j                  ‰‰‰‰‰‰‰¬«      S )Nrî   )rF   Úewm_mean)	r>   ró   rò   rï   rñ   rõ   rô   r@   rð   s	    €€€€€€€€rB   rf   zExpr.ewm_mean.<locals>.<lambda>¯  s7   ø€ ˜×/Ñ/°Ó4×=Ñ=ØØØ#ØØØ'Ø)ð >ó € rD   ©rV   )r@   rï   rð   rñ   rò   ró   rô   rõ   s   ````````rB   rø   zExpr.ewm_mean[  s#   ÿ€ ðf ×*Ñ*÷ò ó

ð 
	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u9  Get mean value.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [-1, 0, 1], "b": [2, 4, 6]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").mean())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a    b    |
            |   0  0.0  4.0    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úmeanrx   s    €rB   rf   zExpr.mean.<locals>.<lambda>Ê  ó   ø€ °$×2IÑ2IÈ#Ó2N×2SÑ2SÓ2U€ rD   ry   rm   s   `rB   rü   z	Expr.meanº  ó   ø€ ð  ×%Ñ%Ó&UÓVÐVrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uÒ  Get median value.

        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 narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").median())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a    b    |
            |   0  3.0  4.0    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úmedianrx   s    €rB   rf   zExpr.median.<locals>.<lambda>ß  ó   ø€ °$×2IÑ2IÈ#Ó2N×2UÑ2UÓ2W€ rD   ry   rm   s   `rB   r  zExpr.medianÌ  s   ø€ ð& ×%Ñ%Ó&WÓXÐXrD   ©Ú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.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [20, 25, 60], "b": [1.5, 1, -1.4]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").std(ddof=0))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            | Narwhals DataFrame  |
            |---------------------|
            |          a         b|
            |0  17.79513  1.265789|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S ©Nr  )rF   Ústd©r>   r  r@   s    €€rB   rf   zExpr.std.<locals>.<lambda>ö  ó    ø€ ˜×/Ñ/°Ó4×8Ñ8¸dÐ8ÓC€ rD   ry   ©r@   r  s   ``rB   r  zExpr.stdá  ó   ù€ ð( ×%Ñ%ÜCó
ð 	
rD   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u>  Get variance.

        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.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [20, 25, 60], "b": [1.5, 1, -1.4]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").var(ddof=0))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |  Narwhals DataFrame   |
            |-----------------------|
            |            a         b|
            |0  316.666667  1.602222|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S r  )rF   Úvarr	  s    €€rB   rf   zExpr.var.<locals>.<lambda>  r
  rD   ry   r  s   ``rB   r  zExpr.varù  r  rD   )Úreturns_scalarc               ód   ‡ ‡‡‡— dˆˆˆˆ fd„}‰r‰ j                  |«      S ‰ j                  |«      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_scalar: If the function returns a scalar, by default it will be wrapped
                in a list in the output, since the assumption is that the function always
                returns something Series-like.
                If you want to keep the result as a scalar, set this argument to True.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.col("a", "b")
            ...     .map_batches(lambda s: s.to_numpy() + 1, return_dtype=nw.Float64)
            ...     .name.suffix("_mapped")
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |    Narwhals DataFrame     |
            |---------------------------|
            |   a  b  a_mapped  b_mapped|
            |0  1  4       2.0       5.0|
            |1  2  5       3.0       6.0|
            |2  3  6       4.0       7.0|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S )N)r   Úreturn_dtyper  )rF   Úmap_batches)r>   r   r  r  r@   s    €€€€rB   Úcompliant_exprz(Expr.map_batches.<locals>.compliant_expr<  s/   ø€ Ø×*Ñ*¨3Ó/×;Ñ;Ø!Ø)Ø-ð <ó ð rD   ©r>   r   rE   r   )rS   r_   )r@   r   r  r  r  s   ```` rB   r  zExpr.map_batches  s5   û€ ÷V	ð 	ñ Ø×3Ñ3°NÓCÐCà×.Ñ.¨~Ó>Ð>rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )ub  Calculate the sample skewness of a column.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 2, 10, 100]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").skew())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |      a         b |
            | 0  0.0  1.472427 |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úskewrx   s    €rB   rf   zExpr.skew.<locals>.<lambda>X  rý   rD   ry   rm   s   `rB   r  z	Expr.skewH  rþ   rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uL  Compute the kurtosis (Fisher's definition) without bias correction.

        Kurtosis is the fourth central moment divided by the square of the variance.
        The Fisher's definition is used where 3.0 is subtracted from the result to give 0.0 for a normal distribution.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 2, 10, 100]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").kurtosis())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |      a         b |
            | 0 -1.3  0.210657 |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úkurtosisrx   s    €rB   rf   zExpr.kurtosis.<locals>.<lambda>m  ó   ø€ °$×2IÑ2IÈ#Ó2N×2WÑ2WÓ2Y€ rD   ry   rm   s   `rB   r  zExpr.kurtosisZ  s   ø€ ð& ×%Ñ%Ó&YÓZÐZrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Return the sum value.

        If there are no non-null elements, the result is zero.

        Examples:
            >>> import duckdb
            >>> import narwhals as nw
            >>> df_native = duckdb.sql("SELECT * FROM VALUES (5, 50), (10, 100) df(a, b)")
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").sum())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals LazyFrame |
            |-------------------|
            |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚   a    â”‚   b    â”‚|
            |â”‚ int128 â”‚ int128 â”‚|
            |â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
            |â”‚     15 â”‚    150 â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   rw   rx   s    €rB   rf   zExpr.sum.<locals>.<lambda>…  rè   rD   ry   rm   s   `rB   rw   zExpr.sumo  s   ø€ ð, ×%Ñ%Ó&TÓUÐUrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uJ  Returns the minimum value(s) from a column(s).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2], "b": [4, 3]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.min("a", "b"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a  b      |
            |     0  1  3      |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úminrx   s    €rB   rf   zExpr.min.<locals>.<lambda>—  rè   rD   ry   rm   s   `rB   r"  zExpr.min‡  ó   ø€ ð  ×%Ñ%Ó&TÓUÐUrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uO  Returns the maximum value(s) from a column(s).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [10, 20], "b": [50, 100]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.max("a", "b"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a    b    |
            |    0  20  100    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úmaxrx   s    €rB   rf   zExpr.max.<locals>.<lambda>©  rè   rD   ry   rm   s   `rB   r&  zExpr.max™  r#  rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u[  Returns the number of non-null elements in the column.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3], "b": [None, 4, 4]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.all().count())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a  b      |
            |     0  3  2      |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úcountrx   s    €rB   rf   zExpr.count.<locals>.<lambda>»  s   ø€ °$×2IÑ2IÈ#Ó2N×2TÑ2TÓ2V€ rD   ry   rm   s   `rB   r)  z
Expr.count«  s   ø€ ð  ×%Ñ%Ó&VÓWÐWrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uX  Returns count of unique values.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [1, 1, 3, 3, 5]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").n_unique())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a  b      |
            |     0  5  3      |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Ún_uniquerx   s    €rB   rf   zExpr.n_unique.<locals>.<lambda>Í  r  rD   ry   rm   s   `rB   r,  zExpr.n_unique½  s   ø€ ð  ×%Ñ%Ó&YÓZÐZrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )ue  Return unique values of this expression.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").unique().sum())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a   b     |
            |     0  9  12     |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úuniquerx   s    €rB   rf   zExpr.unique.<locals>.<lambda>ß  s   ø€ °×1HÑ1HÈÓ1M×1TÑ1TÓ1V€ rD   ©r\   rm   s   `rB   r/  zExpr.uniqueÏ  s   ø€ ð  ×$Ñ$Ó%VÓWÐWrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u¦  Return absolute value of each element.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, -2], "b": [-3, 4]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(nw.col("a", "b").abs().name.suffix("_abs"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            | Narwhals DataFrame  |
            |---------------------|
            |   a  b  a_abs  b_abs|
            |0  1 -3      1      3|
            |1 -2  4      2      4|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   rv   rx   s    €rB   rf   zExpr.abs.<locals>.<lambda>ò  rè   rD   rä   rm   s   `rB   rv   zExpr.absá  s   ø€ ð" ×%Ñ%Ó&TÓUÐUrD   ©Úreversec               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uÙ  Return cumulative sum.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            reverse: reverse the operation

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 1, 3, 5, 5], "b": [2, 4, 4, 6, 6]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_cum_sum=nw.col("a").cum_sum())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |   a  b  a_cum_sum|
            |0  1  2          1|
            |1  1  4          2|
            |2  3  4          5|
            |3  5  6         10|
            |4  5  6         15|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S ©Nr3  )rF   Úcum_sum©r>   r4  r@   s    €€rB   rf   zExpr.cum_sum.<locals>.<lambda>  ó    ø€ ˜×/Ñ/°Ó4×<Ñ<ÀWÐ<ÓM€ rD   rù   ©r@   r4  s   ``rB   r8  zExpr.cum_sumô  s   ù€ ð6 ×*Ñ*ÜMó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uª  Returns the difference between each element and the previous one.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        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 narwhals as nw
            >>> df_native = pl.DataFrame({"a": [1, 1, 3, 5, 5]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_diff=nw.col("a").diff())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            | shape: (5, 2)    |
            | â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â” |
            | â”‚ a   â”† a_diff â”‚ |
            | â”‚ --- â”† ---    â”‚ |
            | â”‚ i64 â”† i64    â”‚ |
            | â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•¡ |
            | â”‚ 1   â”† null   â”‚ |
            | â”‚ 1   â”† 0      â”‚ |
            | â”‚ 3   â”† 2      â”‚ |
            | â”‚ 5   â”† 2      â”‚ |
            | â”‚ 5   â”† 0      â”‚ |
            | â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”˜ |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Údiffrx   s    €rB   rf   zExpr.diff.<locals>.<lambda>;  s   ø€ ˜×/Ñ/°Ó4×9Ñ9Ó;€ rD   rù   rm   s   `rB   r>  z	Expr.diff  s   ø€ ðN ×*Ñ*Û;ó
ð 	
rD   c                óT   ‡ ‡— t        ‰t        d¬«       ‰ j                  ˆˆ fd„«      S )uÒ  Shift values by `n` positions.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

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

        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 narwhals as nw
            >>> df_native = pl.DataFrame({"a": [1, 1, 3, 5, 5]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_shift=nw.col("a").shift(n=1))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |shape: (5, 2)     |
            |â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â” |
            |â”‚ a   â”† a_shift â”‚ |
            |â”‚ --- â”† ---     â”‚ |
            |â”‚ i64 â”† i64     â”‚ |
            |â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•¡ |
            |â”‚ 1   â”† null    â”‚ |
            |â”‚ 1   â”† 1       â”‚ |
            |â”‚ 3   â”† 1       â”‚ |
            |â”‚ 5   â”† 3       â”‚ |
            |â”‚ 5   â”† 5       â”‚ |
            |â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜ |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Ún)Ú
param_namec                óD   •— ‰j                  | «      j                  ‰«      S r;   )rF   Úshift)r>   r@  r@   s    €€rB   rf   zExpr.shift.<locals>.<lambda>k  s   ø€ ˜×/Ñ/°Ó4×:Ñ:¸1Ó=€ rD   )r   ÚintrV   )r@   r@  s   ``rB   rC  z
Expr.shift>  s(   ù€ ôT 	A”s sÕ+à×*Ñ*Ü=ó
ð 	
rD   ©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_strict(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.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [3, 0, 1, 2]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     b=nw.col("a").replace_strict(
            ...         [0, 1, 2, 3],
            ...         ["zero", "one", "two", "three"],
            ...         return_dtype=nw.String,
            ...     )
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |      a      b    |
            |   0  3  three    |
            |   1  0   zero    |
            |   2  1    one    |
            |   3  2    two    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        zB`new` argument is required if `old` argument is not a Mapping typec                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S )NrE  )rF   Úreplace_strict)r>   ÚnewÚoldr  r@   s    €€€€rB   rf   z%Expr.replace_strict.<locals>.<lambda>¡  s*   ø€ ˜×/Ñ/°Ó4×CÑCØS |ð Dó € rD   )Ú
isinstancer   rq   ÚlistÚvaluesÚkeysrM   )r@   rJ  rI  r  rr   s   ```` rB   rH  zExpr.replace_strictn  s\   û€ ðT ˆ;Ü˜c¤7Ô+ØZÜ “nÐ$äs—z‘z“|Ó$ˆCÜs—x‘x“zÓ"ˆCà×%Ñ%öó
ð 	
rD   c                ó0   ‡— | j                  ˆfd„||«      S )u  Check if this expression is between the given lower and upper bounds.

        Arguments:
            lower_bound: Lower bound value. String literals are interpreted as column names.
            upper_bound: Upper bound value. String literals are interpreted as column names.
            closed: Define which sides of the interval are closed (inclusive).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 4, 5]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(b=nw.col("a").is_between(2, 4, "right"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |      a      b    |
            |   0  1  False    |
            |   1  2  False    |
            |   2  3   True    |
            |   3  4   True    |
            |   4  5  False    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                ó,   •— | j                  ||‰¬«      S )N)Úclosed)Ú
is_between)ÚexprÚlbÚubrQ  s      €rB   rf   z!Expr.is_between.<locals>.<lambda>Æ  s   ø€  §¡°°RÀ Ó!G€ rD   ©rj   )r@   Úlower_boundÚupper_boundrQ  s      `rB   rR  zExpr.is_between§  s   ø€ ð< ‰ÛGØØó
ð 	
rD   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

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 9, 10]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(b=nw.col("a").is_in([1, 2]))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |       a      b   |
            |   0   1   True   |
            |   1   2   True   |
            |   2   9  False   |
            |   3  10  False   |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óZ   •— ‰j                  | «      j                  t        ‰d¬«      «      S )NT)Úpass_through)rF   Úis_inr   )r>   r‹   r@   s    €€rB   rf   zExpr.is_in.<locals>.<lambda>ã  s'   ø€ ˜D×3Ñ3°CÓ8×>Ñ>Ü˜e°$Ô7ó€ rD   zyNarwhals `is_in` doesn't accept expressions as an argument, as opposed to Polars. You should provide an iterable instead.)rK  r   ÚstrÚbytesrM   ÚNotImplementedError)r@   r‹   rr   s   `` rB   r\  z
Expr.is_inË  sG   ù€ ô, eœXÔ&¬z¸%Ä#ÄuÀÔ/NØ×)Ñ)ôóð ð
 JˆÜ! #Ó&Ð&rD   c                ó†   ‡ ‡— t        |«      Št        ‰ g‰¢­ddddœŽj                  «       }‰ j                  ˆˆ fd„|«      S )u¹  Filters elements based on a condition, returning a new expression.

        Arguments:
            predicates: Conditions to filter by (which get AND-ed together).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame(
            ...     {"a": [2, 3, 4, 5, 6, 7], "b": [10, 11, 12, 13, 14, 15]}
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.select(
            ...     nw.col("a").filter(nw.col("a") > 4),
            ...     nw.col("b").filter(nw.col("b") < 13),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a   b     |
            |     3  5  10     |
            |     4  6  11     |
            |     5  7  12     |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        FTrg   c                ó(   •— t        | d„ ‰g‰¢­ddiŽS )Nc                 ó,   —  | d   j                   | dd  Ž S ©Nr   rí   )Úfilter)Úexprss    rB   rf   z/Expr.filter.<locals>.<lambda>.<locals>.<lambda>  s   € ˜˜u Q™xŸ™°°a°b°	Ð:€ rD   rb   Frc   )r>   Úflat_predicatesr@   s    €€rB   rf   zExpr.filter.<locals>.<lambda>  s*   ø€ Ô-ØÙ:Øðð !ò	ð
 !ñ€ rD   )r   r   r[   rJ   )r@   Ú
predicatesrG   rf  s   `  @rB   rd  zExpr.filterê  s^   ù€ ô4 " *Ó-ˆÜ#Øð
àñ
ð Ø#Ø"ò
÷ ‰/Ó
ð 	ð ~‰~ôð ó	
ð 		
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u×  Returns a boolean Series indicating which values are null.

        Notes:
            pandas handles null values differently from Polars and PyArrow.
            See [null_handling](../concepts/null_handling.md/) for reference.

        Examples:
            >>> import duckdb
            >>> import narwhals as nw
            >>> df_native = duckdb.sql(
            ...     "SELECT * FROM VALUES (null, CAST('NaN' AS DOUBLE)), (2, 2.) df(a, b)"
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     a_is_null=nw.col("a").is_null(), b_is_null=nw.col("b").is_null()
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |            Narwhals LazyFrame            |
            |------------------------------------------|
            |â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚   a   â”‚   b    â”‚ a_is_null â”‚ b_is_null â”‚|
            |â”‚ int32 â”‚ double â”‚  boolean  â”‚  boolean  â”‚|
            |â”œâ”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
            |â”‚  NULL â”‚    nan â”‚ true      â”‚ false     â”‚|
            |â”‚     2 â”‚    2.0 â”‚ false     â”‚ false     â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úis_nullrx   s    €rB   rf   zExpr.is_null.<locals>.<lambda>4  s   ø€ °$×2IÑ2IÈ#Ó2N×2VÑ2VÓ2X€ rD   rä   rm   s   `rB   rj  zExpr.is_null  s   ø€ ð: ×%Ñ%Ó&XÓYÐYrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Indicate which values are NaN.

        Notes:
            pandas handles null values differently from Polars and PyArrow.
            See [null_handling](../concepts/null_handling.md/) for reference.

        Examples:
            >>> import duckdb
            >>> import narwhals as nw
            >>> df_native = duckdb.sql(
            ...     "SELECT * FROM VALUES (null, CAST('NaN' AS DOUBLE)), (2, 2.) df(a, b)"
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     a_is_nan=nw.col("a").is_nan(), b_is_nan=nw.col("b").is_nan()
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |           Narwhals LazyFrame           |
            |----------------------------------------|
            |â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚   a   â”‚   b    â”‚ a_is_nan â”‚ b_is_nan â”‚|
            |â”‚ int32 â”‚ double â”‚ boolean  â”‚ boolean  â”‚|
            |â”œâ”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
            |â”‚  NULL â”‚    nan â”‚ NULL     â”‚ true     â”‚|
            |â”‚     2 â”‚    2.0 â”‚ false    â”‚ false    â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úis_nanrx   s    €rB   rf   zExpr.is_nan.<locals>.<lambda>S  r  rD   rä   rm   s   `rB   rm  zExpr.is_nan6  s   ø€ ð: ×%Ñ%Ó&WÓXÐXrD   c                óþ   ‡ ‡‡‡— ‰‰d}t        |«      ‚‰€‰€d}t        |«      ‚‰‰dvrd‰› }t        |«      ‚‰ j                  ˆˆ ˆˆfd„‰‰ j                  j                  «       «      S ‰ j                  «      S )u¸  Fill null values with given value.

        Arguments:
            value: Value or expression 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.

        Notes:
            - pandas handles null values differently from other libraries.
              See [null_handling](../concepts/null_handling.md/)
              for reference.
            - For pandas Series of `object` dtype, `fill_null` will not automatically change the
              Series' dtype as pandas used to do. Explicitly call `cast` if you want the dtype to change.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> df_native = pl.DataFrame(
            ...     {
            ...         "a": [2, None, None, 3],
            ...         "b": [2.0, float("nan"), float("nan"), 3.0],
            ...         "c": [1, 2, 3, 4],
            ...     }
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.col("a", "b").fill_null(0).name.suffix("_filled"),
            ...     nw.col("a").fill_null(nw.col("c")).name.suffix("_filled_with_c"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |                     Narwhals DataFrame                     |
            |------------------------------------------------------------|
            |shape: (4, 6)                                               |
            |â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚ a    â”† b   â”† c   â”† a_filled â”† b_filled â”† a_filled_with_c â”‚|
            |â”‚ ---  â”† --- â”† --- â”† ---      â”† ---      â”† ---             â”‚|
            |â”‚ i64  â”† f64 â”† i64 â”† i64      â”† f64      â”† i64             â”‚|
            |â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡|
            |â”‚ 2    â”† 2.0 â”† 1   â”† 2        â”† 2.0      â”† 2               â”‚|
            |â”‚ null â”† NaN â”† 2   â”† 0        â”† NaN      â”† 2               â”‚|
            |â”‚ null â”† NaN â”† 3   â”† 0        â”† NaN      â”† 3               â”‚|
            |â”‚ 3    â”† 3.0 â”† 4   â”† 3        â”† 3.0      â”† 3               â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            Using a strategy:

            >>> df.select(
            ...     nw.col("a", "b"),
            ...     nw.col("a", "b")
            ...     .fill_null(strategy="forward", limit=1)
            ...     .name.suffix("_nulls_forward_filled"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |                       Narwhals DataFrame                       |
            |----------------------------------------------------------------|
            |shape: (4, 4)                                                   |
            |â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚ a    â”† b   â”† a_nulls_forward_filled â”† b_nulls_forward_filled â”‚|
            |â”‚ ---  â”† --- â”† ---                    â”† ---                    â”‚|
            |â”‚ i64  â”† f64 â”† i64                    â”† f64                    â”‚|
            |â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡|
            |â”‚ 2    â”† 2.0 â”† 2                      â”† 2.0                    â”‚|
            |â”‚ null â”† NaN â”† 2                      â”† NaN                    â”‚|
            |â”‚ null â”† NaN â”† null                   â”† NaN                    â”‚|
            |â”‚ 3    â”† 3.0 â”† 3                      â”† 3.0                    â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        z*cannot specify both `value` and `strategy`z0must specify either a fill `value` or `strategy`>   ÚforwardÚbackwardzstrategy not supported: c                ó,   •— t        | ˆˆfd„‰‰d¬«      S )Nc                 ó8   •— | d   j                  | d   ‰‰¬«      S )Nr   rí   )ÚstrategyÚlimit)Ú	fill_null)re  rt  rs  s    €€rB   rf   z2Expr.fill_null.<locals>.<lambda>.<locals>.<lambda>­  s&   ø€ ˜u Q™x×1Ñ1Ø˜!‘H x°uð  2ó  € rD   Trˆ   rc   )r>   rt  r@   rs  Úvalues    €€€€rB   rf   z Expr.fill_null.<locals>.<lambda>«  s    ø€ Ô-Øôð ØØô€ rD   )Ú
ValueErrorrJ   r=   rU   )r@   rv  rs  rt  rr   s   ```` rB   ru  zExpr.fill_nullU  s    û€ ðV Ð Ð!5Ø>ˆCÜ˜S“/Ð!Øˆ=˜XÐ-ØDˆCÜ˜S“/Ð!ØÐ HÐ4KÑ$KØ,¨X¨JÐ7ˆCÜ˜S“/Ð!à~‰~öð Ð#ð N‰N×0Ñ0Ó2ó
ð 	
ð —‘ó
ð 	
rD   c                ó0   ‡ ‡— ‰ j                  ˆ ˆfd„«      S )uâ  Fill floating point NaN values with given value.

        Arguments:
            value: Value used to fill NaN values.

        Notes:
            This function only fills `'NaN'` values, not null ones, except for pandas
            which doesn't distinguish between them.
            See [null_handling](../concepts/null_handling.md/) for reference.

        Examples:
            >>> import duckdb
            >>> import narwhals as nw
            >>> df_native = duckdb.sql(
            ...     "SELECT * FROM VALUES (5.::DOUBLE, 50.::DOUBLE), ('NaN', null) df(a, b)"
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(nw.col("a", "b").fill_nan(0).name.suffix("_nans_filled"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |                Narwhals LazyFrame                 |
            |---------------------------------------------------|
            |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚   a    â”‚   b    â”‚ a_nans_filled â”‚ b_nans_filled â”‚|
            |â”‚ double â”‚ double â”‚    double     â”‚    double     â”‚|
            |â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
            |â”‚    5.0 â”‚   50.0 â”‚           5.0 â”‚          50.0 â”‚|
            |â”‚    nan â”‚   NULL â”‚           0.0 â”‚          NULL â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óD   •— ‰j                  | «      j                  ‰«      S r;   )rF   Úfill_nan)r>   r@   rv  s    €€rB   rf   zExpr.fill_nan.<locals>.<lambda>Ù  s   ø€ ˜×/Ñ/°Ó4×=Ñ=¸eÓD€ rD   rä   )r@   rv  s   ``rB   rz  zExpr.fill_nan¹  s   ù€ ð> ×%Ñ%ÜDó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uˆ  Drop null values.

        Notes:
            pandas handles null values differently from Polars and PyArrow.
            See [null_handling](../concepts/null_handling.md/) for reference.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> df_native = pl.DataFrame({"a": [2.0, 4.0, float("nan"), 3.0, None, 5.0]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a").drop_nulls())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |  shape: (5, 1)   |
            |  â”Œâ”€â”€â”€â”€â”€â”         |
            |  â”‚ a   â”‚         |
            |  â”‚ --- â”‚         |
            |  â”‚ f64 â”‚         |
            |  â•žâ•â•â•â•â•â•¡         |
            |  â”‚ 2.0 â”‚         |
            |  â”‚ 4.0 â”‚         |
            |  â”‚ NaN â”‚         |
            |  â”‚ 3.0 â”‚         |
            |  â”‚ 5.0 â”‚         |
            |  â””â”€â”€â”€â”€â”€â”˜         |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Ú
drop_nullsrx   s    €rB   rf   z!Expr.drop_nulls.<locals>.<lambda>ü  rã   rD   r0  rm   s   `rB   r}  zExpr.drop_nullsÝ  s   ø€ ð< ×$Ñ$ÛAó
ð 	
rD   )Úorder_byc               ó  ‡ ‡‡— t        |«      Št        |t        «      r|gn|xs g Š‰s‰sd}t        |«      ‚‰ j                  }‰r|j                  «       }n‰sd}t        |«      ‚|j                  «       }‰ j                  ˆˆˆ fd„|«      S )u›  Compute expressions over the given groups (optionally with given order).

        Arguments:
            partition_by: 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`.
            order_by: Column(s) to order window functions by.
                For lazy backends, this argument is required when `over` is applied
                to order-dependent functions, see [order-dependence](../concepts/order_dependence.md).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 4], "b": ["x", "x", "y"]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_min_per_group=nw.col("a").min().over("b"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |   Narwhals DataFrame   |
            |------------------------|
            |   a  b  a_min_per_group|
            |0  1  x                1|
            |1  2  x                1|
            |2  4  y                4|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

            Cumulative operations are also supported, but (currently) only for
            pandas and Polars:

            >>> df.with_columns(a_cum_sum_per_group=nw.col("a").cum_sum().over("b"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |     Narwhals DataFrame     |
            |----------------------------|
            |   a  b  a_cum_sum_per_group|
            |0  1  x                    1|
            |1  2  x                    3|
            |2  4  y                    4|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        z?At least one of `partition_by` or `order_by` must be specified.c                óF   •— ‰j                  | «      j                  ‰‰«      S r;   )rF   Úover)r>   Úflat_order_byÚflat_partition_byr@   s    €€€rB   rf   zExpr.over.<locals>.<lambda>:  s"   ø€ ˜×/Ñ/°Ó4×9Ñ9Ø! =ó€ rD   )	r   rK  r]  rw  r=   Úwith_ordered_overr   Úwith_partitioned_overrJ   )r@   r~  Úpartition_byrr   Úcurrent_metaÚ	next_metar‚  rƒ  s   `     @@rB   r  z	Expr.overÿ  s’   ú€ ôV $ LÓ1ÐÜ&0°¼3Ô&?˜™
ÀhÂnÐRTˆÙ ©ØSˆCÜ˜S“/Ð!à—~‘~ˆÙØ$×6Ñ6Ó8‰IÙ"ØSˆCÜ'¨Ó,Ð,à$×:Ñ:Ó<ˆIà~‰~õð ó	
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Return a boolean mask indicating duplicated values.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(nw.all().is_duplicated().name.suffix("_is_duplicated"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |           Narwhals DataFrame            |
            |-----------------------------------------|
            |   a  b  a_is_duplicated  b_is_duplicated|
            |0  1  a             True             True|
            |1  2  a            False             True|
            |2  3  b            False            False|
            |3  1  c             True            False|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úis_duplicatedrx   s    €rB   rf   z$Expr.is_duplicated.<locals>.<lambda>S  s   ø€ ¨T×-DÑ-DÀSÓ-I×-WÑ-WÓ-Y€ rD   ©rY   rm   s   `rB   r‹  zExpr.is_duplicated@  s   ø€ ð& × Ñ Ó!YÓZÐZrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u©  Return a boolean mask indicating unique values.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(nw.all().is_unique().name.suffix("_is_unique"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |       Narwhals DataFrame        |
            |---------------------------------|
            |   a  b  a_is_unique  b_is_unique|
            |0  1  a        False        False|
            |1  2  a         True        False|
            |2  3  b         True         True|
            |3  1  c        False         True|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Ú	is_uniquerx   s    €rB   rf   z Expr.is_unique.<locals>.<lambda>h  s   ø€ ¨T×-DÑ-DÀSÓ-I×-SÑ-SÓ-U€ rD   rŒ  rm   s   `rB   r  zExpr.is_uniqueU  s   ø€ ð& × Ñ Ó!UÓVÐVrD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Count null values.

        Notes:
            pandas handles null values differently from Polars and PyArrow.
            See [null_handling](../concepts/null_handling.md/) for reference.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame(
            ...     {"a": [1, 2, None, 1], "b": ["a", None, "b", None]}
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.all().null_count())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a  b      |
            |     0  1  2      |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Ú
null_countrx   s    €rB   rf   z!Expr.null_count.<locals>.<lambda>  rã   rD   ry   rm   s   `rB   r’  zExpr.null_countj  s   ø€ ð, ×%Ñ%ÛAó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uŠ  Return a boolean mask indicating the first occurrence of each distinct value.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.all().is_first_distinct().name.suffix("_is_first_distinct")
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |               Narwhals DataFrame                |
            |-------------------------------------------------|
            |   a  b  a_is_first_distinct  b_is_first_distinct|
            |0  1  a                 True                 True|
            |1  2  a                 True                False|
            |2  3  b                 True                 True|
            |3  1  c                False                 True|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úis_first_distinctrx   s    €rB   rf   z(Expr.is_first_distinct.<locals>.<lambda>ž  s   ø€ ˜×/Ñ/°Ó4×FÑFÓH€ rD   rù   rm   s   `rB   r•  zExpr.is_first_distinct„  s   ø€ ð2 ×*Ñ*ÛHó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )um  Return a boolean mask indicating the last occurrence of each distinct value.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3, 1], "b": ["a", "a", "b", "c"]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.all().is_last_distinct().name.suffix("_is_last_distinct")
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |              Narwhals DataFrame               |
            |-----------------------------------------------|
            |   a  b  a_is_last_distinct  b_is_last_distinct|
            |0  1  a               False               False|
            |1  2  a                True                True|
            |2  3  b                True                True|
            |3  1  c                True                True|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úis_last_distinctrx   s    €rB   rf   z'Expr.is_last_distinct.<locals>.<lambda>»  s   ø€ ˜×/Ñ/°Ó4×EÑEÓG€ rD   rù   rm   s   `rB   r˜  zExpr.is_last_distinct¡  s   ø€ ð2 ×*Ñ*ÛGó
ð 	
rD   c                ó4   ‡ ‡‡— ‰ j                  ˆˆˆ fd„«      S )uØ  Get quantile value.

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

        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 pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame(
            ...     {"a": list(range(50)), "b": list(range(50, 100))}
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a", "b").quantile(0.5, interpolation="linear"))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |        a     b   |
            |  0  24.5  74.5   |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰‰«      S r;   )rF   Úquantile)r>   Úinterpolationr›  r@   s    €€€rB   rf   zExpr.quantile.<locals>.<lambda>Þ  s   ø€ ˜×/Ñ/°Ó4×=Ñ=¸hÈÓV€ rD   ry   )r@   r›  rœ  s   ```rB   r›  zExpr.quantile¾  s   ú€ ð> ×%Ñ%ÝVó
ð 	
rD   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uÀ  Round underlying floating point data by `decimals` digits.

        Arguments:
            decimals: Number of decimals to round by.


        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 pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1.12345, 2.56789, 3.901234]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_rounded=nw.col("a").round(1))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |  Narwhals DataFrame  |
            |----------------------|
            |          a  a_rounded|
            |0  1.123450        1.1|
            |1  2.567890        2.6|
            |2  3.901234        3.9|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óD   •— ‰j                  | «      j                  ‰«      S r;   )rF   Úround)r>   Údecimalsr@   s    €€rB   rf   zExpr.round.<locals>.<lambda>   s   ø€ ˜×/Ñ/°Ó4×:Ñ:¸8ÓD€ rD   rä   )r@   r   s   ``rB   rŸ  z
Expr.roundá  s   ù€ ð< ×%Ñ%ÜDó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u  Return the number of elements in the column.

        Null values count towards the total.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": ["x", "y", "z"], "b": [1, 2, 1]})
            >>> df = nw.from_native(df_native)
            >>> df.select(
            ...     nw.col("a").filter(nw.col("b") == 1).len().alias("a1"),
            ...     nw.col("a").filter(nw.col("b") == 2).len().alias("a2"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |       a1  a2     |
            |    0   2   1     |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úlenrx   s    €rB   rf   zExpr.len.<locals>.<lambda>  rè   rD   ry   rm   s   `rB   r£  zExpr.len  ó   ø€ ð* ×%Ñ%Ó&TÓUÐUrD   c                ó4   ‡‡— | j                  ˆˆfd„‰‰«      S )uK  Clip values in the Series.

        Arguments:
            lower_bound: Lower bound value. String literals are treated as column names.
            upper_bound: Upper bound value. String literals are treated as column names.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 2, 3]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_clipped=nw.col("a").clip(-1, 3))
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |    a  a_clipped  |
            | 0  1          1  |
            | 1  2          2  |
            | 2  3          3  |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                 óR   •— | d   j                  ‰| d   nd ‰	| d   «      S d «      S )Nr   rí   é   )Úclip)re  rW  rX  s    €€rB   rf   zExpr.clip.<locals>.<lambda>5  s8   ø€ ˜5 ™8Ÿ=™=Ø'Ð3a’¸Ø'Ð3a‘ó€ à9=ó€ rD   rV  )r@   rW  rX  s    ``rB   r¨  z	Expr.clip  s#   ù€ ð4 ‰ôð Øó
ð 	
rD   rì   ©Úkeepc               ó–   ‡ ‡— d}‰|vrd|› d‰› d}t        |«      ‚dˆˆ fd„}‰dk(  r‰ j                  |«      S ‰ j                  |«      S )u%  Compute the most occurring value(s).

        Can return multiple values.

        Arguments:
            keep: Whether to keep all modes or any mode found. Remark that `keep='any'`
                is not deterministic for multimodal values.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 1, 2, 3], "b": [1, 1, 2, 2]})
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("a").mode()).sort("a")
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |          a       |
            |       0  1       |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )rì   rç   z`keep` must be one of z	, found 'ú'c                óF   •— ‰j                  | «      j                  ‰¬«      S )Nr©  )rF   Úmode)r>   rª  r@   s    €€rB   r  z!Expr.mode.<locals>.compliant_exprX  s"   ø€ Ø×*Ñ*¨3Ó/×4Ñ4¸$Ð4Ó?Ð?rD   rç   r  )rw  rP   r\   )r@   rª  Ú_supported_keep_valuesrr   r  s   ``   rB   r®  z	Expr.mode=  sf   ù€ ð, "0ÐØÐ-Ñ-Ø*Ð+AÐ*BÀ)ÈDÈ6ÐQRÐSˆCÜ˜S“/Ð!ö	@ð 5Š=Ø×)Ñ)¨.Ó9Ð9Ø×$Ñ$ ^Ó4Ð4rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u2  Returns boolean values indicating which original values are finite.

        Warning:
            pandas handles null values differently from Polars and PyArrow.
            See [null_handling](../concepts/null_handling.md/) for reference.
            `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.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> df_native = pl.DataFrame({"a": [float("nan"), float("inf"), 2.0, None]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(a_is_finite=nw.col("a").is_finite())
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |  Narwhals DataFrame  |
            |----------------------|
            |shape: (4, 2)         |
            |â”Œâ”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚ a    â”† a_is_finite â”‚|
            |â”‚ ---  â”† ---         â”‚|
            |â”‚ f64  â”† bool        â”‚|
            |â•žâ•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•¡|
            |â”‚ NaN  â”† false       â”‚|
            |â”‚ inf  â”† false       â”‚|
            |â”‚ 2.0  â”† true        â”‚|
            |â”‚ null â”† null        â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Ú	is_finiterx   s    €rB   rf   z Expr.is_finite.<locals>.<lambda>€  s   ø€ ˜×/Ñ/°Ó4×>Ñ>Ó@€ rD   rä   rm   s   `rB   r²  zExpr.is_finite_  s   ø€ ð@ ×%Ñ%Û@ó
ð 	
rD   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uˆ  Return the cumulative count of the non-null values in the column.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            reverse: reverse the operation

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": ["x", "k", None, "d"]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.col("a").cum_count().alias("a_cum_count"),
            ...     nw.col("a").cum_count(reverse=True).alias("a_cum_count_reverse"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |           Narwhals DataFrame            |
            |-----------------------------------------|
            |      a  a_cum_count  a_cum_count_reverse|
            |0     x            1                    3|
            |1     k            2                    2|
            |2  None            2                    1|
            |3     d            3                    1|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S r7  )rF   Ú	cum_countr9  s    €€rB   rf   z Expr.cum_count.<locals>.<lambda>¡  s    ø€ ˜×/Ñ/°Ó4×>Ñ>ÀwÐ>ÓO€ rD   rù   r;  s   ``rB   rµ  zExpr.cum_countƒ  s   ù€ ð: ×*Ñ*ÜOó
ð 	
rD   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u7  Return the cumulative min of the non-null values in the column.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            reverse: reverse the operation

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [3, 1, None, 2]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.col("a").cum_min().alias("a_cum_min"),
            ...     nw.col("a").cum_min(reverse=True).alias("a_cum_min_reverse"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |         Narwhals DataFrame         |
            |------------------------------------|
            |     a  a_cum_min  a_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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S r7  )rF   Úcum_minr9  s    €€rB   rf   zExpr.cum_min.<locals>.<lambda>Â  r:  rD   rù   r;  s   ``rB   r¸  zExpr.cum_min¤  ó   ù€ ð: ×*Ñ*ÜMó
ð 	
rD   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )u7  Return the cumulative max of the non-null values in the column.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            reverse: reverse the operation

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 3, None, 2]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.col("a").cum_max().alias("a_cum_max"),
            ...     nw.col("a").cum_max(reverse=True).alias("a_cum_max_reverse"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |         Narwhals DataFrame         |
            |------------------------------------|
            |     a  a_cum_max  a_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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S r7  )rF   Úcum_maxr9  s    €€rB   rf   zExpr.cum_max.<locals>.<lambda>ã  r:  rD   rù   r;  s   ``rB   r¼  zExpr.cum_maxÅ  r¹  rD   c               ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uY  Return the cumulative product of the non-null values in the column.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            reverse: reverse the operation

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1, 3, None, 2]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     nw.col("a").cum_prod().alias("a_cum_prod"),
            ...     nw.col("a").cum_prod(reverse=True).alias("a_cum_prod_reverse"),
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |          Narwhals DataFrame          |
            |--------------------------------------|
            |     a  a_cum_prod  a_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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S r7  )rF   Úcum_prodr9  s    €€rB   rf   zExpr.cum_prod.<locals>.<lambda>  s    ø€ ˜×/Ñ/°Ó4×=Ñ=ÀgÐ=ÓN€ rD   rù   r;  s   ``rB   r¿  zExpr.cum_prodæ  s   ù€ ð: ×*Ñ*ÜNó
ð 	
rD   )rô   Úcenterc               óX   ‡ ‡‡‡— t        ‰|¬«      \  ŠŠ‰ j                  ˆˆˆ ˆfd„«      S )u   Apply a rolling sum (moving sum) over the values.

        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.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            window_size: The length of the window in number of elements. It must be a
                strictly positive integer.
            min_samples: 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.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1.0, 2.0, None, 4.0]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     a_rolling_sum=nw.col("a").rolling_sum(window_size=3, min_samples=1)
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            | Narwhals DataFrame  |
            |---------------------|
            |     a  a_rolling_sum|
            |0  1.0            1.0|
            |1  2.0            3.0|
            |2  NaN            3.0|
            |3  4.0            6.0|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        ©Úwindow_sizerô   c                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S ©N)rÃ  rô   rÀ  )rF   Úrolling_sum)r>   rÀ  Úmin_samples_intr@   rÃ  s    €€€€rB   rf   z"Expr.rolling_sum.<locals>.<lambda>6  s*   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø'°_ÈVð Aó € rD   ©r   rV   )r@   rÃ  rô   rÀ  rÇ  s   `` `@rB   rÆ  zExpr.rolling_sum  s5   û€ ôT (CØ#°ô(
Ñ$ˆ_ð ×*Ñ*öó
ð 	
rD   c               óX   ‡ ‡‡‡— t        ‰‰¬«      \  ŠŠ‰ j                  ˆˆˆ ˆfd„«      S )u  Apply a rolling mean (moving mean) over the values.

        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.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            window_size: The length of the window in number of elements. It must be a
                strictly positive integer.
            min_samples: 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.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1.0, 2.0, None, 4.0]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     a_rolling_mean=nw.col("a").rolling_mean(window_size=3, min_samples=1)
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |  Narwhals DataFrame  |
            |----------------------|
            |     a  a_rolling_mean|
            |0  1.0             1.0|
            |1  2.0             1.5|
            |2  NaN             1.5|
            |3  4.0             3.0|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        rÂ  c                óJ   •— ‰j                  | «      j                  ‰‰‰¬«      S rÅ  )rF   Úrolling_mean)r>   rÀ  rô   r@   rÃ  s    €€€€rB   rf   z#Expr.rolling_mean.<locals>.<lambda>j  s*   ø€ ˜×/Ñ/°Ó4×AÑAØ'°[Èð Bó € rD   rÈ  )r@   rÃ  rô   rÀ  s   ````rB   rË  zExpr.rolling_mean;  s4   û€ ôT $?Ø#°ô$
Ñ ˆ[ð ×*Ñ*öó
ð 	
rD   )rô   rÀ  r  c               ó\   ‡ ‡‡‡‡— t        ‰‰¬«      \  ŠŠ‰ j                  ˆˆˆˆ ˆfd„«      S )uk  Apply a rolling variance (moving variance) over the values.

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

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

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            window_size: The length of the window in number of elements. It must be a
                strictly positive integer.
            min_samples: 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.
            ddof: Delta Degrees of Freedom; the divisor for a length N window is N - ddof.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1.0, 2.0, None, 4.0]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     a_rolling_var=nw.col("a").rolling_var(window_size=3, min_samples=1)
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            | Narwhals DataFrame  |
            |---------------------|
            |     a  a_rolling_var|
            |0  1.0            NaN|
            |1  2.0            0.5|
            |2  NaN            0.5|
            |3  4.0            2.0|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        rÂ  c                óL   •— ‰j                  | «      j                  ‰‰‰‰¬«      S ©N)rÃ  rô   rÀ  r  )rF   Úrolling_var©r>   rÀ  r  rô   r@   rÃ  s    €€€€€rB   rf   z"Expr.rolling_var.<locals>.<lambda>¤  ó-   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø'°[ÈÐVZð Aó € rD   rÈ  ©r@   rÃ  rô   rÀ  r  s   `````rB   rÏ  zExpr.rolling_varo  ó4   ü€ ô` $?Ø#°ô$
Ñ ˆ[ð ×*Ñ*÷ó
ð 	
rD   c               ó\   ‡ ‡‡‡‡— t        ‰‰¬«      \  ŠŠ‰ j                  ˆˆˆˆ ˆfd„«      S )u‰  Apply a rolling standard deviation (moving standard deviation) over the values.

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

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

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            window_size: The length of the window in number of elements. It must be a
                strictly positive integer.
            min_samples: 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.
            ddof: Delta Degrees of Freedom; the divisor for a length N window is N - ddof.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [1.0, 2.0, None, 4.0]})
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     a_rolling_std=nw.col("a").rolling_std(window_size=3, min_samples=1)
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            | Narwhals DataFrame  |
            |---------------------|
            |     a  a_rolling_std|
            |0  1.0            NaN|
            |1  2.0       0.707107|
            |2  NaN       0.707107|
            |3  4.0       1.414214|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        rÂ  c                óL   •— ‰j                  | «      j                  ‰‰‰‰¬«      S rÎ  )rF   Úrolling_stdrÐ  s    €€€€€rB   rf   z"Expr.rolling_std.<locals>.<lambda>Þ  rÑ  rD   rÈ  rÒ  s   `````rB   rÖ  zExpr.rolling_std©  rÓ  rD   )Ú
descendingc               óf   ‡ ‡‡— h d£}‰|vrd‰› d}t        |«      ‚‰ j                  ˆˆˆ fd„«      S )uP  Assign ranks to data, dealing with ties appropriately.

        Notes:
            The resulting dtype may differ between backends.

        Info:
            For lazy backends, this operation must be followed by `Expr.over` with
            `order_by` specified, see [order-dependence](../concepts/order_dependence.md).

        Arguments:
            method: The method used to assign ranks to tied elements.
                The following methods are available (default is 'average')

                - *"average"*: The average of the ranks that would have been assigned to
                    all the tied values is assigned to each value.
                - *"min"*: The minimum of the ranks that would have been assigned to all
                    the tied values is assigned to each value. (This is also referred to
                    as "competition" ranking.)
                - *"max"*: The maximum of the ranks that would have been assigned to all
                    the tied values is assigned to each value.
                - *"dense"*: Like "min", but the rank of the next highest element is
                    assigned the rank immediately after those assigned to the tied elements.
                - *"ordinal"*: All values are given a distinct rank, corresponding to the
                    order that the values occur in the Series.

            descending: Rank in descending order.

        Examples:
            >>> import pandas as pd
            >>> import narwhals as nw
            >>> df_native = pd.DataFrame({"a": [3, 6, 1, 1, 6]})
            >>> df = nw.from_native(df_native)
            >>> result = df.with_columns(rank=nw.col("a").rank(method="dense"))
            >>> result
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |       a  rank    |
            |    0  3   2.0    |
            |    1  6   3.0    |
            |    2  1   1.0    |
            |    3  1   1.0    |
            |    4  6   3.0    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        >   r&  r"  ÚdenseÚaverageÚordinalzTRanking method must be one of {'average', 'min', 'max', 'dense', 'ordinal'}. Found 'r¬  c                óH   •— ‰j                  | «      j                  ‰‰¬«      S )N)Úmethodr×  )rF   Úrank)r>   r×  rÝ  r@   s    €€€rB   rf   zExpr.rank.<locals>.<lambda>  s'   ø€ ˜×/Ñ/°Ó4×9Ñ9Ø¨*ð :ó € rD   )rw  rY   )r@   rÝ  r×  Úsupported_rank_methodsrr   s   ```  rB   rÞ  z	Expr.rankã  sP   ú€ ò\ "OÐØÐ/Ñ/ðØ ˜ ð$ð ô ˜S“/Ð!à× Ñ õó
ð 	
rD   c                ó0   ‡ ‡— ‰ j                  ˆˆ fd„«      S )uœ  Compute the logarithm to a given base.

        Arguments:
            base: Given base, defaults to `e`

        Examples:
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> df_native = pa.table({"values": [1, 2, 4]})
            >>> df = nw.from_native(df_native)
            >>> result = df.with_columns(
            ...     log=nw.col("values").log(), log_2=nw.col("values").log(base=2)
            ... )
            >>> result
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |               Narwhals DataFrame               |
            |------------------------------------------------|
            |pyarrow.Table                                   |
            |values: int64                                   |
            |log: double                                     |
            |log_2: double                                   |
            |----                                            |
            |values: [[1,2,4]]                               |
            |log: [[0,0.6931471805599453,1.3862943611198906]]|
            |log_2: [[0,1,2]]                                |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óF   •— ‰j                  | «      j                  ‰¬«      S )N)Úbase)rF   Úlog)r>   râ  r@   s    €€rB   rf   zExpr.log.<locals>.<lambda><  r
  rD   rä   )r@   râ  s   ``rB   rã  zExpr.log  s   ù€ ð8 ×%Ñ%ÜCó
ð 	
rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )u‚  Compute the exponent.

        Examples:
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> df_native = pa.table({"values": [-1, 0, 1]})
            >>> df = nw.from_native(df_native)
            >>> result = df.with_columns(exp=nw.col("values").exp())
            >>> result
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |               Narwhals DataFrame               |
            |------------------------------------------------|
            |pyarrow.Table                                   |
            |values: int64                                   |
            |exp: double                                     |
            |----                                            |
            |values: [[-1,0,1]]                              |
            |exp: [[0.36787944117144233,1,2.718281828459045]]|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úexprx   s    €rB   rf   zExpr.exp.<locals>.<lambda>T  rè   rD   rä   rm   s   `rB   ræ  zExpr.exp?  r¤  rD   c                ó,   ‡ — ‰ j                  ˆ fd„«      S )uâ  Compute the square root.

        Examples:
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>> df_native = pa.table({"values": [1, 4, 9]})
            >>> df = nw.from_native(df_native)
            >>> result = df.with_columns(sqrt=nw.col("values").sqrt())
            >>> result
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |Narwhals DataFrame|
            |------------------|
            |pyarrow.Table     |
            |values: int64     |
            |sqrt: double      |
            |----              |
            |values: [[1,4,9]] |
            |sqrt: [[1,2,3]]   |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        c                óB   •— ‰j                  | «      j                  «       S r;   )rF   Úsqrtrx   s    €rB   rf   zExpr.sqrt.<locals>.<lambda>k  rý   rD   rä   rm   s   `rB   ré  z	Expr.sqrtV  s   ø€ ð* ×%Ñ%Ó&UÓVÐVrD   g        g•Ö&è.>©Úabs_tolÚrel_tolÚ
nans_equalc               óž   ‡— |dk  rd|› }t        |«      ‚d|cxk  rdk  sn d|› }t        |«      ‚|||dœŠ| j                  ˆfd„|«      S )uB
  Check if this expression is close, i.e. almost equal, to the other expression.

        Two values `a` and `b` are considered close if the following condition holds:

        $$
        |a-b| \le max \{ \text{rel\_tol} \cdot max \{ |a|, |b| \}, \text{abs\_tol} \}
        $$

        Arguments:
            other: Values to compare with.
            abs_tol: Absolute tolerance. This is the maximum allowed absolute difference
                between two values. Must be non-negative.
            rel_tol: Relative tolerance. This is the maximum allowed difference between
                two values, relative to the larger absolute value. Must be in the range
                [0, 1).
            nans_equal: Whether NaN values should be considered equal.

        Notes:
            The implementation of this method is symmetric and mirrors the behavior of
            `math.isclose`. Specifically note that this behavior is different to
            `numpy.isclose`.

        Examples:
            >>> import duckdb
            >>> import pyarrow as pa
            >>> import narwhals as nw
            >>>
            >>> data = {
            ...     "x": [1.0, float("inf"), 1.41, None, float("nan")],
            ...     "y": [1.2, float("inf"), 1.40, None, float("nan")],
            ... }
            >>> _table = pa.table(data)
            >>> df_native = duckdb.table("_table")
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(
            ...     is_close=nw.col("x").is_close(
            ...         nw.col("y"), abs_tol=0.1, nans_equal=True
            ...     )
            ... )
            â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
            |      Narwhals LazyFrame      |
            |------------------------------|
            |â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”|
            |â”‚   x    â”‚   y    â”‚ is_close â”‚|
            |â”‚ double â”‚ double â”‚ boolean  â”‚|
            |â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”¼â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤|
            |â”‚    1.0 â”‚    1.2 â”‚ false    â”‚|
            |â”‚    inf â”‚    inf â”‚ true     â”‚|
            |â”‚   1.41 â”‚    1.4 â”‚ true     â”‚|
            |â”‚   NULL â”‚   NULL â”‚ NULL     â”‚|
            |â”‚    nan â”‚    nan â”‚ true     â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        r   z'`abs_tol` must be non-negative but got rí   z.`rel_tol` must be in the range [0, 1) but got rê  c                 ó6   •—  | d   j                   | d   fi ‰¤ŽS rc  )Úis_close)re  r‚   s    €rB   rf   zExpr.is_close.<locals>.<lambda>µ  s"   ø€ Ð,˜5 ™8×,Ñ,¨U°1©XÑ@¸Ñ@€ rD   )r   rj   )r@   r‹   rë  rì  rí  rr   r‚   s         @rB   rð  zExpr.is_closem  sj   ø€ ð| QŠ;Ø;¸G¸9ÐEˆCÜ˜sÓ#Ð#àWÔ ˜qÔ ØBÀ7À)ÐLˆCÜ˜sÓ#Ð#à$°È
ÑSˆØ‰Û@À%ó
ð 	
rD   c                ó   — t        | «      S r;   r   rm   s    rB   r]  zExpr.str¸  ó   € ä" 4Ó(Ð(rD   c                ó   — t        | «      S r;   r   rm   s    rB   ÚdtzExpr.dt¼  s   € ä$ TÓ*Ð*rD   c                ó   — t        | «      S r;   r   rm   s    rB   ÚcatzExpr.catÀ  s   € ä Ó%Ð%rD   c                ó   — t        | «      S r;   r   rm   s    rB   r~   z	Expr.nameÄ  ó   € ä  Ó&Ð&rD   c                ó   — t        | «      S r;   r   rm   s    rB   rL  z	Expr.listÈ  rø  rD   c                ó   — t        | «      S r;   r   rm   s    rB   ÚstructzExpr.structÌ  rò  rD   )rA   r6   rG   r
   rE   ÚNone)rA   zCallable[[Any], Any]rE   r$   )re   zCallable[..., Any]rd   z&IntoExpr | NonNestedLiteral | _1DArrayrE   r$   )rE   r]  )rE   r    )rE   r$   )r~   r]  rE   r$   )r   z"Callable[Concatenate[Self, PS], R]rd   zPS.argsr‚   z	PS.kwargsrE   r5   )r‡   r+   rE   r$   )r   zCallable[[Any, Any], Any]r‹   ú
Self | Anyrb   ÚboolrE   r$   )r‹   rý  rE   r$   )r‹   r   rE   r$   )rï   úfloat | Nonerð   rÿ  rñ   rÿ  rò   rÿ  ró   rþ  rô   rD  rõ   rþ  rE   r$   )r  rD  rE   r$   r;   )r   z(Callable[[Any], CompliantExpr[Any, Any]]r  zDType | Noner  rþ  rE   r$   )rE   r8   )r4  rþ  rE   r$   )r@  rD  rE   r$   )rJ  z!Sequence[Any] | Mapping[Any, Any]rI  zSequence[Any] | Noner  zIntoDType | NonerE   r$   )Úboth)rW  úAny | IntoExprrX  r  rQ  r)   rE   r$   )rg  r   rE   r$   )NNN)rv  zExpr | NonNestedLiteralrs  zFillNullStrategy | Nonert  ú
int | NonerE   r$   )rv  rÿ  rE   r$   )r†  zstr | Sequence[str]r~  zstr | Sequence[str] | NonerE   r$   )r›  Úfloatrœ  r1   rE   r$   )r   )r   rD  rE   r$   )NN)rW  ú2IntoExpr | NumericLiteral | TemporalLiteral | NonerX  r  rE   r$   )rª  r-   rE   r$   )rÃ  rD  rô   r  rÀ  rþ  rE   r$   )
rÃ  rD  rô   r  rÀ  rþ  r  rD  rE   r$   )rÚ  )rÝ  r0   r×  rþ  rE   r$   )râ  r  rE   r$   )
r‹   zSelf | NumericLiteralrë  r  rì  r  rí  rþ  rE   r$   )rE   zExprStringNamespace[Self])rE   zExprDateTimeNamespace[Self])rE   zExprCatNamespace[Self])rE   zExprNameNamespace[Self])rE   zExprListNamespace[Self])rE   zExprStructNamespace[Self])kÚ__name__Ú
__module__Ú__qualname__rH   rM   rP   rS   rV   rY   r\   r_   rj   rn   rs   rz   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  rw   r"  r&  r)  r,  r/  rv   r8  r>  rC  rH  rR  r\  rd  rj  rm  ru  rz  r}  r  r‹  r  r’  r•  r˜  r›  rŸ  r£  r¨  r®  r²  rµ  r¸  r¼  r¿  rÆ  rË  rÏ  rÖ  rÞ  ÚmathÚerã  ræ  ré  rð  Úpropertyr]  rô  rö  r~   rL  rû  r€   rD   rB   r8   r8   4   sé  „ ó"óWóTð
Ø!5ð
à	ó
óYóOóSó
ð

à*ð
ð 6ð
ð 
ó	
ó$>óó
ó
ð2/à4ð/ð ð/ð ð	/ð
 
ó/ó>
ð@  ñ
à+ð
ð ð
ð
 ð
ð 
ó
ó/ó/ó1ó/ó0ó/ó0ó/ó0óDó4óHó0ó/ó/ó/ó/ó/ó0óDó5óIó0óDó
ó
Vó(Vð. !Ø!Ø"&Ø"ØØØ"ñ]
ð ð]
ð ð	]
ð
  ð]
ð ð]
ð ð]
ð ð]
ð ð]
ð 
ó]
ó~Wó$Yð* "#õ 
ð0 "#õ 
ð6 &*ð5?ð
  %ñ5?à:ð5?ð #ð5?ð
 ð5?ð 
ó5?ónWó$[ó*Vó0Vó$Vó$Xó$[ó$Xó$Vð& */õ 
ó>)
óV.
ðf %)ð6
ð
 *.ñ6
à.ð6
ð "ð6
ð
 'ð6
ð 
ó6
ðz "(ð	"
à#ð"
ð $ð"
ð ð	"
ð
 
ó"
óH'ó>+
óZZó>YðB *.Ø,0Ø ð	b
à&ðb
ð *ðb
ð ð	b
ð
 
ób
óH!
óH 
ðJ 04ñ?
à*ð?
ð -ð?
ð 
ó	?
óB[ó*Wó*
ó4
ó:
ð:!
Øð!
Ø.Hð!
à	ó!
ôF 
óDVð2 KOØJNð!
àGð!
ð Hð!
ð 
ó	!
ðF 05õ  5óD"
ðH ,1õ 
ðB */õ 
ðB */õ 
ðB +0õ 
ðD >BÐRWñ2
Øð2
Ø0:ð2
ØKOð2
à	ó2
ðj >BÐRWñ2
Øð2
Ø0:ð2
ØKOð2
à	ó2
ðp #'ØØñ8
àð8
ð  ð	8
ð
 ð8
ð ð8
ð 
ó8
ð| #'ØØñ8
àð8
ð  ð	8
ð
 ð8
ð ð8
ð 
ó8
ðt:
Èõ :
ðx !%§¡ô 
ó@Vó.Wð6 ØØ ñI
à$ðI
ð ð	I
ð
 ðI
ð ðI
ð 
óI
ðV ò)ó ð)ð ò+ó ð+ð ò&ó ð&ð ò'ó ð'ð ò'ó ð'ð ò)ó ñ)rD   r8   )EÚ
__future__r   r  Úoperatorr   Úcollections.abcr   r   r   Útypingr   r   r	   Únarwhals._expression_parsingr
   r   r   Únarwhals._utilsr   r   r   Únarwhals.dtypesr   Únarwhals.exceptionsr   r   Únarwhals.expr_catr   Únarwhals.expr_dtr   Únarwhals.expr_listr   Únarwhals.expr_namer   Únarwhals.expr_strr   Únarwhals.expr_structr   Únarwhals.translater   r    r!   Útyping_extensionsr"   r#   r$   r%   Únarwhals._compliantr&   r'   r(   Únarwhals.typingr)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   Ú__annotations__r8   Ú__all__r€   rD   rB   ú<module>r     sÇ   ðÞ "ã Û ß 7Ñ 7ß /Ñ /÷ñ ÷
 NÑ MÝ +ß CÝ .Ý 2Ý 0Ý 0Ý 1Ý 4Ý (áß(çIÓIçEÝ%÷÷ ÷ ñ ñ 
4‹€BÙ‹€AØ&Ø	˜C ˜HÑ	%Ð&¨°c¸3°hÑ(?Ð?ñ€L)ó ÷
Z")ñ Z")ðzD ˆ(rD   