o
    Þ@ög' ã                   @  s  U d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d d	l
mZ d d
l
mZ d dl
mZ d dl
mZ d dl
mZ d dl
mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl m!Z! d dl"m#Z# d dl$m%Z% d dl$m&Z& d dl$m'Z' eröd dlm(Z( d dl)m*Z* d dl)m+Z+ d dl)m,Z, d d l)m-Z- d d!l.m/Z/ d d"l.m0Z0 d d#lm1Z1 d d$l2m3Z3 e+d%ƒZ4e(d&ƒZ5ee0eef ge/eef f Z6d'e7d(< G d)d*„ d*ƒZ8d*gZ9d+S ),é    )Úannotations)ÚTYPE_CHECKING)ÚAny)ÚCallable)ÚIterable)ÚLiteral)ÚMapping)ÚSequence)ÚExprKind)ÚExprMetadata©Ú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)ÚIntoExprÚPSÚRr(   Ú_ToCompliantc                   @  s„  e Zd Zd!d	d
„Zd"dd„Zd#dd„Zd$dd„Zd%dd„Zd&dd„Zd'd!d"„Z	d(d%d&„Z
d(d'd(„Zd)d*d+„Zd)d,d-„Zd)d.d/„Zd)d0d1„Zd)d2d3„Zd)d4d5„Zd)d6d7„Zd)d8d9„Zd)d:d;„Zd)d<d=„Zd)d>d?„Zd)d@dA„Zd)dBdC„Zd)dDdE„Zd)dFdG„Zd)dHdI„Zd)dJdK„Zd)dLdM„Zd)dNdO„Zd)dPdQ„Zd)dRdS„Z d)dTdU„Z!d$dVdW„Z"d$dXdY„Z#d$dZd[„Z$d\d\d\d\d]d^d_d`œd*dkdl„Z%d$dmdn„Z&d$dodp„Z'd^dqœd+dsdt„Z(d^dqœd+dudv„Z)	\d,d-dzd{„Z*d$d|d}„Z+d.d~d„Z,d$d€d„Z-d$d‚dƒ„Z.d$d„d…„Z/d$d†d‡„Z0d$dˆd‰„Z1d$dŠd‹„Z2d$dŒd„Z3d$dŽd„Z4d_dœd/d’d“„Z5d$d”d•„Z6d0d—d˜„Z7	\d,d\d™œd1dŸd „Z8d_d_d¡œd2d¤d¥„Z9	¦d3d4d¬d­„Z:d)d®d¯„Z;d5d±d²„Z<d$d³d´„Z=d$dµd¶„Z>d$d·d¸„Z?	\	\	\d6d7d¿dÀ„Z@d$dÁdÂ„ZA	\d,d\d_d\dÃœd8dÇdÈ„ZBd\dÉœd9dÎdÏ„ZCd$dÐdÑ„ZDd$dÒdÓ„ZEd$dÔdÕ„ZFd$dÖd×„ZGd$dØdÙ„ZHd:dÞdß„ZId;d0dádâ„ZJd;d0dãdä„ZKd<d=dçdè„ZLd$dédê„ZMd<d>dìdí„ZN	\	\d?d@dïdð„ZOd$dñdò„ZPd$dódô„ZQd_dœd/dõdö„ZRd_dœd/d÷dø„ZSd_dœd/dùdú„ZTd_dœd/dûdü„ZUd\d_dýœdAd d„ZVd\d_dýœdAdd„ZWd\d_d^dœdBdd„ZXd\d_d^dœdBdd„ZY		dCd_d
œdDdd„ZZe[dEdd„ƒZ\e[dFdd„ƒZ]e[dGdd„ƒZ^e[dHdd„ƒZ_e[dIdd„ƒZ`e[dJdd „ƒZad\S (K  ÚExprÚselfr'   Úto_compliant_exprr/   Úmetadatar   ÚreturnÚNonec                   s    d‡ ‡fdd„}|ˆ _ |ˆ _d S )NÚplxúCompliantNamespace[Any, Any]r4   úCompliantExpr[Any, Any]c                   s   ˆ| ƒ}ˆ j |_ |S ©N©Ú	_metadata)r6   Úresult©r1   r2   © úT/var/www/html/development/chatbot/venv/lib/python3.10/site-packages/narwhals/expr.pyÚfunc8   s   zExpr.__init__.<locals>.func)r6   r7   r4   r8   )Ú_to_compliant_exprr;   )r1   r2   r3   r@   r>   r=   r?   Ú__init__4   s   
zExpr.__init__úCallable[[Any], Any]c                 C  s   |   || j¡S r9   )Ú	__class__r;   r=   r>   r>   r?   Ú_with_callable@   s   zExpr._with_callableÚstrc                 C  s   d| j › dS )NzNarwhals Expr
metadata: Ú
r:   ©r1   r>   r>   r?   Ú__repr__D   ó   zExpr.__repr__c                   ó   ˆ   ‡ fdd„ˆ j tj¡¡S )Nc                   s   ˆ   | ¡ ¡  ¡ S r9   )rA   ÚabsÚsum©r6   rH   r>   r?   Ú<lambda>K   ó    z$Expr._taxicab_norm.<locals>.<lambda>©rD   r;   Ú	with_kindr
   ÚAGGREGATIONrH   r>   rH   r?   Ú_taxicab_normG   s   
þzExpr._taxicab_normÚnamec                   ó   ˆ  ‡ ‡fdd„¡S )uÄ  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                   ó   ˆ  | ¡ ˆ ¡S r9   )rA   ÚaliasrN   ©rU   r1   r>   r?   rO   g   ó    zExpr.alias.<locals>.<lambda>©rE   )r1   rU   r>   rY   r?   rX   P   s   z
Expr.aliasÚfunctionú"Callable[Concatenate[Self, PS], R]ÚargsúPS.argsÚkwargsú	PS.kwargsr.   c                 O  s   || g|¢R i |¤ŽS )uŽ  Pipe function call.

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

        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   |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        r>   )r1   r\   r^   r`   r>   r>   r?   Úpipei   s    z	Expr.pipeÚdtypeúDType | type[DType]c                   s   t ˆ ƒ ˆ ‡ ‡fdd„¡S )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                   rW   r9   )rA   ÚcastrN   ©rc   r1   r>   r?   rO   ¤   rZ   zExpr.cast.<locals>.<lambda>)r   rE   )r1   rc   r>   rf   r?   re   ‹   s   z	Expr.castÚotherú
Self | Anyc                   ó   ˆ  ‡ ‡fdd„tˆˆ ƒ¡S )Nc                   ó   t | dd„ ˆˆ ddS )Nc                 S  s   | |kS r9   r>   ©ÚxÚyr>   r>   r?   rO   ª   ó    z/Expr.__eq__.<locals>.<lambda>.<locals>.<lambda>T©Ú
str_as_litr   rN   ©rg   r1   r>   r?   rO   ©   ó    ÿzExpr.__eq__.<locals>.<lambda>©rD   r   ©r1   rg   r>   rq   r?   Ú__eq__§   ó   üzExpr.__eq__c                   ri   )Nc                   rj   )Nc                 S  s   | |kS r9   r>   rk   r>   r>   r?   rO   ²   rn   z/Expr.__ne__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   ±   rr   zExpr.__ne__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__ne__¯   rv   zExpr.__ne__r   c                   ri   )Nc                   rj   )Nc                 S  s   | |@ S r9   r>   rk   r>   r>   r?   rO   º   rn   z0Expr.__and__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   ¹   rr   zExpr.__and__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__and__·   rv   zExpr.__and__c                 C  s   | |@   d¡S ©NÚliteral©rX   rt   r>   r>   r?   Ú__rand__¿   rJ   zExpr.__rand__c                   ri   )Nc                   rj   )Nc                 S  s   | |B S r9   r>   rk   r>   r>   r?   rO   Å   rn   z/Expr.__or__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   Ä   rr   zExpr.__or__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__or__Â   rv   zExpr.__or__c                 C  s   | |B   d¡S ry   r{   rt   r>   r>   r?   Ú__ror__Ê   rJ   zExpr.__ror__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO   Ð   rn   z0Expr.__add__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   Ï   rr   zExpr.__add__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__add__Í   rv   zExpr.__add__c                 C  s   | |   d¡S ry   r{   rt   r>   r>   r?   Ú__radd__Õ   rJ   zExpr.__radd__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO   Û   rn   z0Expr.__sub__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   Ú   rr   zExpr.__sub__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__sub__Ø   rv   zExpr.__sub__c                   ri   )Nc                   rj   )Nc                 S  ó
   |   |¡S r9   )Ú__rsub__rk   r>   r>   r?   rO   ä   ó   
 z1Expr.__rsub__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   â   ó    ûzExpr.__rsub__.<locals>.<lambda>rs   rt   r>   rq   r?   rƒ   à   ó   øzExpr.__rsub__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO   ï   rn   z4Expr.__truediv__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   î   rr   z"Expr.__truediv__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__truediv__ì   rv   zExpr.__truediv__c                   ri   )Nc                   rj   )Nc                 S  r‚   r9   )Ú__rtruediv__rk   r>   r>   r?   rO   ø   r„   z5Expr.__rtruediv__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   ö   r…   z#Expr.__rtruediv__.<locals>.<lambda>rs   rt   r>   rq   r?   rˆ   ô   r†   zExpr.__rtruediv__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO     rn   z0Expr.__mul__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO     rr   zExpr.__mul__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__mul__   rv   zExpr.__mul__c                 C  s   | |   d¡S ry   r{   rt   r>   r>   r?   Ú__rmul__  rJ   zExpr.__rmul__c                   ri   )Nc                   rj   )Nc                 S  s   | |kS r9   r>   rk   r>   r>   r?   rO     rn   z/Expr.__le__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO     rr   zExpr.__le__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__le__  rv   zExpr.__le__c                   ri   )Nc                   rj   )Nc                 S  s   | |k S r9   r>   rk   r>   r>   r?   rO     rn   z/Expr.__lt__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO     rr   zExpr.__lt__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__lt__  rv   zExpr.__lt__c                   ri   )Nc                   rj   )Nc                 S  s   | |kS r9   r>   rk   r>   r>   r?   rO     rn   z/Expr.__gt__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO     rr   zExpr.__gt__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__gt__  rv   zExpr.__gt__c                   ri   )Nc                   rj   )Nc                 S  s   | |kS r9   r>   rk   r>   r>   r?   rO   &  rn   z/Expr.__ge__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   %  rr   zExpr.__ge__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__ge__#  rv   zExpr.__ge__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO   .  rn   z0Expr.__pow__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   -  rr   zExpr.__pow__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__pow__+  rv   zExpr.__pow__c                   ri   )Nc                   rj   )Nc                 S  r‚   r9   )Ú__rpow__rk   r>   r>   r?   rO   7  r„   z1Expr.__rpow__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   5  r…   zExpr.__rpow__.<locals>.<lambda>rs   rt   r>   rq   r?   r   3  r†   zExpr.__rpow__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO   B  rn   z5Expr.__floordiv__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   A  rr   z#Expr.__floordiv__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__floordiv__?  rv   zExpr.__floordiv__c                   ri   )Nc                   rj   )Nc                 S  r‚   r9   )Ú__rfloordiv__rk   r>   r>   r?   rO   K  r„   z6Expr.__rfloordiv__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   I  r…   z$Expr.__rfloordiv__.<locals>.<lambda>rs   rt   r>   rq   r?   r’   G  r†   zExpr.__rfloordiv__c                   ri   )Nc                   rj   )Nc                 S  s   | | S r9   r>   rk   r>   r>   r?   rO   V  rn   z0Expr.__mod__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   U  rr   zExpr.__mod__.<locals>.<lambda>rs   rt   r>   rq   r?   Ú__mod__S  rv   zExpr.__mod__c                   ri   )Nc                   rj   )Nc                 S  r‚   r9   )Ú__rmod__rk   r>   r>   r?   rO   _  r„   z1Expr.__rmod__.<locals>.<lambda>.<locals>.<lambda>Tro   r   rN   rq   r>   r?   rO   ]  r…   zExpr.__rmod__.<locals>.<lambda>rs   rt   r>   rq   r?   r”   [  r†   zExpr.__rmod__c                   ó   ˆ   ‡ fdd„¡S )Nc                   ó   ˆ   | ¡ ¡ S r9   )rA   Ú
