ó
    Îïh(™ ã                  ó€  • % S SK Jr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SK	J
r
  S S	K	Jr  S S
K	Jr  S SK	Jr  S SK	Jr  S SK	Jr  S SK	Jr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SK J!r!  S SK"J#r#  S SK$J%r%  S SK$J&r&  S SK$J'r'  \(       a‡  S SKJ(r(  S SK)J*r*  S SK)J+r+  S SK)J,r,  S S K)J-r-  S S!K.J/r/  S S"K.J0r0  S S#KJ1r1  S S$K2J3r3  S S%K2J4r4  S S&K2J5r5  S S'K2J6r6  S S(K2J7r7  S S)K2J8r8  S S*K2J9r9  S S+K2J:r:  \+" S,5      r;\(" S-5      r<\\0\\4   /\/\\4   4   r=S.\>S/'    " S0 S15      r?S1/r@g2)3é    )Úannotations)ÚTYPE_CHECKING)ÚAny)ÚCallable)ÚIterable)ÚMapping)ÚSequence)ÚExprKind)ÚExprMetadata)Ú
WindowKind©Úapply_n_ary_operation)Úcombine_metadata)Úcombine_metadata_binary_op)Úextract_compliant)Ú_validate_dtype)ÚInvalidOperationError)ÚLengthChangingExprError©ÚExprCatNamespace©ÚExprDateTimeNamespace©ÚExprListNamespace©ÚExprNameNamespace©ÚExprStringNamespace©ÚExprStructNamespace)Ú	to_native)Ú_validate_rolling_arguments)Úflatten)Úissue_deprecation_warning)ÚTypeVar)ÚConcatenate)Ú	ParamSpec)ÚSelf)Ú	TypeAlias)ÚCompliantExpr)ÚCompliantNamespace)ÚDType)ÚClosedInterval)ÚFillNullStrategy)ÚIntoExpr)ÚNonNestedLiteral)ÚNumericLiteral)Ú
RankMethod)ÚRollingInterpolationMethod)ÚTemporalLiteralÚPSÚRr)   Ú_ToCompliantc                  óÚ  • \ rS rSrSrS jrSsS jrSsS jr    SsS jrSsS jrStS jr	SuS jr
SvS	 jr        SwS
 jrSxS jrSyS jrSyS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jrSzS jr SzS jr!SzS  jr"SzS! jr#SzS" jr$SzS# jr%SuS$ jr&SuS% jr'SuS& jr(S'S'S'S'S(S)S*S+.               S{S, jjr)SuS- jr*SuS. jr+S)S/.S|S0 jjr,S)S/.S|S1 jjr- S}     S~S2 jjr.SuS3 jr/SS4 jr0SuS5 jr1SuS6 jr2SuS7 jr3SuS8 jr4SuS9 jr5SuS: jr6SuS; jr7SuS< jr8S*S=.S€S> jjr9SuS? jr:SS@ jr; S}S'SA.       S‚SB jjjr<S*S*SC.SƒSD jjr= S„       S…SE jjr>SzSF jr?S†SG jr@SuSH jrASuSI jrBSuSJ jrC   S‡       SˆSK jjrDSuSL jrE S}S'S*S'SM.         S‰SN jjjrFS'SO.     SŠSP jjrGSuSQ jrHSuSR jrISuSS jrJSuST jrKSuSU jrL      S‹SV jrMSŒSSW jjrNSŒSSX jjrOSSŽSY jjrPSuSZ jrQSSS[ jjrR  S     S‘S\ jjrSSuS] jrTSuS^ jrUS*S=.S€S_ jjrVS*S=.S€S` jjrWS*S=.S€Sa jjrXS*S=.S€Sb jjrYS'S*Sc.       S’Sd jjrZS'S*Sc.       S’Se jjr[S'S*S)Sf.         S“Sg jjr\S'S*S)Sf.         S“Sh jjr]S”S*Si.S•Sj jjjr^\_S–Sk j5       r`\_S—Sl j5       ra\_S˜Sm j5       rb\_S™Sn j5       rc\_SšSo j5       rd\_S›Sp j5       reSqrfg')œÚExpré:   c                ó6   ^ ^• SU U4S jjnUT l         UT l        g )Nc                ó:   >• T" U 5      nTR                   Ul         U$ ©N©Ú	_metadata)ÚplxÚresultÚselfÚto_compliant_exprs     €€Ú?/var/www/html/env/lib/python3.13/site-packages/narwhals/expr.pyÚfuncÚExpr.__init__.<locals>.func=   s   ø€ Ù& sÓ+ˆFØ#Ÿ~™~ˆFÔØˆMó    )r@   zCompliantNamespace[Any, Any]ÚreturnúCompliantExpr[Any, Any])Ú_to_compliant_exprr?   )rB   rC   ÚmetadatarE   s   ``  rD   Ú__init__ÚExpr.__init__;   s   ù€ ÷	ð 	ð
 15ˆÔØ!ˆrG   c                óü   • U R                   R                  R                  5       (       a9  U R                  UU R                   R	                  [
        R                  5      5      $ U R                  XR                   5      $ r=   )r?   ÚkindÚ	is_windowÚ	__class__Ú with_kind_and_uncloseable_windowr
   Ú	TRANSFORM)rB   rC   s     rD   Ú_with_callableÚExpr._with_callableE   sa   € ð >‰>×Ñ×(Ñ(×*Ñ*ð —>‘>Ø!Ø—‘×?Ñ?Ä×@RÑ@RÓSóð ð ~‰~Ð/·±Ó@Ð@rG   c                óÞ   • U R                   R                  R                  5       (       a  Sn[        U5      eU R	                  XR                   R                  [        R                  5      5      $ ©Nz9Aggregations can't be applied to scalar-like expressions.)r?   rO   Úis_scalar_liker   rQ   Ú	with_kindr
   ÚAGGREGATION©rB   rC   Úmsgs      rD   Ú_with_aggregationÚExpr._with_aggregationQ   sT   € Ø>‰>×Ñ×-Ñ-×/Ñ/ØMˆCÜ'¨Ó,Ð,Ø~‰~ØŸ~™~×7Ñ7¼×8LÑ8LÓMó
ð 	
rG   c                óà   • U R                   R                  R                  5       (       a  Sn[        U5      eU R	                  UU R                   R                  [        R                  5      5      $ rW   )r?   rO   rX   r   rQ   Úwith_kind_and_closeable_windowr
   rZ   r[   s      rD   Ú!_with_order_dependent_aggregationÚ&Expr._with_order_dependent_aggregationY   sY   € ð >‰>×Ñ×-Ñ-×/Ñ/ØMˆCÜ'¨Ó,Ð,Ø~‰~ØØN‰N×9Ñ9¼(×:NÑ:NÓOó
ð 	
rG   c                óÞ   • U R                   R                  R                  5       (       a  Sn[        U5      eU R	                  XR                   R                  [        R                  5      5      $ )Nz<Length-changing can't be applied to scalar-like expressions.)r?   rO   rX   r   rQ   rY   r
   Ú
FILTRATIONr[   s      rD   Ú_with_filtrationÚExpr._with_filtrationd   sT   € Ø>‰>×Ñ×-Ñ-×/Ñ/ØPˆCÜ'¨Ó,Ð,Ø~‰~ØŸ~™~×7Ñ7¼×8KÑ8KÓLó
ð 	
rG   c                ó"   • SU R                    S3$ )NzNarwhals Expr
metadata: Ú
r>   ©rB   s    rD   Ú__repr__ÚExpr.__repr__l   s   € Ø*¨4¯>©>Ð*:¸"Ð=Ð=rG   c                ó.   ^ • T R                  U 4S j5      $ )Nc                ó^   >• TR                  U 5      R                  5       R                  5       $ r=   )rJ   ÚabsÚsum©r@   rB   s    €rD   Ú<lambda>Ú$Expr._taxicab_norm.<locals>.<lambda>s   s"   ø€ ˜×/Ñ/°Ó4×8Ñ8Ó:×>Ñ>Ô@rG   ©r]   ri   s   `rD   Ú_taxicab_normÚExpr._taxicab_normo   s   ø€ ð ×%Ñ%Ü@ó
ð 	
rG   c                ó2   ^ ^• T R                  UU 4S j5      $ )u4  Rename the expression.

Arguments:
    name: The new name.

Returns:
    A new expression.

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   >• TR                  U 5      R                  T5      $ r=   )rJ   Úalias)r@   ÚnamerB   s    €€rD   rq   ÚExpr.alias.<locals>.<lambda>Ž   s   ø€ ¨t×/FÑ/FÀsÓ/K×/QÑ/QÐRVÔ/WrG   ©rT   )rB   ry   s   ``rD   rx   Ú
Expr.aliasw   s   ù€ ð. ×"Ñ"Õ#WÓXÐXrG   c                ó   • U" U /UQ70 UD6$ )uÞ  Pipe function call.

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

Returns:
    A new expression.

Examples:
    >>> import 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   |
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
© )rB   ÚfunctionÚargsÚkwargss       rD   ÚpipeÚ	Expr.pipe   s   € ñ@ ˜Ð.˜tÒ. vÑ.Ð.rG   c                óH   ^ ^• [        T5        T R                  UU 4S j5      $ )u¥  Redefine an object's data type.

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

Returns:
    A new expression.

Examples:
    >>> import pandas as pd
    >>> import 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   >• TR                  U 5      R                  T5      $ r=   )rJ   Úcast)r@   ÚdtyperB   s    €€rD   rq   ÚExpr.cast.<locals>.<lambda>Ë   s   ø€ ¨t×/FÑ/FÀsÓ/K×/PÑ/PÐQVÔ/WrG   )r   rT   )rB   r‡   s   ``rD   r†   Ú	Expr.cast²   s   ù€ ô0 	˜ÔØ×"Ñ"Õ#WÓXÐXrG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X:H  $ r=   r~   ©ÚxÚys     rD   rq   Ú/Expr.__eq__.<locals>.<lambda>.<locals>.<lambda>Ñ   ó   €  !¢&rG   T©Ú
str_as_litr   ©r@   ÚotherrB   s    €€rD   rq   ÚExpr.__eq__.<locals>.<lambda>Ð   ó   ø€ Ô-ØÑ(¨$°À$òrG   ©rQ   r   ©rB   r•   s   ``rD   Ú__eq__ÚExpr.__eq__Î   ó%   ù€ Ø~‰~õô ' t¨UÓ3ó	
ð 	
rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X:g  $ r=   r~   r   s     rD   rq   Ú/Expr.__ne__.<locals>.<lambda>.<locals>.<lambda>Ù   r‘   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__ne__.<locals>.<lambda>Ø   r—   rG   r˜   r™   s   ``rD   Ú__ne__ÚExpr.__ne__Ö   rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú0Expr.__and__.<locals>.<lambda>.<locals>.<lambda>á   ó   €  !¢%rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__and__.<locals>.<lambda>à   ó   ø€ Ô-ØÑ'¨¨uÀòrG   r˜   r™   s   ``rD   Ú__and__ÚExpr.__and__Þ   rœ   rG   c                ó(   • X-  R                  S5      $ ©NÚliteral©rx   r™   s     rD   Ú__rand__ÚExpr.__rand__æ   ó   € Ø‘×#Ñ# IÓ.Ð.rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú/Expr.__or__.<locals>.<lambda>.<locals>.<lambda>ì   r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__or__.<locals>.<lambda>ë   rª   rG   r˜   r™   s   ``rD   Ú__or__ÚExpr.__or__é   rœ   rG   c                ó(   • X-  R                  S5      $ r®   r°   r™   s     rD   Ú__ror__ÚExpr.__ror__ñ   r³   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-   $ r=   r~   r   s     rD   rq   Ú0Expr.__add__.<locals>.<lambda>.<locals>.<lambda>÷   r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__add__.<locals>.<lambda>ö   rª   rG   r˜   r™   s   ``rD   Ú__add__ÚExpr.__add__ô   rœ   rG   c                ó(   • X-   R                  S5      $ r®   r°   r™   s     rD   Ú__radd__ÚExpr.__radd__ü   r³   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-
  $ r=   r~   r   s     rD   rq   Ú0Expr.__sub__.<locals>.<lambda>.<locals>.<lambda>  r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__sub__.<locals>.<lambda>  rª   rG   r˜   r™   s   ``rD   Ú__sub__ÚExpr.__sub__ÿ   rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó$   • U R                  U5      $ r=   )Ú__rsub__r   s     rD   rq   Ú1Expr.__rsub__.<locals>.<lambda>.<locals>.<lambda>  ó   € ˜QŸZ™Z¨œ]rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__rsub__.<locals>.<lambda>	  ó   ø€ Ô-ØÙ*ØØØòrG   r˜   r™   s   ``rD   rÒ   ÚExpr.__rsub__  ó%   ù€ Ø~‰~õô ' t¨UÓ3ó	
ð 		
rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú4Expr.__truediv__.<locals>.<lambda>.<locals>.<lambda>  r¨   rG   Tr’   r   r”   s    €€rD   rq   Ú"Expr.__truediv__.<locals>.<lambda>  rª   rG   r˜   r™   s   ``rD   Ú__truediv__ÚExpr.__truediv__  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó$   • U R                  U5      $ r=   )Ú__rtruediv__r   s     rD   rq   Ú5Expr.__rtruediv__.<locals>.<lambda>.<locals>.<lambda>  s   € ˜QŸ^™^¨AÔ.rG   Tr’   r   r”   s    €€rD   rq   Ú#Expr.__rtruediv__.<locals>.<lambda>  s   ø€ Ô-ØÙ.ØØØòrG   r˜   r™   s   ``rD   rã   ÚExpr.__rtruediv__  rØ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú0Expr.__mul__.<locals>.<lambda>.<locals>.<lambda>*  r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__mul__.<locals>.<lambda>)  rª   rG   r˜   r™   s   ``rD   Ú__mul__ÚExpr.__mul__'  rœ   rG   c                ó(   • X-  R                  S5      $ r®   r°   r™   s     rD   Ú__rmul__ÚExpr.__rmul__/  r³   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X:*  $ r=   r~   r   s     rD   rq   Ú/Expr.__le__.<locals>.<lambda>.<locals>.<lambda>5  r‘   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__le__.<locals>.<lambda>4  r—   rG   r˜   r™   s   ``rD   Ú__le__ÚExpr.__le__2  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X:  $ r=   r~   r   s     rD   rq   Ú/Expr.__lt__.<locals>.<lambda>.<locals>.<lambda>=  r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__lt__.<locals>.<lambda><  rª   rG   r˜   r™   s   ``rD   Ú__lt__ÚExpr.__lt__:  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X:„  $ r=   r~   r   s     rD   rq   Ú/Expr.__gt__.<locals>.<lambda>.<locals>.<lambda>E  r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__gt__.<locals>.<lambda>D  rª   rG   r˜   r™   s   ``rD   Ú__gt__ÚExpr.__gt__B  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X:¬  $ r=   r~   r   s     rD   rq   Ú/Expr.__ge__.<locals>.<lambda>.<locals>.<lambda>M  r‘   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__ge__.<locals>.<lambda>L  r—   rG   r˜   r™   s   ``rD   Ú__ge__ÚExpr.__ge__J  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú0Expr.__pow__.<locals>.<lambda>.<locals>.<lambda>U  s   €  !¢$rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__pow__.<locals>.<lambda>T  s   ø€ Ô-ØÑ&¨¨eÀòrG   r˜   r™   s   ``rD   Ú__pow__ÚExpr.__pow__R  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó$   • U R                  U5      $ r=   )Ú__rpow__r   s     rD   rq   Ú1Expr.__rpow__.<locals>.<lambda>.<locals>.<lambda>^  rÔ   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__rpow__.<locals>.<lambda>\  rÖ   rG   r˜   r™   s   ``rD   r  ÚExpr.__rpow__Z  rØ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú5Expr.__floordiv__.<locals>.<lambda>.<locals>.<lambda>i  r‘   rG   Tr’   r   r”   s    €€rD   rq   Ú#Expr.__floordiv__.<locals>.<lambda>h  r—   rG   r˜   r™   s   ``rD   Ú__floordiv__ÚExpr.__floordiv__f  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó$   • U R                  U5      $ r=   )Ú__rfloordiv__r   s     rD   rq   Ú6Expr.__rfloordiv__.<locals>.<lambda>.<locals>.<lambda>r  s   € ˜QŸ_™_¨QÔ/rG   Tr’   r   r”   s    €€rD   rq   Ú$Expr.__rfloordiv__.<locals>.<lambda>p  s   ø€ Ô-ØÙ/ØØØòrG   r˜   r™   s   ``rD   r%  ÚExpr.__rfloordiv__n  rØ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó
   • X-  $ r=   r~   r   s     rD   rq   Ú0Expr.__mod__.<locals>.<lambda>.<locals>.<lambda>}  r¨   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__mod__.<locals>.<lambda>|  rª   rG   r˜   r™   s   ``rD   Ú__mod__ÚExpr.__mod__z  rœ   rG   c                óH   ^ ^• T R                  UU 4S j[        T T5      5      $ )Nc                ó    >• [        U S TTSS9$ )Nc                ó$   • U R                  U5      $ r=   )Ú__rmod__r   s     rD   rq   Ú1Expr.__rmod__.<locals>.<lambda>.<locals>.<lambda>†  rÔ   rG   Tr’   r   r”   s    €€rD   rq   ÚExpr.__rmod__.<locals>.<lambda>„  rÖ   rG   r˜   r™   s   ``rD   r3  ÚExpr.__rmod__‚  rØ   rG   c                ó.   ^ • T R                  U 4S j5      $ )Nc                óB   >• TR                  U 5      R                  5       $ r=   )rJ   Ú
__invert__rp   s    €rD   rq   Ú!Expr.__invert__.<locals>.<lambda>  s   ø€ ¨t×/FÑ/FÀsÓ/K×/VÑ/VÔ/XrG   r{   ri   s   `rD   r9  ÚExpr.__invert__  s   ø€ Ø×"Ñ"Ô#XÓYÐYrG   c                ó.   ^ • T R                  U 4S j5      $ )u!  Return whether any of the values in the column are `True`.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úanyrp   s    €rD   rq   ÚExpr.any.<locals>.<lambda>¥  ó   ø€ °$×2IÑ2IÈ#Ó2N×2RÑ2RÔ2TrG   rs   ri   s   `rD   r>  ÚExpr.any’  ó   ø€ ð& ×%Ñ%Ô&TÓUÐUrG   c                ó.   ^ • T R                  U 4S j5      $ )u  Return whether all values in the column are `True`.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úallrp   s    €rD   rq   ÚExpr.all.<locals>.<lambda>º  r@  rG   rs   ri   s   `rD   rE  ÚExpr.all§  rB  rG   NTé   F©ÚcomÚspanÚ	half_lifeÚalphaÚadjustÚmin_samplesÚignore_nullsc          
     óJ   ^ ^^^^^^^• T R                  UUUUUUU U4S j5      $ )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`.

Returns:
    Expr

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

    We define a library agnostic function:

    >>> def 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           
     óL   >• TR                  U 5      R                  TTTTTTTS9$ )NrI  )rJ   Úewm_mean)	r@   rN  rM  rJ  rL  rP  rO  rB   rK  s	    €€€€€€€€rD   rq   ÚExpr.ewm_mean.<locals>.<lambda>  s5   ø€ ˜×/Ñ/°Ó4×=Ñ=ØØØ#ØØØ'Ø)ð >ñ rG   r{   )rB   rJ  rK  rL  rM  rN  rO  rP  s   ````````rD   rS  ÚExpr.ewm_mean¼  s#   ÿ€ ðl ×"Ñ"÷ó ó

ð 
	
rG   c                ó.   ^ • T R                  U 4S j5      $ )uñ  Get mean value.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úmeanrp   s    €rD   rq   ÚExpr.mean.<locals>.<lambda>1  ó   ø€ °$×2IÑ2IÈ#Ó2N×2SÑ2SÔ2UrG   rs   ri   s   `rD   rX  Ú	Expr.mean  ó   ø€ ð& ×%Ñ%Ô&UÓVÐVrG   c                ó.   ^ • T R                  U 4S j5      $ )uz  Get median value.

Returns:
    A new expression.

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

Examples:
    >>> import pandas as pd
    >>> import 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   >• TR                  U 5      R                  5       $ r=   )rJ   Úmedianrp   s    €rD   rq   ÚExpr.median.<locals>.<lambda>I  s   ø€ °$×2IÑ2IÈ#Ó2N×2UÑ2UÔ2WrG   rs   ri   s   `rD   r_  ÚExpr.median3  s   ø€ ð, ×%Ñ%Ô&WÓXÐXrG   ©Úddofc               ó2   ^ ^• T R                  UU 4S j5      $ )uÏ  Get standard deviation.

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

Returns:
    A new expression.

Examples:
    >>> import 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                ó@   >• TR                  U 5      R                  TS9$ ©Nrb  )rJ   Ústd©r@   rc  rB   s    €€rD   rq   ÚExpr.std.<locals>.<lambda>c  ó   ø€ ˜×/Ñ/°Ó4×8Ñ8¸dÐ8ÑCrG   rs   ©rB   rc  s   ``rD   rg  ÚExpr.stdK  ó   ù€ ð. ×%Ñ%ÝCó
ð 	
rG   c               ó2   ^ ^• T R                  UU 4S j5      $ )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.

Returns:
    A new expression.

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                ó@   >• TR                  U 5      R                  TS9$ rf  )rJ   Úvarrh  s    €€rD   rq   ÚExpr.var.<locals>.<lambda>~  rj  rG   rs   rk  s   ``rD   rp  ÚExpr.varf  rm  rG   c                ó†   ^ ^^• T R                  UUU 4S jT R                  R                  [        R                  5      5      $ )uÇ  Apply a custom python function to a whole Series or sequence of Series.

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

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

Returns:
    A new expression.

Examples:
    >>> import 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                óB   >• TR                  U 5      R                  TTS9$ )N)r   Úreturn_dtype)rJ   Úmap_batches)r@   r   ru  rB   s    €€€rD   rq   Ú"Expr.map_batches.<locals>.<lambda>©  s&   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø!°ð Añ rG   )rQ   r?   r`   r
   rd   )rB   r   ru  s   ```rD   rv  ÚExpr.map_batches  s6   ú€ ðN ~‰~öð N‰N×9Ñ9¼(×:MÑ:MÓNó
ð 	
rG   c                ó.   ^ • T R                  U 4S j5      $ )uF  Calculate the sample skewness of a column.

Returns:
    An expression representing the sample skewness of the 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   >• TR                  U 5      R                  5       $ r=   )rJ   Úskewrp   s    €rD   rq   ÚExpr.skew.<locals>.<lambda>Ã  rZ  rG   rs   ri   s   `rD   r{  Ú	Expr.skew°  r\  rG   c                ó.   ^ • T R                  U 4S j5      $ )uõ  Return the sum value.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   ro   rp   s    €rD   rq   ÚExpr.sum.<locals>.<lambda>Ü  r@  rG   rs   ri   s   `rD   ro   ÚExpr.sumÅ  s   ø€ ð. ×%Ñ%Ô&TÓUÐUrG   c                ó.   ^ • T R                  U 4S j5      $ )u  Returns the minimum value(s) from a column(s).

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úminrp   s    €rD   rq   ÚExpr.min.<locals>.<lambda>ñ  r@  rG   rs   ri   s   `rD   r„  ÚExpr.minÞ  rB  rG   c                ó.   ^ • T R                  U 4S j5      $ )u  Returns the maximum value(s) from a column(s).

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úmaxrp   s    €rD   rq   ÚExpr.max.<locals>.<lambda>  r@  rG   rs   ri   s   `rD   r‰  ÚExpr.maxó  rB  rG   c                ó.   ^ • T R                  U 4S j5      $ )uU  Returns the index of the minimum value.

Returns:
    A new expression.

Examples:
    >>> import pandas as pd
    >>> import narwhals as nw
    >>> df_native = pd.DataFrame({"a": [10, 20], "b": [150, 100]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("a", "b").arg_min().name.suffix("_arg_min"))
    â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
    |  Narwhals DataFrame   |
    |-----------------------|
    |   a_arg_min  b_arg_min|
    |0          0          1|
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
c                óB   >• TR                  U 5      R                  5       $ r=   )rJ   Úarg_minrp   s    €rD   rq   ÚExpr.arg_min.<locals>.<lambda>  ó   ø€ ˜×/Ñ/°Ó4×<Ñ<Ô>rG   ©ra   ri   s   `rD   rŽ  ÚExpr.arg_min  ó   ø€ ð& ×5Ñ5Ü>ó
ð 	
rG   c                ó.   ^ • T R                  U 4S j5      $ )uU  Returns the index of the maximum value.