__invert__rN   rH   r>   r?   rO   i  ó    z!Expr.__invert__.<locals>.<lambda>r[   rH   r>   rH   r?   r—   h  s   zExpr.__invert__c                   rK   )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                   r–   r9   )rA   ÚanyrN   rH   r>   r?   rO     r˜   zExpr.any.<locals>.<lambda>rQ   rH   r>   rH   r?   r™   k  ó   
þzExpr.anyc                   rK   )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                   r–   r9   )rA   ÚallrN   rH   r>   r?   rO   —  r˜   zExpr.all.<locals>.<lambda>rQ   rH   r>   rH   r?   r›   ƒ  rš   zExpr.allNTé   F©ÚcomÚspanÚ	half_lifeÚalphaÚadjustÚmin_samplesÚignore_nullsrž   úfloat | NonerŸ   r    r¡   r¢   Úboolr£   Úintr¤   c             
     s    ˆ  ‡ ‡‡‡‡‡‡‡fdd„¡S )uÓ  Compute exponentially-weighted moving average.

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

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

                - When `adjust=True` (the default) the EW function is calculated
                  using weights $w_i = (1 - \alpha)^i$
                - When `adjust=False` the EW function is calculated recursively by
                  $$
                  y_0=x_0
                  $$
                  $$
                  y_t = (1 - \alpha)y_{t - 1} + \alpha x_t
                  $$
            min_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              	     s   ˆ  | ¡jˆˆˆˆˆ ˆˆdS )Nr   )rA   Úewm_meanrN   ©r¢   r¡   rž   r    r¤   r£   r1   rŸ   r>   r?   rO   ö  s   
 ùzExpr.ewm_mean.<locals>.<lambda>r[   )r1   rž   rŸ   r    r¡   r¢   r£   r¤   r>   r©   r?   r¨   ›  s   ZÿzExpr.ewm_meanc                   rK   )ui  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                   r–   r9   )rA   ÚmeanrN   rH   r>   r?   rO     r˜   zExpr.mean.<locals>.<lambda>rQ   rH   r>   rH   r?   rª     rš   z	Expr.meanc                   rK   )u  Get median value.

        Returns:
            A new expression.

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

        Examples:
            >>> import pandas as pd
            >>> import 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                   r–   r9   )rA   ÚmedianrN   rH   r>   r?   rO   0  r˜   zExpr.median.<locals>.<lambda>rQ   rH   r>   rH   r?   r«     s   