Returns:
    A new expression.

Examples:
    >>> import pandas as pd
    >>> import narwhals as nw
    >>> df_native = pd.DataFrame({"a": [10, 20], "b": [150, 100]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("a", "b").arg_max().name.suffix("_arg_max"))
    â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
    |  Narwhals DataFrame   |
    |-----------------------|
    |   a_arg_max  b_arg_max|
    |0          1          0|
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
c                óB   >• TR                  U 5      R                  5       $ r=   )rJ   Úarg_maxrp   s    €rD   rq   ÚExpr.arg_max.<locals>.<lambda>3  r  rG   r‘  ri   s   `rD   r–  ÚExpr.arg_max  r“  rG   c                ó.   ^ • T R                  U 4S j5      $ )u  Returns the number of non-null elements in the column.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úcountrp   s    €rD   rq   ÚExpr.count.<locals>.<lambda>I  s   ø€ °$×2IÑ2IÈ#Ó2N×2TÑ2TÔ2VrG   rs   ri   s   `rD   r›  Ú
Expr.count6  s   ø€ ð& ×%Ñ%Ô&VÓWÐWrG   c                ó.   ^ • T R                  U 4S j5      $ )u  Returns count of unique values.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Ún_uniquerp   s    €rD   rq   ÚExpr.n_unique.<locals>.<lambda>^  s   ø€ °$×2IÑ2IÈ#Ó2N×2WÑ2WÔ2YrG   rs   ri   s   `rD   r   ÚExpr.n_uniqueK  s   ø€ ð& ×%Ñ%Ô&YÓZÐZrG   c                ó.   ^ • T R                  U 4S j5      $ )u  Return unique values of this expression.