þzExpr.median©Úddofr­   c                  ó    ˆ  ‡ ‡fdd„ˆj tj¡¡S )u_  Get standard deviation.

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

        Returns:
            A new expression.

        Examples:
            >>> import 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                   ó   ˆ  | ¡jˆ dS ©Nr¬   )rA   ÚstdrN   ©r­   r1   r>   r?   rO   L  rP   zExpr.std.<locals>.<lambda>rQ   ©r1   r­   r>   r²   r?   r±   4  ó   þzExpr.stdc                  r®   )un  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                   r¯   r°   )rA   ÚvarrN   r²   r>   r?   rO   h  rP   zExpr.var.<locals>.<lambda>rQ   r³   r>   r²   r?   rµ   P  r´   zExpr.varú(Callable[[Any], CompliantExpr[Any, Any]]Úreturn_dtypeúDType | Nonec                   ó"   ˆ  ‡ ‡‡fdd„ˆj tj¡¡S )u¯  Apply a custom python function to a whole Series or sequence of Series.

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

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

        Returns:
            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                   ó   ˆ  | ¡jˆ ˆdS )N)r\   r·   )rA   Úmap_batchesrN   ©r\   r·   r1   r>   r?   rO   ”  ó   
 ÿz"Expr.map_batches.<locals>.<lambda>)rD   r;   Úwith_kind_and_extra_open_windowr
   Ú
FILTRATION)r1   r\   r·   r>   r¼   r?   r»   l  s   'ûzExpr.map_batchesc                   rK   )u¾  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                   r–   r9   )rA   ÚskewrN   rH   r>   r?   rO   ¯  r˜   zExpr.skew.<locals>.<lambda>rQ   rH   r>   rH   r?   rÀ   ›  rš   z	Expr.skewc                   rK   )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                   r–   r9   )rA   rM   rN   rH   r>   r?   rO   Ë  r˜   zExpr.sum.<locals>.<lambda>rQ   rH   r>   rH   r?   rM   ³  s   
þzExpr.sumc                   rK   )uz  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                   r–   r9   )rA   ÚminrN   rH   r>   r?   rO   ã  r˜   zExpr.min.<locals>.<lambda>rQ   rH   r>   rH   r?   rÁ   Ï  rš   zExpr.minc                   rK   )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                   r–   r9   )rA   ÚmaxrN   rH   r>   r?   rO   û  r˜   zExpr.max.<locals>.<lambda>rQ   rH   r>   rH   r?   rÂ   ç  rš   zExpr.maxc                   rK   )uÍ  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                   r–   r9   )rA   Úarg_minrN   rH   r>   r?   rO     r˜   zExpr.arg_min.<locals>.<lambda>©rD   r;   r¾   r
   rS   rH   r>   rH   r?   rÃ   ÿ  rš   zExpr.arg_minc                   rK   )uÍ  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                   r–   r9   )rA   Úarg_maxrN   rH   r>   r?   rO   +  r˜   zExpr.arg_max.<locals>.<lambda>rÄ   rH   r>   rH   r?   rÅ     rš   zExpr.arg_maxc                   rK   )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                   r–   r9   )rA   ÚcountrN   rH   r>   r?   rO   C  r˜   zExpr.count.<locals>.<lambda>rQ   rH   r>   rH   r?   rÆ   /  rš   z
Expr.countc                   rK   )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                   r–   r9   )rA   Ún_uniquerN   rH   r>   r?   rO   [  r˜   zExpr.n_unique.<locals>.<lambda>rQ   rH   r>   rH   r?   rÇ   G  rš   zExpr.n_uniquec                   rK   )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                   r–   r9   )rA   ÚuniquerN   rH   r>   r?   rO   s  r˜   zExpr.unique.<locals>.<lambda>©rD   r;   rR   r
   r¿   rH   r>   rH   r?   rÈ   _  rš   zExpr.uniquec                   r•   )uÖ  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                   r–   r9   )rA   rL   rN   rH   r>   r?   rO   ‹  r˜   zExpr.abs.<locals>.<lambda>r[   rH   r>   rH   r?   rL   w  s   zExpr.abs©ÚreverserË   c                  r®   )u
  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                   r¯   ©NrÊ   )rA   Úcum_sumrN   ©rË   r1   r>   r?   rO   ¬  rP   zExpr.cum_sum.<locals>.<lambda>©rD   r;   r¾   r
   ÚWINDOW©r1   rË   r>   rÎ   r?   rÍ     s   þzExpr.cum_sumc                   rK   )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                   r–   r9   )rA   ÚdiffrN   rH   r>   r?   rO   Û  r˜   zExpr.diff.<locals>.<lambda>rÏ   rH   r>   rH   r?   rÒ   °  s   *
þz	Expr.diffÚnc                   r®   )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                   rW   r9   )rA   ÚshiftrN   ©rÓ   r1   r>   r?   rO     rZ   zExpr.shift.<locals>.<lambda>rÏ   )r1   rÓ   r>   rÕ   r?   rÔ   ß  s   -þz
Expr.shift©r·   Úoldú!Sequence[Any] | Mapping[Any, Any]ÚnewúSequence[Any] | NoneúDType | type[DType] | Nonec                  sN   ˆ du rt ˆtƒsd}t|ƒ‚tˆ ¡ ƒ‰ tˆ ¡ ƒ‰ˆ ‡ ‡‡‡fdd„¡S )u  Replace all values by different values.

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

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

        Returns:
            A new expression.

        Examples:
            >>> import 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    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        NzB`new` argument is required if `old` argument is not a Mapping typec                   s   ˆ  | ¡jˆˆ ˆdS )NrÖ   )rA   Úreplace_strictrN   ©rÙ   r×   r·   r1   r>   r?   rO   G  s   
 ÿz%Expr.replace_strict.<locals>.<lambda>)Ú