Returns:
    A new 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   >• TR                  U 5      R                  5       $ r=   )rJ   Úuniquerp   s    €rD   rq   ÚExpr.unique.<locals>.<lambda>s  s   ø€ °×1HÑ1HÈÓ1M×1TÑ1TÔ1VrG   ©re   ri   s   `rD   r¥  ÚExpr.unique`  s   ø€ ð& ×$Ñ$Ô%VÓWÐWrG   c                ó.   ^ • T R                  U 4S j5      $ )uV  Return absolute value of each element.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   rn   rp   s    €rD   rq   ÚExpr.abs.<locals>.<lambda>‰  s   ø€ ¨t×/FÑ/FÀsÓ/K×/OÑ/OÔ/QrG   r{   ri   s   `rD   rn   ÚExpr.absu  s   ø€ ð( ×"Ñ"Ô#QÓRÐRrG   ©Úreversec               ó‚   ^ ^• T R                  UU 4S jT R                  R                  [        R                  5      5      $ )uJ  Return cumulative sum.

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

Arguments:
    reverse: reverse the operation

Returns:
    A new 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.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                ó@   >• TR                  U 5      R                  TS9$ ©Nr­  )rJ   Úcum_sum©r@   r®  rB   s    €€rD   rq   ÚExpr.cum_sum.<locals>.<lambda>ª  ó   ø€ ˜×/Ñ/°Ó4×<Ñ<ÀWÐ<ÑMrG   ©rQ   r?   r`   r
   ÚWINDOW©rB   r®  s   ``rD   r²  ÚExpr.cum_sum‹  s/   ù€ ð< ~‰~ÝMØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c                ó~   ^ • T R                  U 4S jT R                  R                  [        R                  5      5      $ )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](../basics/order_dependence.md).

Returns:
    A new expression.

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

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

Examples:
    >>> import polars as pl
    >>> import 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   >• TR                  U 5      R                  5       $ r=   )rJ   Údiffrp   s    €rD   rq   ÚExpr.diff.<locals>.<lambda>Ù  s   ø€ ˜×/Ñ/°Ó4×9Ñ9Ô;rG   r¶  ri   s   `rD   r¼  Ú	Expr.diff®  s0   ø€ ðT ~‰~Ü;ØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c                ó‚   ^ ^• T R                  UU 4S jT R                  R                  [        R                  5      5      $ )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](../basics/order_dependence.md).

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

Returns:
    A new expression.

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

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

Examples:
    >>> import polars as pl
    >>> import 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       â”‚ |
    |â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜ |
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
c                óD   >• TR                  U 5      R                  T5      $ r=   )rJ   Úshift©r@   ÚnrB   s    €€rD   rq   ÚExpr.shift.<locals>.<lambda>  s   ø€ ˜×/Ñ/°Ó4×:Ñ:¸1Ô=rG   r¶  )rB   rÃ  s   ``rD   rÁ  Ú
Expr.shiftÝ  s0   ù€ ðZ ~‰~Ý=ØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   ©ru  c               óè   ^ ^^^• TcT  [        T[        5      (       d  Sn[        U5      e[        TR	                  5       5      m[        TR                  5       5      mT R                  UUUU 4S j5      $ )u  Replace all values by different values.

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

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

Returns:
    A new expression.

Examples:
    >>> import 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                óD   >• TR                  U 5      R                  TTTS9$ )NrÆ  )rJ   Úreplace_strict)r@   ÚnewÚoldru  rB   s    €€€€rD   rq   Ú%Expr.replace_strict.<locals>.<lambda>E  s(   ø€ ˜×/Ñ/°Ó4×CÑCØS |ð Dñ rG   )Ú
isinstancer   Ú	TypeErrorÚlistÚvaluesÚkeysrT   )rB   rË  rÊ  ru  r\   s   ```` rD   rÉ  ÚExpr.replace_strict  s_   û€ ðZ ‰;Ü˜c¤7×+Ñ+ØZÜ “nÐ$äs—z‘z“|Ó$ˆCÜs—x‘x“zÓ"ˆCà×"Ñ"÷ó
ð 	
rG   ©Ú
descendingÚ
nulls_lastc               ó€   ^ ^^• Sn[        USS9  T R                  UUU 4S jT R                  R                  5       5      $ )añ  Sort this column. Place null values first.

!!! warning
    `Expr.sort` is deprecated and will be removed in a future version.
    Hint: instead of `df.select(nw.col('a').sort())`, use
    `df.select(nw.col('a')).sort()` instead.
    Note: this will remain available in `narwhals.stable.v1`.
    See [stable api](../backcompat.md/) for more information.

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

Returns:
    A new expression.
a$  `Expr.sort` is deprecated and will be removed in a future version.

Hint: instead of `df.select(nw.col('a').sort())`, use `df.select(nw.col('a')).sort()`.

Note: this will remain available in `narwhals.stable.v1`.
See https://narwhals-dev.github.io/narwhals/backcompat/ for more information.
ú1.23.0©Ú_versionc                óB   >• TR                  U 5      R                  TTS9$ )NrÓ  )rJ   Úsort)r@   rÔ  rÕ  rB   s    €€€rD   rq   ÚExpr.sort.<locals>.<lambda>c  s%   ø€ ˜×/Ñ/°Ó4×9Ñ9Ø%°*ð :ñ rG   )r$   rQ   r?   Úwith_uncloseable_window)rB   rÔ  rÕ  r\   s   ``` rD   rÛ  Ú	Expr.sortJ  sB   ú€ ð$^ð 	ô 	" #°Ò9Ø~‰~öð N‰N×2Ñ2Ó4ó	
ð 	
rG   c                óv   ^ ^^^^•         SU4S jjmT R                  UUU U4S j[        T TTSSSS95      $ )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).

Returns:
    A new expression.

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                óp   >• TS:X  a	  X:¬  X:  -  $ TS:X  a	  X:„  X:*  -  $ TS:X  a	  X:„  X:  -  $ X:¬  X:*  -  $ )NÚleftÚrightÚnoner~   )Úcompliant_exprÚlbÚubÚcloseds      €rD   rE   ÚExpr.is_between.<locals>.funcŒ  sa   ø€ ð
 ˜ÓØ&Ñ,°Ñ1DÑEÐEØ˜7Ó"Ø&Ñ+°Ñ0DÑEÐEØ˜6Ó!Ø&Ñ+°Ñ0CÑDÐDØ"Ñ(¨^Ñ-AÑBÐBrG   c           	     ó    >• [        U TTTTSS9$ )NFr’   r   )r@   rE   Úlower_boundrB   Úupper_bounds    €€€€rD   rq   Ú!Expr.is_between.<locals>.<lambda>š  s   ø€ Ô-ØT˜4 ¨kÀeòrG   F©r“   Úallow_multi_outputÚto_single_output)rä  rI   rå  rI   ræ  rI   rH   rI   ©rQ   r   )rB   rê  rë  rç  rE   s   ````@rD   Ú