isinstancer   Ú	TypeErrorÚlistÚvaluesÚkeysrE   )r1   r×   rÙ   r·   Úmsgr>   rÝ   r?   rÜ     s   -
ÿzExpr.replace_strict©Ú
descendingÚ
nulls_lastrå   ræ   c                  s.   d}t |dd ˆ ‡ ‡‡fdd„ˆj ¡ ¡S )aQ  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                   rº   )Nrä   )rA   ÚsortrN   ©rå   ræ   r1   r>   r?   rO   e  r½   zExpr.sort.<locals>.<lambda>)r#   rD   r;   Úwith_extra_open_window)r1   rå   ræ   rã   r>   rë   r?   rê   L  s   ÿüz	Expr.sortÚbothÚlower_boundúAny | IntoExprÚupper_boundÚclosedú(Literal['left', 'right', 'none', 'both']c                   s8   d‡ fdd„‰ˆ  ‡‡‡‡fdd	„tˆˆˆd
d
d
d¡S )uK  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    |
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Úcompliant_exprr8   ÚlbÚubr4   c                   sX   ˆ dkr| |k| |k @ S ˆ dkr| |k| |k@ S ˆ dkr$| |k| |k @ S | |k| |k@ S )NÚleftÚrightÚnoner>   )ró   rô   rõ   )rñ   r>   r?   r@   Ž  s   zExpr.is_between.<locals>.funcc                   s   t | ˆ ˆˆˆddS )NFro   r   rN   )r@   rî   r1   rð   r>   r?   rO   œ  s    ÿz!Expr.is_between.<locals>.<lambda>F©rp   Úallow_multi_outputÚto_single_outputN)ró   r8   rô   r8   rõ   r8   r4   r8   ©rD   r   )r1   rî   rð   rñ   r>   )rñ   r@   rî   r1   rð   r?   Ú
is_betweenl  s   "úüzExpr.is_betweenc                   s8   t ˆ tƒrt ˆ ttfƒsˆ ‡ ‡fdd„¡S d}t|ƒ‚)u1  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                   s   ˆ  | ¡ tˆ dd¡S )NT)Úpass_through)rA   Úis_inr    rN   rq   r>   r?   rO   Ä  s   
 
ÿzExpr.is_in.<locals>.<lambda>zyNarwhals `is_in` doesn't accept expressions as an argument, as opposed to Polars. You should provide an iterable instead.)rÞ   r   rF   ÚbytesrE   ÚNotImplementedError)r1   rg   rã   r>   rq   r?   rÿ   ©  s   ÿz
Expr.is_inÚ
predicatesc                   s@   t |ƒ‰ tˆgˆ ¢R ddddœŽ tj¡}ˆ ‡ ‡fdd„|¡S )uè  Filters elements based on a condition, returning a new expression.

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

        Returns:
            A new expression.

        Examples:
            >>> import 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                   s   t | dd„ ˆgˆ ¢R ddiŽS )Nc                  W  s   | d j | dd … Ž S )Nr   rœ   )Úfilter©Úexprsr>   r>   r?   rO   ô  s    z/Expr.filter.<locals>.<lambda>.<locals>.<lambda>rp   Fr   rN   ©Úflat_predicatesr1   r>   r?   rO   ò  s    ýüûzExpr.filter.<locals>.<lambda>)r"   r   rR   r
   r¿   rD   )r1   r  r3   r>   r  r?   r  Ì  s    ÿþûúøzExpr.filterc                   r•   )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                   r–   r9   )rA   Úis_nullrN   rH   r>   r?   rO     r˜   zExpr.is_null.<locals>.<lambda>r[   rH   r>   rH   r?   r  ü  ó   !zExpr.is_nullc                   r•   )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                   r–   r9   )rA   Úis_nanrN   rH   r>   r?   rO   @  r˜   zExpr.is_nan.<locals>.<lambda>r[   rH   r>   rH   r?   r
    r	  zExpr.is_nanc                   s.   d}t |dd ˆ  ‡ fdd„ˆ j tj¡¡S )zhFind 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                   r–   r9   )rA   Úarg_truerN   rH   r>   r?   rO   O  r˜   zExpr.arg_true.<locals>.<lambda>©r#   rD   r;   r¾   r
   r¿   )r1   rã   r>   rH   r?   r  B  s   ÿ
þzExpr.arg_trueÚvalueúExpr | Any | NoneÚstrategyú%Literal['forward', 'backward'] | NoneÚlimitú
int | Nonec                   sr   ˆdurˆdurd}t |ƒ‚ˆdu rˆdu rd}t |ƒ‚ˆdur-ˆdvr-dˆ› }t |ƒ‚ˆ ‡ ‡‡‡fdd„¡S )u&  Fill null values with given value.

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

        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                    â”‚|
            |â””â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Nz*cannot specify both `value` and `strategy`z0must specify either a fill `value` or `strategy`>   ÚforwardÚbackwardzstrategy not supported: c                   s    ˆ  | ¡jt| ˆddˆˆ dS )NTro   )r  r  r  )rA   Ú	fill_nullr   rN   ©r  r1   r  r  r>   r?   rO   ©  s
   
 ýz Expr.fill_null.<locals>.<lambda>©Ú
ValueErrorrE   )r1   r  r  r  rã   r>   r  r?   r  S  s   L
ÿzExpr.fill_nullc                   rK   )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                   r–   r9   )rA   Ú
drop_nullsrN   rH   r>   r?   rO   Ô  r˜   z!Expr.drop_nulls.<locals>.<lambda>rÉ   rH   r>   rH   r?   r  ±  s   "
þzExpr.drop_nulls©ÚfractionÚwith_replacementÚseedr  r  r  c                  s6   d}t |dd ˆ ‡ ‡‡‡‡fdd„ˆj tj¡¡S )aR  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                   s   ˆ  | ¡jˆˆ ˆˆdS )Nr  )rA   ÚsamplerN   ©r  rÓ   r  r1   r  r>   r?   rO   û  ó   
 ÿzExpr.sample.<locals>.<lambda>)r#   rD   r;   rR   r
   r¿   )r1   rÓ   r  r  r  rã   r>   r  r?   r  Ø  s   ÿüzExpr.sample)Úorder_byÚpartition_byústr | Sequence[str]r!  ústr | Sequence[str] | Nonec                  sº   ˆj j ¡ rd}t|ƒ‚t|ƒ‰t|tƒr|gn|‰ ˆs$ˆ s$d}t|ƒ‚tj	}ˆj j
}ˆ dur:ˆj j ¡ r:|d8 }nˆ durF|sFd}t|ƒ‚ˆj }t|||jd}ˆ ‡ ‡‡fdd„|¡S )	uÉ  Compute expressions over the given groups (optionally with given order).

        Arguments:
            partition_by: Names of columns to compute window expression over.
                Must be names of columns, as opposed to expressions -
                so, this is a bit less flexible than Polars' `Expr.over`.
            order_by: Column(s) to order window functions by.
                For lazy backends, this argument is required when `over` is applied
                to order-dependent functions, see [order-dependence](../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.Nrœ   zJCannot use `order_by` in `over` on expression which isn't order-dependent.)Ún_open_windowsÚexpansion_kindc                   ó   ˆ  | ¡ ˆˆ ¡S r9   )rA   ÚoverrN   ©Úflat_order_byÚflat_partition_byr1   r>   r?   rO   H  s   
 ÿzExpr.over.<locals>.<lambda>)r;   ÚkindÚis_filtrationr   r"   rÞ   rF   r  r
   Ú	TRANSFORMr%  Ú	is_windowr   r   r&  rD   )r1   r!  r"  rã   r,  r%  Úcurrent_metaÚ	next_metar>   r)  r?   r(    s2   .
ýüz	Expr.overc                 C  s
   |   ¡  S )uM  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_uniquerH   r>   r>   r?   Úis_duplicatedN  s   
zExpr.is_duplicatedc                   r•   )uÙ  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                   r–   r9   )rA   r2  rN   rH   r>   r?   rO   |  r˜   z Expr.is_unique.<locals>.<lambda>r[   rH   r>   rH   r?   r2  f  s   zExpr.is_uniquec                   rK   )ud  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                   r–   r9   )rA   Ú
null_countrN   rH   r>   r?   rO   ™  r˜   z!Expr.null_count.<locals>.<lambda>rQ   rH   r>   rH   r?   r4  ~  s   
þzExpr.null_countc                   rK   )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                   r–   r9   )rA   Úis_first_distinctrN   rH   r>   r?   rO   º  r˜   z(Expr.is_first_distinct.<locals>.<lambda>rÏ   rH   r>   rH   r?   r5    ó   
þzExpr.is_first_distinctc                   rK   )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                   r–   r9   )rA   Úis_last_distinctrN   rH   r>   r?   rO   Û  r˜   z'Expr.is_last_distinct.<locals>.<lambda>rÏ   rH   r>   rH   r?   r7  ¾  r6  zExpr.is_last_distinctÚquantileÚfloatÚinterpolationú;Literal['nearest', 'higher', 'lower', 'midpoint', 'linear']c                   r¹   )u  Get quantile value.

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

        Returns:
            A new expression.

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

        Examples:
            >>> import 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                   r'  r9   )rA   r8  rN   ©r:  r8  r1   r>   r?   rO     rP   zExpr.quantile.<locals>.<lambda>rQ   )r1   r8  r:  r>   r<  r?   r8  ß  s   $þzExpr.quantileé
   c                   ó0   d}t |dd ˆ ‡ ‡fdd„ˆj tj¡¡S )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                   rW   r9   )rA   ÚheadrN   rÕ   r>   r?   rO      rZ   zExpr.head.<locals>.<lambda>r  ©r1   rÓ   rã   r>   rÕ   r?   r?    ó   ÿþz	Expr.headc                   r>  )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                   rW   r9   )rA   ÚtailrN   rÕ   r>   r?   rO   <  rZ   zExpr.tail.<locals>.<lambda>r  r@  r>   rÕ   r?   rB  $  rA  z	Expr.tailr   Údecimalsc                   rV   )uð  Round underlying floating point data by `decimals` digits.

        Arguments:
            decimals: Number of decimals to round by.

        Returns:
            A new expression.


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

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

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

        Examples:
            >>> import 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                   rW   r9   )rA   ÚroundrN   ©rC  r1   r>   r?   rO   b  rZ   zExpr.round.<locals>.<lambda>r[   )r1   rC  r>   rE  r?   rD  @  s   !ÿz