is_betweenÚExpr.is_betweenj  sf   ü€ ðD	CØ3ð	Cà'ð	Cð (ð	Cð %÷		Cð ~‰~÷ô ØØØØ Ø#(Ø!&ñó	
ð 	
rG   c                ó¬   ^ ^• [        T[        5      (       a1  [        T[        [        45      (       d  T R	                  UU 4S j5      $ Sn[        U5      e)u‘  Check if elements of this expression are present in the other iterable.

Arguments:
    other: iterable

Returns:
    A new expression.

Examples:
    >>> import pandas as pd
    >>> import 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                óT   >• TR                  U 5      R                  [        TSS95      $ )NT)Úpass_through)rJ   Úis_inr!   r”   s    €€rD   rq   ÚExpr.is_in.<locals>.<lambda>Â  s%   ø€ ˜D×3Ñ3°CÓ8×>Ñ>Ü˜e°$Ñ7ôrG   zyNarwhals `is_in` doesn't accept expressions as an argument, as opposed to Polars. You should provide an iterable instead.)rÍ  r   ÚstrÚbytesrT   ÚNotImplementedError)rB   r•   r\   s   `` rD   rö  Ú
Expr.is_in§  sM   ù€ ô2 eœX×&Ñ&¬z¸%Ä#ÄuÀ×/NÑ/NØ×&Ñ&õóð ð NˆCÜ% cÓ*Ð*rG   c                ó¦   ^ ^• [        U5      m[        T /TQ7SSSS.6R                  [        R                  5      nT R                  UU 4S jU5      $ )u(  Filters elements based on a condition, returning a new expression.

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

Returns:
    A new expression.

Examples:
    >>> import 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     |
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
FTrí  c                ó(   >• [        U S T/TQ7SS06$ )Nc                 ó,   • U S   R                   " U SS  6 $ )Nr   rH  )Úfilter)Úexprss    rD   rq   Ú/Expr.filter.<locals>.<lambda>.<locals>.<lambda>ò  s   € ˜u Q™xŸš°°a°b°	Ñ:rG   r“   Fr   )r@   Úflat_predicatesrB   s    €€rD   rq   ÚExpr.filter.<locals>.<lambda>ð  s(   ø€ Ô-ØÙ:Øðð !ò	ð
 !òrG   )r#   r   rY   r
   rd   rQ   )rB   Ú
predicatesrK   r  s   `  @rD   rÿ  ÚExpr.filterÊ  sf   ù€ ô: " *Ó-ˆÜ#Øð
àñ
ð Ø#Ø"ò
÷ ‰)”H×'Ñ'Ó
(ð 	ð ~‰~õð ó	
ð 		
rG   c                ó.   ^ • T R                  U 4S j5      $ )u?  Returns a boolean Series indicating which values are null.

Returns:
    A new expression.

Notes:
    pandas handles null values differently from Polars and PyArrow.
    See [null_handling](../pandas_like_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   >• TR                  U 5      R                  5       $ r=   )rJ   Úis_nullrp   s    €rD   rq   ÚExpr.is_null.<locals>.<lambda>  s   ø€ ¨t×/FÑ/FÀsÓ/K×/SÑ/SÔ/UrG   r{   ri   s   `rD   r  ÚExpr.is_nullú  s   ø€ ðB ×"Ñ"Ô#UÓVÐVrG   c                ó.   ^ • T R                  U 4S j5      $ )uõ  Indicate which values are NaN.

Returns:
    A new expression.

Notes:
    pandas handles null values differently from Polars and PyArrow.
    See [null_handling](../pandas_like_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   >• TR                  U 5      R                  5       $ r=   )rJ   Úis_nanrp   s    €rD   rq   ÚExpr.is_nan.<locals>.<lambda>>  s   ø€ ¨t×/FÑ/FÀsÓ/K×/RÑ/RÔ/TrG   r{   ri   s   `rD   r  ÚExpr.is_nan  s   ø€ ðB ×"Ñ"Ô#TÓUÐUrG   c                óF   ^ • Sn[        USS9  T R                  U 4S j5      $ )zPFind elements where boolean expression is True.

Returns:
    A new expression.
zÐ`Expr.arg_true` is deprecated and will be removed in a future version.

Note: this will remain available in `narwhals.stable.v1`.
See https://narwhals-dev.github.io/narwhals/backcompat/ for more information.
r×  rØ  c                óB   >• TR                  U 5      R                  5       $ r=   )rJ   Úarg_truerp   s    €rD   rq   ÚExpr.arg_true.<locals>.<lambda>L  s   ø€ °×1HÑ1HÈÓ1M×1VÑ1VÔ1XrG   ©r$   re   )rB   r\   s   ` rD   r  ÚExpr.arg_true@  s,   ø€ ð^ð 	ô
 	" #°Ò9Ø×$Ñ$Ô%XÓYÐYrG   c                ó¸   ^ ^^^• Tb  Tb  Sn[        U5      eTc  Tc  Sn[        U5      eTb  TS;  a  ST 3n[        U5      eT R                  UU UU4S j5      $ )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.

Returns:
    A new expression.

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

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                óV   >• TR                  U 5      R                  [        U TSS9TTS9$ )NTr’   )ÚvalueÚstrategyÚlimit)rJ   Ú	fill_nullr   )r@   r  rB   r  r  s    €€€€rD   rq   Ú Expr.fill_null.<locals>.<lambda>¤  s2   ø€ ˜×/Ñ/°Ó4×>Ñ>Ü'¨¨U¸tÑDØ!Øð ?ñ rG   ©Ú
ValueErrorrT   )rB   r  r  r  r\   s   ```` rD   r  ÚExpr.fill_nullN  su   û€ ðX Ñ Ñ!5Ø>ˆCÜ˜S“/Ð!Ø‰=˜XÑ-ØDˆCÜ˜S“/Ð!ØÑ HÐ4KÓ$KØ,¨X¨JÐ7ˆCÜ˜S“/Ð!Ø×"Ñ"÷ó
ð 	
rG   c                ó.   ^ • T R                  U 4S j5      $ )uè  Drop null values.

Returns:
    A new expression.

Notes:
    pandas handles null values differently from Polars and PyArrow.
    See [null_handling](../pandas_like_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   >• TR                  U 5      R                  5       $ r=   )rJ   Ú
drop_nullsrp   s    €rD   rq   Ú!Expr.drop_nulls.<locals>.<lambda>Ï  ó   ø€ ˜×/Ñ/°Ó4×?Ñ?ÔArG   r§  ri   s   `rD   r$  ÚExpr.drop_nulls¬  s   ø€ ðD ×$Ñ$ÜAó
ð 	
rG   ©ÚfractionÚwith_replacementÚseedc               óV   ^ ^^^^• Sn[        USS9  T R                  UUUU U4S j5      $ )aÚ  Sample randomly from this expression.

!!! warning
    `Expr.sample` is deprecated and will be removed in a future version.
    Hint: instead of `df.select(nw.col('a').sample())`, use
    `df.select(nw.col('a')).sample()` instead.
    Note: this will remain available in `narwhals.stable.v1`.
    See [stable api](../backcompat.md/) for more information.

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

Returns:
    A new expression.
a*  `Expr.sample` is deprecated and will be removed in a future version.

Hint: instead of `df.select(nw.col('a').sample())`, use `df.select(nw.col('a')).sample()`.

Note: this will remain available in `narwhals.stable.v1`.
See https://narwhals-dev.github.io/narwhals/backcompat/ for more information.
r×  rØ  c                óF   >• TR                  U 5      R                  TTTTS9$ )Nr(  )rJ   Úsample)r@   r)  rÃ  r+  rB   r*  s    €€€€€rD   rq   ÚExpr.sample.<locals>.<lambda>õ  s*   ø€ ˜×/Ñ/°Ó4×;Ñ;Ø˜HÐ7GÈdð <ñ rG   r  )rB   rÃ  r)  r*  r+  r\   s   ````` rD   r.  ÚExpr.sampleÒ  s7   ü€ ð8^ð 	ô 	" #°Ò9Ø×$Ñ$÷ð ó
ð 	
rG   )Úorder_byc               ó2  ^ ^	^
• T R                   R                  R                  5       (       a  Sn[        U5      e[	        U5      m
[        U[        5      (       a  U/OUm	T
(       d  T	(       d  Sn[        U5      e[        R                  nT R                   R                  nUR                  5       (       a  Sn[        U5      eT	bA  T R                   R                  R                  5       (       a  UR                  5       (       d   eO%T	b"  UR                  5       (       d  Sn[        U5      eT R                   nUR                  5       (       a  [         R"                  O[         R$                  n['        UUUR(                  S9nT R+                  U	U
U 4S jU5      $ )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](../basics/order_dependence.md).

Returns:
    A new expression.

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>`.over()` can not be used for expressions which change length.z?At least one of `partition_by` or `order_by` must be specified.z)Nested `over` statements are not allowed.zJCannot use `order_by` in `over` on expression which isn't order-dependent.)Úwindow_kindÚexpansion_kindc                óF   >• TR                  U 5      R                  TT5      $ r=   )rJ   Úover)r@   Úflat_order_byÚflat_partition_byrB   s    €€€rD   rq   ÚExpr.over.<locals>.<lambda>J  s    ø€ ˜×/Ñ/°Ó4×9Ñ9Ø! =ôrG   )r?   rO   Úis_filtrationr   r#   rÍ  rø  r   r
   rS   r3  Ú	is_closedr   rP   Úis_openÚis_uncloseabler   ÚUNCLOSEABLEÚCLOSEDr   r4  rQ   )rB   r1  Úpartition_byr\   rO   r3  Úcurrent_metaÚnext_window_kindÚ	next_metar7  r8  s   `        @@rD   r6  Ú	Expr.overú  sZ  ú€ ð\ >‰>×Ñ×,Ñ,×.Ñ.ØRˆCÜ)¨#Ó.Ð.ä# LÓ1ÐÜ&0°¼3×&?Ñ&?˜™
ÀXˆÞ ®ØSˆCÜ˜S“/Ð!ä×!Ñ!ˆØ—n‘n×0Ñ0ˆØ× Ñ ×"Ñ"Ø=ˆCÜ'¨Ó,Ð,ØÑ$¨¯©×)<Ñ)<×)FÑ)F×)HÑ)Hð ×&Ñ&×(Ñ(Ð(Ñ(ØÑ&¨{×/BÑ/B×/DÑ/DØ^ˆCÜ'¨Ó,Ð,Ø—~‘~ˆà&1×&@Ñ&@×&BÑ&BŒJ×"Ò"Ì
×HYÑHYð 	ô !ØØ(Ø'×6Ñ6ñ
ˆ	ð ~‰~öð ó	
ð 	
rG   c                ó$   • U R                  5       ) $ )u½  Return a boolean mask indicating duplicated values.

Returns:
    A new expression.

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|
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
)Ú	is_uniqueri   s    rD   Úis_duplicatedÚExpr.is_duplicatedP  s   € ð, —‘Ó Ð Ð rG   c                ó.   ^ • T R                  U 4S j5      $ )uI  Return a boolean mask indicating unique values.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   rF  rp   s    €rD   rq   Ú Expr.is_unique.<locals>.<lambda>~  ó   ø€ ¨t×/FÑ/FÀsÓ/K×/UÑ/UÔ/WrG   r{   ri   s   `rD   rF  ÚExpr.is_uniqueh  s   ø€ ð, ×"Ñ"Ô#WÓXÐXrG   c                ó.   ^ • T R                  U 4S j5      $ )u¼  Count null values.

Returns:
    A new expression.

Notes:
    pandas handles null values differently from Polars and PyArrow.
    See [null_handling](../pandas_like_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   >• TR                  U 5      R                  5       $ r=   )rJ   Ú
null_countrp   s    €rD   rq   Ú!Expr.null_count.<locals>.<lambda>›  r&  rG   rs   ri   s   `rD   rP  ÚExpr.null_count€  s   ø€ ð4 ×%Ñ%ÜAó
ð 	
rG   c                ó~   ^ • T R                  U 4S jT R                  R                  [        R                  5      5      $ )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](../basics/order_dependence.md).

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úis_first_distinctrp   s    €rD   rq   Ú(Expr.is_first_distinct.<locals>.<lambda>»  s   ø€ ˜×/Ñ/°Ó4×FÑFÔHrG   r¶  ri   s   `rD   rU  ÚExpr.is_first_distinctž  s/   ø€ ð8 ~‰~ÜHØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c                ó~   ^ • T R                  U 4S jT R                  R                  [        R                  5      5      $ )uæ  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](../basics/order_dependence.md).

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úis_last_distinctrp   s    €rD   rq   Ú'Expr.is_last_distinct.<locals>.<lambda>Ü  s   ø€ ˜×/Ñ/°Ó4×EÑEÔGrG   r¶  ri   s   `rD   rZ  ÚExpr.is_last_distinct¿  s/   ø€ ð8 ~‰~ÜGØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c                ó6   ^ ^^• T R                  UUU 4S j5      $ )u8  Get quantile value.

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

Returns:
    A new expression.

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

Examples:
    >>> import 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   >• TR                  U 5      R                  TT5      $ r=   )rJ   Úquantile)r@   Úinterpolationr_  rB   s    €€€rD   rq   ÚExpr.quantile.<locals>.<lambda>  s   ø€ ˜×/Ñ/°Ó4×=Ñ=¸hÈÔVrG   rs   )rB   r_  r`  s   ```rD   r_  ÚExpr.quantileà  s   ú€ ðD ×%Ñ%ÞVó
ð 	
rG   c                óJ   ^ ^• Sn[        USS9  T R                  UU 4S j5      $ )aœ  Get the first `n` rows.

!!! warning
    `Expr.head` is deprecated and will be removed in a future version.
    Hint: instead of `df.select(nw.col('a').head())`, use
    `df.select(nw.col('a')).head()` instead.
    Note: this will remain available in `narwhals.stable.v1`.
    See [stable api](../backcompat.md/) for more information.

Arguments:
    n: Number of rows to return.

Returns:
    A new expression.
a$  `Expr.head` is deprecated and will be removed in a future version.

Hint: instead of `df.select(nw.col('a').head())`, use `df.select(nw.col('a')).head()`.

Note: this will remain available in `narwhals.stable.v1`.
See https://narwhals-dev.github.io/narwhals/backcompat/ for more information.
r×  rØ  c                óD   >• TR                  U 5      R                  T5      $ r=   )rJ   ÚheadrÂ  s    €€rD   rq   ÚExpr.head.<locals>.<lambda>  ó   ø€ °×1HÑ1HÈÓ1M×1RÑ1RÐSTÔ1UrG   r  ©rB   rÃ  r\   s   `` rD   re  Ú	Expr.head  ó,   ù€ ð"^ð 	ô 	" #°Ò9Ø×$Ñ$Õ%UÓVÐVrG   c                óJ   ^ ^• Sn[        USS9  T R                  UU 4S j5      $ )a›  Get the last `n` rows.

!!! warning
    `Expr.tail` is deprecated and will be removed in a future version.
    Hint: instead of `df.select(nw.col('a').tail())`, use
    `df.select(nw.col('a')).tail()` instead.
    Note: this will remain available in `narwhals.stable.v1`.
    See [stable api](../backcompat.md/) for more information.

Arguments:
    n: Number of rows to return.

Returns:
    A new expression.
a$  `Expr.tail` is deprecated and will be removed in a future version.

Hint: instead of `df.select(nw.col('a').tail())`, use `df.select(nw.col('a')).tail()`.

Note: this will remain available in `narwhals.stable.v1`.
See https://narwhals-dev.github.io/narwhals/backcompat/ for more information.
r×  rØ  c                óD   >• TR                  U 5      R                  T5      $ r=   )rJ   ÚtailrÂ  s    €€rD   rq   ÚExpr.tail.<locals>.<lambda>6  rg  rG   r  rh  s   `` rD   rm  Ú	Expr.tail  rj  rG   c                ó2   ^ ^• T R                  UU 4S j5      $ )u0  Round underlying floating point data by `decimals` digits.

Arguments:
    decimals: Number of decimals to round by.

Returns:
    A new expression.


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

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

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

Examples:
    >>> import 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   >• TR                  U 5      R                  T5      $ r=   )rJ   Úround)r@   ÚdecimalsrB   s    €€rD   rq   ÚExpr.round.<locals>.<lambda>Z  s   ø€ ˜×/Ñ/°Ó4×:Ñ:¸8ÔDrG   r{   )rB   rs  s   ``rD   rr  Ú
Expr.round8  s   ù€ ðB ×"Ñ"ÝDó
ð 	
rG   c                ó.   ^ • T R                  U 4S j5      $ )u³  Return the number of elements in the column.

Null values count towards the total.

Returns:
    A new expression.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Úlenrp   s    €rD   rq   ÚExpr.len.<locals>.<lambda>u  r@  rG   rs   ri   s   `rD   rx  ÚExpr.len]  s   ø€ ð0 ×%Ñ%Ô&TÓUÐUrG   c                óN   ^ ^^• Sn[        USS9  T R                  UUU 4S j5      $ )aô  Take every nth value in the Series and return as new Series.

!!! warning
    `Expr.gather_every` is deprecated and will be removed in a future version.
    Hint: instead of `df.select(nw.col('a').gather_every())`, use
    `df.select(nw.col('a')).gather_every()` instead.
    Note: this will remain available in `narwhals.stable.v1`.
    See [stable api](../backcompat.md/) for more information.

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

Returns:
    A new expression.
a<  `Expr.gather_every` is deprecated and will be removed in a future version.

Hint: instead of `df.select(nw.col('a').gather_every())`, use `df.select(nw.col('a')).gather_every()`.

Note: this will remain available in `narwhals.stable.v1`.
See https://narwhals-dev.github.io/narwhals/backcompat/ for more information.
r×  rØ  c                óB   >• TR                  U 5      R                  TTS9$ )N)rÃ  Úoffset)rJ   Úgather_every)r@   rÃ  r}  rB   s    €€€rD   rq   Ú#Expr.gather_every.<locals>.<lambda>  s    ø€ ˜×/Ñ/°Ó4×AÑAÀAÈfÐAÑUrG   r  )rB   rÃ  r}  r\   s   ``` rD   r~  ÚExpr.gather_everyw  s0   ú€ ð$^ð 	ô 	" #°Ò9Ø×$Ñ$ÞUó
ð 	
rG   c                óP   ^ ^^• T R                  UU U4S j[        T TTSSSS95      $ )uÛ  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.

Returns:
    A new expression.

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           	     ó*   >• [        U UU4S jTTTSS9$ )Nc                 óV   >• U S   R                  Tb  U S   OS Tb	  U S   5      $ S 5      $ )Nr   rH  é   )Úclip)r   rê  rë  s    €€rD   rq   Ú-Expr.clip.<locals>.<lambda>.<locals>.<lambda>³  s4   ø€ ˜u Q™xŸ}™}Ø +Ñ 7E˜!’H¸TØ +Ñ 7E˜!‘Hô à=Aô rG   Fr’   r   )r@   rê  rB   rë  s    €€€rD   rq   ÚExpr.clip.<locals>.<lambda>±  s!   ø€ Ô-Øõð ØØØ ò
rG   Frí  rð  )rB   rê  rë  s   ```rD   r…  Ú	Expr.clip“  s7   ú€ ð: ~‰~ö
ô ØØØØ Ø#(Ø!&ñó
ð 	
rG   c                ó.   ^ • T R                  U 4S j5      $ )u-  Compute the most occurring value(s).

Can return multiple values.

Returns:
    A new expression.

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       |
    â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
c                óB   >• TR                  U 5      R                  5       $ r=   )rJ   Úmoderp   s    €rD   rq   ÚExpr.mode.<locals>.<lambda>Û  s   ø€ °×1HÑ1HÈÓ1M×1RÑ1RÔ1TrG   r§  ri   s   `rD   r‹  Ú	Expr.modeÆ  s   ø€ ð* ×$Ñ$Ô%TÓUÐUrG   c                ó.   ^ • T R                  U 4S j5      $ )u“  Returns boolean values indicating which original values are finite.