Expr.roundc                   rK   )uK  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                   r–   r9   )rA   ÚlenrN   rH   r>   r?   rO   ~  r˜   zExpr.len.<locals>.<lambda>rQ   rH   r>   rH   r?   rF  e  s   
þzExpr.lenÚoffsetc                   s2   d}t |dd ˆ ‡ ‡‡fdd„ˆj tj¡¡S )aT  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                   rº   )N)rÓ   rG  )rA   Úgather_everyrN   ©rÓ   rG  r1   r>   r?   rO   ›  s    z#Expr.gather_every.<locals>.<lambda>r  )r1   rÓ   rG  rã   r>   rI  r?   rH  ‚  s   ÿþzExpr.gather_everyúIntoExpr | Any | Nonec                   s(   ˆ  ‡ ‡‡fdd„tˆˆ ˆdddd¡S )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                   s   t | ‡ ‡fdd„ˆˆ ˆddS )Nc                    s2   | d   ˆ d ur| d nd ˆd ur| d ¡S d ¡S )Nr   rœ   é   )Úclipr  )rî   rð   r>   r?   rO   Á  s    þþz-Expr.clip.<locals>.<lambda>.<locals>.<lambda>Fro   r   rN   ©rî   r1   rð   r>   r?   rO   ¿  s    ÷zExpr.clip.<locals>.<lambda>Frù   rü   )r1   rî   rð   r>   rM  r?   rL  ¡  s   úôz	Expr.clipc                   rK   )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                   r–   r9   )rA   ÚmoderN   rH   r>   r?   rO   ê  r˜   zExpr.mode.<locals>.<lambda>rÉ   rH   r>   rH   r?   rN  Ô  s   
þz	Expr.modec                   r•   )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                   r–   r9   )rA   Ú	is_finiterN   rH   r>   r?   rO     r˜   z Expr.is_finite.<locals>.<lambda>r[   rH   r>   rH   r?   rO  î  s   $zExpr.is_finitec                  r®   )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                   r¯   rÌ   )rA   Ú	cum_countrN   rÎ   r>   r?   rO   5  rP   z Expr.cum_count.<locals>.<lambda>rÏ   rÑ   r>   rÎ   r?   rP    ó    þzExpr.cum_countc                  r®   )uh  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                   r¯   rÌ   )rA   Úcum_minrN   rÎ   r>   r?   rO   Z  rP   zExpr.cum_min.<locals>.<lambda>rÏ   rÑ   r>   rÎ   r?   rR  9  rQ  zExpr.cum_minc                  r®   )uh  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                   r¯   rÌ   )rA   Úcum_maxrN   rÎ   r>   r?   rO     rP   zExpr.cum_max.<locals>.<lambda>rÏ   rÑ   r>   rÎ   r?   rS  ^  rQ  zExpr.cum_maxc                  r®   )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                   r¯   rÌ   )rA   Úcum_prodrN   rÎ   r>   r?   rO   ¤  rP   zExpr.cum_prod.<locals>.<lambda>rÏ   rÑ   r>   rÎ   r?   rT  ƒ  rQ  zExpr.cum_prod)r£   ÚcenterÚwindow_sizerU  c                  s4   t ˆ|d\‰‰ˆ ‡ ‡‡‡fdd„ˆj tj¡¡S )uÛ  Apply a rolling sum (moving sum) over the values.

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

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

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

        !!! 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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        ©rV  r£   c                   ó   ˆ  | ¡jˆˆˆ dS ©N)rV  r£   rU  )rA   Úrolling_sumrN   ©rU  Úmin_samples_intr1   rV  r>   r?   rO   â  ó
   
 ýz"Expr.rolling_sum.<locals>.<lambda>©r!   rD   r;   r¾   r
   rÐ   ©r1   rV  r£   rU  r>   r[  r?   rZ  ¨  ó   5
ÿúzExpr.rolling_sumc                  s4   t ˆˆd\‰‰ˆ ‡ ‡‡‡fdd„ˆj tj¡¡S )uí  Apply a rolling mean (moving mean) over the values.

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

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

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

        !!! 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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        rW  c                   rX  rY  )rA   Úrolling_meanrN   ©rU  r£   r1   rV  r>   r?   rO   $	  r]  z#Expr.rolling_mean.<locals>.<lambda>r^  r_  r>   rb  r?   ra  ê  r`  zExpr.rolling_mean)r£   rU  r­   c                  ó6   t ˆˆd\‰‰ˆ ‡ ‡‡‡‡fdd„ˆj tj¡¡S )uF  Apply a rolling variance (moving variance) over the values.

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

        A window of length `window_size` will traverse the values. The resulting values
        will be aggregated to their 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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        rW  c                   ó   ˆ  | ¡jˆˆˆ ˆdS ©N)rV  r£   rU  r­   )rA   Úrolling_varrN   ©rU  r­   r£   r1   rV  r>   r?   rO   h	  r   z"Expr.rolling_var.<locals>.<lambda>r^  ©r1   rV  r£   rU  r­   r>   rg  r?   rf  ,	  s   7