Warning:
    pandas handles null values differently from Polars and PyArrow.
    See [null_handling](../pandas_like_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.

Returns:
    Expression of `Boolean` data type.

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   >• TR                  U 5      R                  5       $ r=   )rJ   Ú	is_finiterp   s    €rD   rq   Ú Expr.is_finite.<locals>.<lambda>  rL  rG   r{   ri   s   `rD   r  ÚExpr.is_finiteÝ  s   ø€ ðH ×"Ñ"Ô#WÓXÐXrG   c               ó‚   ^ ^• T R                  UU 4S jT R                  R                  [        R                  5      5      $ )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](../basics/order_dependence.md).

Arguments:
    reverse: reverse the operation

Returns:
    A new expression.

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                ó@   >• TR                  U 5      R                  TS9$ r±  )rJ   Ú	cum_countr³  s    €€rD   rq   Ú Expr.cum_count.<locals>.<lambda>$  s   ø€ ˜×/Ñ/°Ó4×>Ñ>ÀwÐ>ÑOrG   r¶  r¸  s   ``rD   r•  ÚExpr.cum_count  s0   ù€ ð@ ~‰~ÝOØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c               ó‚   ^ ^• T R                  UU 4S jT R                  R                  [        R                  5      5      $ )u˜  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](../basics/order_dependence.md).

Arguments:
    reverse: reverse the operation

Returns:
    A new expression.

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                ó@   >• TR                  U 5      R                  TS9$ r±  )rJ   Úcum_minr³  s    €€rD   rq   ÚExpr.cum_min.<locals>.<lambda>I  rµ  rG   r¶  r¸  s   ``rD   rš  ÚExpr.cum_min(  ó0   ù€ ð@ ~‰~ÝMØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c               ó‚   ^ ^• T R                  UU 4S jT R                  R                  [        R                  5      5      $ )u˜  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](../basics/order_dependence.md).

Arguments:
    reverse: reverse the operation

Returns:
    A new expression.

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                ó@   >• TR                  U 5      R                  TS9$ r±  )rJ   Úcum_maxr³  s    €€rD   rq   ÚExpr.cum_max.<locals>.<lambda>n  rµ  rG   r¶  r¸  s   ``rD   r   ÚExpr.cum_maxM  r  rG   c               ó‚   ^ ^• T R                  UU 4S jT R                  R                  [        R                  5      5      $ )uº  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](../basics/order_dependence.md).

Arguments:
    reverse: reverse the operation

Returns:
    A new expression.

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                ó@   >• TR                  U 5      R                  TS9$ r±  )rJ   Úcum_prodr³  s    €€rD   rq   ÚExpr.cum_prod.<locals>.<lambda>“  s   ø€ ˜×/Ñ/°Ó4×=Ñ=ÀgÐ=ÑNrG   r¶  r¸  s   ``rD   r¥  ÚExpr.cum_prodr  s0   ù€ ð@ ~‰~ÝNØN‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   )rO  Úcenterc               ó¤   ^ ^^^• [        TUS9u  mmT R                  UUU U4S jT R                  R                  [        R
                  5      5      $ )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](../basics/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.

Returns:
    A new expression.

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_sizerO  c                óD   >• TR                  U 5      R                  TTTS9$ ©N)r«  rO  r¨  )rJ   Úrolling_sum)r@   r¨  Úmin_samples_intrB   r«  s    €€€€rD   rq   Ú"Expr.rolling_sum.<locals>.<lambda>Í  s*   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø'Ø+Øð Añ rG   ©r"   rQ   r?   r`   r
   r·  )rB   r«  rO  r¨  r¯  s   `` `@rD   r®  ÚExpr.rolling_sum—  sK   û€ ôb (CØ#°ñ(
Ñ$ˆ_ð ~‰~÷ð
 N‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   c               ó¤   ^ ^^^• [        TTS9u  mmT R                  UUU U4S jT R                  R                  [        R
                  5      5      $ )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](../basics/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.

Returns:
    A new expression.

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                óD   >• TR                  U 5      R                  TTTS9$ r­  )rJ   Úrolling_mean)r@   r¨  rO  rB   r«  s    €€€€rD   rq   Ú#Expr.rolling_mean.<locals>.<lambda>	  s*   ø€ ˜×/Ñ/°Ó4×AÑAØ'Ø'Øð Bñ rG   r±  )rB   r«  rO  r¨  s   ````rD   rµ  ÚExpr.rolling_meanÕ  sJ   û€ ôb $?Ø#°ñ$
Ñ ˆ[ð ~‰~÷ð
 N‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   )rO  r¨  rc  c               ó¨   ^ ^^^^• [        TTS9u  mmT R                  UUUU U4S jT R                  R                  [        R
                  5      5      $ )u|  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](../basics/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.

Returns:
    A new expression.

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                óF   >• TR                  U 5      R                  TTTTS9$ ©N)r«  rO  r¨  rc  )rJ   Úrolling_var©r@   r¨  rc  rO  rB   r«  s    €€€€€rD   rq   Ú"Expr.rolling_var.<locals>.<lambda>K	  s+   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø'°[ÈÐVZð Añ rG   r±  ©rB   r«  rO  r¨  rc  s   `````rD   r»  ÚExpr.rolling_var	  sO   ü€ ôf $?Ø#°ñ$
Ñ ˆ[ð ~‰~÷ð ð N‰N×9Ñ9¼(¿/¹/ÓJó	
ð 	
rG   c               ó¨   ^ ^^^^• [        TTS9u  mmT R                  UUUU U4S jT R                  R                  [        R
                  5      5      $ )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](../basics/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.

Returns:
    A new expression.

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                óF   >• TR                  U 5      R                  TTTTS9$ rº  )rJ   Úrolling_stdr¼  s    €€€€€rD   rq   Ú"Expr.rolling_std.<locals>.<lambda>‰	  s-   ø€ ˜×/Ñ/°Ó4×@Ñ@Ø'Ø'ØØð	 Añ rG   r±  r¾  s   `````rD   rÂ  ÚExpr.rolling_stdQ	  sO   ü€ ôf $?Ø#°ñ$
Ñ ˆ[ð ~‰~÷ð ð N‰N×9Ñ9¼(¿/¹/ÓJó
ð 	
rG   )rÔ  c               ól   ^ ^^• 1 SknTU;  a  ST S3n[        U5      eT R                  UUU 4S j5      $ )uT  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](../basics/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.

Returns:
    A new expression with rank data.

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 'Ú'c                óB   >• TR                  U 5      R                  TTS9$ )N)ÚmethodrÔ  )rJ   Úrank)r@   rÔ  rË  rB   s    €€€rD   rq   ÚExpr.rank.<locals>.<lambda>Í	  s%   ø€ ˜×/Ñ/°Ó4×9Ñ9Ø¨*ð :ñ rG   r  )rB   rË  rÔ  Úsupported_rank_methodsr\   s   ```  rD   rÌ  Ú	Expr.rank’	  sP   ú€ òd "OÐØÐ/Ó/ðØ ˜ ð$ð ô ˜S“/Ð!à×"Ñ"öó
ð 	
rG   c                ó   • [        U 5      $ r=   r   ri   s    rD   rø  ÚExpr.strÒ	  ó   € ä" 4Ó(Ð(rG   c                ó   • [        U 5      $ r=   r   ri   s    rD   ÚdtÚExpr.dtÖ	  s   € ä$ TÓ*Ð*rG   c                ó   • [        U 5      $ r=   r   ri   s    rD   ÚcatÚExpr.catÚ	  s   € ä Ó%Ð%rG   c                ó   • [        U 5      $ r=   r   ri   s    rD   ry   Ú	Expr.nameÞ	  ó   € ä  Ó&Ð&rG   c                ó   • [        U 5      $ r=   r   ri   s    rD   rÏ  Ú	Expr.listâ	  rÛ  rG   c                ó   • [        U 5      $ r=   r   ri   s    rD   ÚstructÚExpr.structæ	  rÒ  rG   )r?   rJ   )rC   r7   rK   r   rH   ÚNone)rC   zCallable[[Any], Any]rH   r(   )rH   rø  )rH   r(   )ry   rø  rH   r(   )r   z"Callable[Concatenate[Self, PS], R]r€   zPS.argsr   z	PS.kwargsrH   r6   )r‡   zDType | type[DType]rH   r(   )r•   z
Self | AnyrH   r(   )r•   r   rH   r(   )rJ  úfloat | NonerK  râ  rL  râ  rM  râ  rN  ÚboolrO  ÚintrP  rã  rH   r(   )rc  rä  rH   r(   r=   )r   z(Callable[[Any], CompliantExpr[Any, Any]]ru  zDType | NonerH   r(   )rH   r9   )r®  rã  rH   r(   )rÃ  rä  rH   r(   )rË  z!Sequence[Any] | Mapping[Any, Any]rÊ  zSequence[Any] | Noneru  zDType | type[DType] | NonerH   r(   )rÔ  rã  rÕ  rã  rH   r(   )Úboth)rê  úAny | IntoExprrë  ræ  rç  r-   rH   r(   )r  r   rH   r(   )NNN)r  zExpr | NonNestedLiteralr  zFillNullStrategy | Noner  ú
int | NonerH   r(   )
rÃ  rç  r)  râ  r*  rã  r+  rç  rH   r(   )r@  zstr | Sequence[str]r1  zstr | Sequence[str] | NonerH   r(   )r_  Úfloatr`  r3   rH   r(   )é
   )r   )rs  rä  rH   r(   )rÃ  rä  r}  rä  rH   r(   )NN)rê  ú2IntoExpr | NumericLiteral | TemporalLiteral | Nonerë  rê  rH   r(   )r«  rä  rO  rç  r¨  rã  rH   r(   )
r«  rä  rO  rç  r¨  rã  rc  rä  rH   r(   )rÇ  )rË  r2   rÔ  rã  rH   r(   )rH   zExprStringNamespace[Self])rH   zExprDateTimeNamespace[Self])rH   zExprCatNamespace[Self])rH   zExprNameNamespace[Self])rH   zExprListNamespace[Self])rH   zExprStructNamespace[Self])gÚ__name__Ú
__module__Ú__qualname__Ú__firstlineno__rL   rT   r]   ra   re   rj   rt   rx   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.  r3  r9  r>  rE  rS  rX  r_  rg  rp  rv  r{  ro   r„  r‰  rŽ  r–  r›  r   r¥  rn   r²  r¼  rÁ  rÉ  rÛ  rñ  rö  rÿ  r  r  r  r  r$  r.  r6  rG  rF  rP  rU  rZ  r_  re  rm  rr  rx  r~  r…  r‹  r  r•  rš  r   r¥  r®  rµ  r»  rÂ  rÌ  Úpropertyrø  rÔ  r×  ry   rÏ  rß  Ú__static_attributes__r~   rG   rD   r9   r9   :   sˆ  † ô"ô
Aô
ð	
Ø!5ð	
à	ô	
ô
ô>ô
ôYð2 /à4ð /ð ð /ð ð	 /ð
 
ô /ôDYô8
ô
ô
ô/ô
ô/ô
ô/ô
ô

ô
ô

ô
ô/ô
ô
ô
ô
ô
ô

ô
ô

ô
ô

ôZôVô*Vð0 !Ø!Ø"&Ø"ØØØ"ñ`
ð ð`
ð ð	`
ð
  ð`
ð ð`
ð ð`
ð ð`
ð ð`
ð 
õ`
ôDWô*Yð0 "#÷ 
ð6 "#÷ 
ð< &*ð-
à:ð-
ð #ð-
ð 
õ	-
ô^Wô*Vô2Vô*Vô*
ô.
ô.Xô*[ô*Xô*Sð, */÷ !
ôF-
ô^0
ðj %)ð9
ð
 48ñ9
à.ð9
ð "ð9
ð
 1ð9
ð 
ö9
ðv */À5÷ 
ðH "(ð	;
à#ð;
ð $ð;
ð ð	;
ð
 
õ;
ôz!+ôF.
ô`!WôF!VôFZð  *.Ø,0Ø ð	[
à&ð[
ð *ð[
ð ð	[
ð
 
õ[
ô|$
ðP ð&
ð "&Ø!&Øñ&
àð&
ð ð	&
ð
 ð&
ð ð&
ð 
ö&
ðV 04ñT
à*ðT
ð -ðT
ð 
õ	T
ôl!ô0Yô0
ô<
ôB
ðB$
Øð$
Ø.Hð$
à	ô$
öLWö2Wö2#
ôJVö4
ð< KOØJNð1
àGð1
ð Hð1
ð 
õ	1
ôfVô.$YðL ,1÷ #
ðJ */÷ #
ðJ */÷ #
ðJ +0÷ #
ðR #'Øñ<
àð<
ð  ð	<
ð
 ð<
ð 
õ<
ðD #'Øñ<
àð<
ð  ð	<
ð
 ð<
ð 
õ<
ðD #'ØØñ<
àð<
ð  ð	<
ð
 ð<
ð ð<
ð 
õ<
ðD #'ØØñ?
àð?
ð  ð	?
ð
 ð?
ð ð?
ð 
õ?
ðB>
È÷ >
ð >
ð@ ó)ó ð)ð ó+ó ð+ð ó&ó ð&ð ó'ó ð'ð ó'ó ð'ð ó)ó ó)rG   r9   N)AÚ
__future__r   Útypingr   r   r   r   r   r	   Únarwhals._expression_parsingr
   r   r   r   r   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!   Únarwhals.utilsr"   r#   r$   r%   Útyping_extensionsr&   r'   r(   r)   Únarwhals._compliantr*   r+   r,   Únarwhals.typingr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   Ú__annotations__r9   Ú__all__r~   rG   rD   Ú<module>r     sã   ðÞ "å  Ý Ý Ý Ý Ý å 1Ý 5Ý 3Ý >Ý 9Ý CÝ :Ý +Ý 5Ý 7Ý .Ý 2Ý 0Ý 0Ý 1Ý 4Ý (Ý 6Ý "Ý 4æÝå-Ý+Ý&Ý+å1Ý6Ý%Ý.Ý0Ý(Ý0Ý.Ý*Ý:Ý/á	4‹€BÙ‹€AØ&Ø	˜C ˜HÑ	%Ð&¨°c¸3°hÑ(?Ð?ñ€L)ó ÷
n&)ñ n&)ðdM ðrG   