ÿüzExpr.rolling_varc                  rc  )ud  Apply a rolling standard deviation (moving standard deviation) over the values.

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

        A window of length `window_size` will traverse the values. The resulting values
        will be aggregated to their 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|
            â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        rW  c                   rd  re  )rA   Úrolling_stdrN   rg  r>   r?   rO   ª	  s   
 üz"Expr.rolling_std.<locals>.<lambda>r^  rh  r>   rg  r?   ri  n	  s   7
ÿùzExpr.rolling_stdÚaverage)rå   Úmethodú4Literal['average', 'min', 'max', 'dense', 'ordinal']c                  s:   h d£}ˆ|vrdˆ› d}t |ƒ‚ˆ ‡ ‡‡fdd„¡S )uœ  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Á   Údenserj  ÚordinalzTRanking method must be one of {'average', 'min', 'max', 'dense', 'ordinal'}. Found 'ú'c                   s   ˆ  | ¡jˆˆ dS )N)rk  rå   )rA   ÚrankrN   ©rå   rk  r1   r>   r?   rO   ó	  r½   zExpr.rank.<locals>.<lambda>r  )r1   rk  rå   Úsupported_rank_methodsrã   r>   rq  r?   rp  ³	  s   7ÿÿÿz	Expr.rankúExprStringNamespace[Self]c                 C  ó   t | ƒS r9   r   rH   r>   r>   r?   rF   ø	  ó   zExpr.strúExprDateTimeNamespace[Self]c                 C  rt  r9   r   rH   r>   r>   r?   Údtü	  ru  zExpr.dtúExprCatNamespace[Self]c                 C  rt  r9   r   rH   r>   r>   r?   Úcat 
  ru  zExpr.catúExprNameNamespace[Self]c                 C  rt  r9   r   rH   r>   r>   r?   rU   
  ru  z	Expr.nameúExprListNamespace[Self]c                 C  rt  r9   r   rH   r>   r>   r?   rà   
  ru  z	Expr.listúExprStructNamespace[Self]c                 C  rt  r9   r   rH   r>   r>   r?   Ústruct
  ru  zExpr.struct)r1   r'   r2   r/   r3   r   r4   r5   )r2   rC   r4   r'   )r1   r'   r4   rF   )r1   r'   r4   r'   )r1   r'   rU   rF   r4   r'   )
r1   r'   r\   r]   r^   r_   r`   ra   r4   r.   )r1   r'   rc   rd   r4   r'   )r1   r'   rg   rh   r4   r'   )r1   r'   rg   r   r4   r'   )r1   r'   rž   r¥   rŸ   r¥   r    r¥   r¡   r¥   r¢   r¦   r£   r§   r¤   r¦   r4   r'   )r1   r'   r­   r§   r4   r'   r9   )r1   r'   r\   r¶   r·   r¸   r4   r'   )r1   r'   r4   r0   )r1   r'   rË   r¦   r4   r'   )r1   r'   rÓ   r§   r4   r'   )
r1   r'   r×   rØ   rÙ   rÚ   r·   rÛ   r4   r'   )r1   r'   rå   r¦   ræ   r¦   r4   r'   )rí   )
r1   r'   rî   rï   rð   rï   rñ   rò   r4   r'   )r1   r'   r  r   r4   r'   )NNN)
r1   r'   r  r  r  r  r  r  r4   r'   )r1   r'   rÓ   r  r  r¥   r  r¦   r  r  r4   r'   )r1   r'   r"  r#  r!  r$  r4   r'   )r1   r'   r8  r9  r:  r;  r4   r'   )r=  )r   )r1   r'   rC  r§   r4   r'   )r1   r'   rÓ   r§   rG  r§   r4   r'   )NN)r1   r'   rî   rJ  rð   rJ  r4   r'   )
r1   r'   rV  r§   r£   r  rU  r¦   r4   r'   )r1   r'   rV  r§   r£   r  rU  r¦   r­   r§   r4   r'   )rj  )r1   r'   rk  rl  rå   r¦   r4   r'   )r1   r'   r4   rs  )r1   r'   r4   rv  )r1   r'   r4   rx  )r1   r'   r4   rz  )r1   r'   r4   r{  )r1   r'   r4   r|  )bÚ__name__Ú
__module__Ú__qualname__rB   rE   rI   rT   rX   rb   re   ru   rw   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¨   rª   r«   r±   rµ   r»   rÀ   rM   rÁ   rÂ   rÃ   rÅ   rÆ   rÇ   rÈ   rL   rÍ   rÒ   rÔ   rÜ   rê   rý   rÿ   r  r  r
  r  r  r  r  r(  r3  r2  r4  r5  r7  r8  r?  rB  rD  rF  rH  rL  rN  rO  rP  rR  rS  rT  rZ  ra  rf  ri  rp  ÚpropertyrF   rw  ry  rU   rà   r}  r>   r>   r>   r?   r0   3   s   	"÷fý/#/5ýû;$ü=#0##ü^)þú,ýM!!)%!ý3&%%%)ûFûFúFúGþüEr0   N):Ú
__future__r   Útypingr   r   r   r   r   r   r	   Únarwhals._expression_parsingr
   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.   r/   Ú__annotations__r0   Ú__all__r>   r>   r>   r?   Ú<module>   s€    ÿ                   rÿ