§
    q-Ph3Þ  ã                  óÈ   — d dl mZ d dlZd dlZd dlmZmZ d dlmZm	Z	m
Z
 d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ erd d	lmZmZ d d
lmZmZmZmZ  G d„ d¦  «        ZdS )é    )ÚannotationsN)Ú
CollectionÚSequence)ÚTYPE_CHECKINGÚAnyÚCallable)Ú	functions)Úparse_into_expression)Úfind_stacklevel)Ú	wrap_expr)ÚExprÚSeries)ÚIntoExprÚIntoExprColumnÚListToStructWidthStrategyÚNullBehaviorc                  óÌ  — e Zd ZdZdZdod„Zdpd
„Zdqd„Zdqd„Zdqd„Z	dqd„Z
	 drdddddœdsd„Zdqd„Zdqd„Zdqd„Zdqd„Zdqd „Zdtdud#„Zdtdud$„Zddd%œdvd(„Zdqd)„Zdd*œdwd,„Zdqd-„Zdxd0„Zdd1œdyd5„Zdd1œdzd8„Z	 d{d|d<„Zdqd=„Zdqd>„Zd?d@œd}dC„Zd?dDœd~dH„ZdqdI„ZdqdJ„Z dd€dN„Z!dtddO„Z"	 drd‚dS„Z#dƒd„dU„Z$dƒd„dV„Z%dqdW„Z&d…dY„Z'd†d[„Z(	 	 	 d‡dd]œdˆdd„Z)ddeœd‰dg„Z*dŠdi„Z+d‹dk„Z,d‹dl„Z-d‹dm„Z.d‹dn„Z/dS )ŒÚExprListNameSpacez'Namespace for list related expressions.ÚlistÚexprr   ÚreturnÚNonec                ó   — |j         | _         d S ©N)Ú_pyexpr)Úselfr   s     úP/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/polars/expr/list.pyÚ__init__zExprListNameSpace.__init__   s   € Ø”|ˆŒˆˆó    ÚitemÚintc                ó,   — |                       |¦  «        S r   ©Úget)r   r    s     r   Ú__getitem__zExprListNameSpace.__getitem__    s   € ØxŠx˜‰~Œ~Ðr   c                óN   — t          | j                             ¦   «         ¦  «        S )u´  
        Evaluate whether all boolean values in a list are true.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {"a": [[True, True], [False, True], [False, False], [None], [], None]}
        ... )
        >>> df.with_columns(all=pl.col("a").list.all())
        shape: (6, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a              â”† all   â”‚
        â”‚ ---            â”† ---   â”‚
        â”‚ list[bool]     â”† bool  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ [true, true]   â”† true  â”‚
        â”‚ [false, true]  â”† false â”‚
        â”‚ [false, false] â”† false â”‚
        â”‚ [null]         â”† true  â”‚
        â”‚ []             â”† true  â”‚
        â”‚ null           â”† null  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_all©r   s    r   ÚallzExprListNameSpace.all#   ó    € õ0 ˜œ×.Ò.Ñ0Ô0Ñ1Ô1Ð1r   c                óN   — t          | j                             ¦   «         ¦  «        S )u²  
        Evaluate whether any boolean value in a list is true.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {"a": [[True, True], [False, True], [False, False], [None], [], None]}
        ... )
        >>> df.with_columns(any=pl.col("a").list.any())
        shape: (6, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a              â”† any   â”‚
        â”‚ ---            â”† ---   â”‚
        â”‚ list[bool]     â”† bool  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ [true, true]   â”† true  â”‚
        â”‚ [false, true]  â”† true  â”‚
        â”‚ [false, false] â”† false â”‚
        â”‚ [null]         â”† false â”‚
        â”‚ []             â”† false â”‚
        â”‚ null           â”† null  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_anyr(   s    r   ÚanyzExprListNameSpace.any=   r*   r   c                óN   — t          | j                             ¦   «         ¦  «        S )u  
        Return the number of elements in each list.

        Null values count towards the total.

        Returns
        -------
        Expr
            Expression of data type :class:`UInt32`.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[1, 2, None], [5]]})
        >>> df.with_columns(len=pl.col("a").list.len())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
        â”‚ a            â”† len â”‚
        â”‚ ---          â”† --- â”‚
        â”‚ list[i64]    â”† u32 â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
        â”‚ [1, 2, null] â”† 3   â”‚
        â”‚ [5]          â”† 1   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_lenr(   s    r   ÚlenzExprListNameSpace.lenW   s    € õ2 ˜œ×.Ò.Ñ0Ô0Ñ1Ô1Ð1r   c                óN   — t          | j                             ¦   «         ¦  «        S )u“  
        Drop all null values in the list.

        The original order of the remaining elements is preserved.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[None, 1, None, 2], [None], [3, 4]]})
        >>> df.with_columns(drop_nulls=pl.col("values").list.drop_nulls())
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ values         â”† drop_nulls â”‚
        â”‚ ---            â”† ---        â”‚
        â”‚ list[i64]      â”† list[i64]  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [null, 1, â€¦ 2] â”† [1, 2]     â”‚
        â”‚ [null]         â”† []         â”‚
        â”‚ [3, 4]         â”† [3, 4]     â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_drop_nullsr(   s    r   Ú
drop_nullszExprListNameSpace.drop_nullsr   s    € õ* ˜œ×5Ò5Ñ7Ô7Ñ8Ô8Ð8r   NF)ÚfractionÚwith_replacementÚshuffleÚseedÚnúint | IntoExprColumn | Noner4   úfloat | IntoExprColumn | Noner5   Úboolr6   r7   ú
int | Nonec               ó  — ||d}t          |¦  «        ‚|9t          |¦  «        }t          | j                             ||||¦  «        ¦  «        S |€d}t          |¦  «        }t          | j                             ||||¦  «        ¦  «        S )uT  
        Sample from this list.

        Parameters
        ----------
        n
            Number of items to return. Cannot be used with `fraction`. Defaults to 1 if
            `fraction` is None.
        fraction
            Fraction of items to return. Cannot be used with `n`.
        with_replacement
            Allow values to be sampled more than once.
        shuffle
            Shuffle the order of sampled data points.
        seed
            Seed for the random number generator. If set to None (default), a
            random seed is generated for each sample operation.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[1, 2, 3], [4, 5]], "n": [2, 1]})
        >>> df.with_columns(sample=pl.col("values").list.sample(n=pl.col("n"), seed=1))
        shape: (2, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ values    â”† n   â”† sample    â”‚
        â”‚ ---       â”† --- â”† ---       â”‚
        â”‚ list[i64] â”† i64 â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† 2   â”† [2, 1]    â”‚
        â”‚ [4, 5]    â”† 1   â”† [5]       â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Nz&cannot specify both `n` and `fraction`é   )Ú
ValueErrorr
   r   r   Úlist_sample_fractionÚlist_sample_n)r   r8   r4   r5   r6   r7   Úmsgs          r   ÚsamplezExprListNameSpace.sample‰   s£   € ðR ˆ=˜XÐ1Ø:ˆCÝ˜S‘/”/Ð!àÐÝ,¨XÑ6Ô6ˆHÝØ”×1Ò1ØÐ.°¸ñô ñô ð ð ˆ9ØˆAÝ! !Ñ$Ô$ˆÝ˜œ×3Ò3°AÐ7GÈÐRVÑWÔWÑXÔXÐXr   c                óN   — t          | j                             ¦   «         ¦  «        S )uP  
        Sum all the lists in the array.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[1], [2, 3]]})
        >>> df.with_columns(sum=pl.col("values").list.sum())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
        â”‚ values    â”† sum â”‚
        â”‚ ---       â”† --- â”‚
        â”‚ list[i64] â”† i64 â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
        â”‚ [1]       â”† 1   â”‚
        â”‚ [2, 3]    â”† 5   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_sumr(   s    r   ÚsumzExprListNameSpace.sumÃ   ó    € õ$ ˜œ×.Ò.Ñ0Ô0Ñ1Ô1Ð1r   c                óN   — t          | j                             ¦   «         ¦  «        S )ua  
        Compute the max value of the lists in the array.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[1], [2, 3]]})
        >>> df.with_columns(max=pl.col("values").list.max())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
        â”‚ values    â”† max â”‚
        â”‚ ---       â”† --- â”‚
        â”‚ list[i64] â”† i64 â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
        â”‚ [1]       â”† 1   â”‚
        â”‚ [2, 3]    â”† 3   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_maxr(   s    r   ÚmaxzExprListNameSpace.max×   rG   r   c                óN   — t          | j                             ¦   «         ¦  «        S )ua  
        Compute the min value of the lists in the array.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[1], [2, 3]]})
        >>> df.with_columns(min=pl.col("values").list.min())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”
        â”‚ values    â”† min â”‚
        â”‚ ---       â”† --- â”‚
        â”‚ list[i64] â”† i64 â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•¡
        â”‚ [1]       â”† 1   â”‚
        â”‚ [2, 3]    â”† 2   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_minr(   s    r   ÚminzExprListNameSpace.minë   rG   r   c                óN   — t          | j                             ¦   «         ¦  «        S )ur  
        Compute the mean value of the lists in the array.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[1], [2, 3]]})
        >>> df.with_columns(mean=pl.col("values").list.mean())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
        â”‚ values    â”† mean â”‚
        â”‚ ---       â”† ---  â”‚
        â”‚ list[i64] â”† f64  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
        â”‚ [1]       â”† 1.0  â”‚
        â”‚ [2, 3]    â”† 2.5  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Ú	list_meanr(   s    r   ÚmeanzExprListNameSpace.meanÿ   s    € õ$ ˜œ×/Ò/Ñ1Ô1Ñ2Ô2Ð2r   c                óN   — t          | j                             ¦   «         ¦  «        S )u³  
        Compute the median value of the lists in the array.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[-1, 0, 1], [1, 10]]})
        >>> df.with_columns(pl.col("values").list.median().alias("median"))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ values     â”† median â”‚
        â”‚ ---        â”† ---    â”‚
        â”‚ list[i64]  â”† f64    â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•¡
        â”‚ [-1, 0, 1] â”† 0.0    â”‚
        â”‚ [1, 10]    â”† 5.5    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_medianr(   s    r   ÚmedianzExprListNameSpace.median  s    € õ$ ˜œ×1Ò1Ñ3Ô3Ñ4Ô4Ð4r   r>   Úddofc                óP   — t          | j                             |¦  «        ¦  «        S )u°  
        Compute the std value of the lists in the array.

        Parameters
        ----------
        ddof
            â€œDelta Degrees of Freedomâ€: the divisor used in the calculation is N - ddof,
            where N represents the number of elements.
            By default ddof is 1.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[-1, 0, 1], [1, 10]]})
        >>> df.with_columns(pl.col("values").list.std().alias("std"))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ values     â”† std      â”‚
        â”‚ ---        â”† ---      â”‚
        â”‚ list[i64]  â”† f64      â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [-1, 0, 1] â”† 1.0      â”‚
        â”‚ [1, 10]    â”† 6.363961 â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_std©r   rT   s     r   ÚstdzExprListNameSpace.std'  ó"   € õ2 ˜œ×.Ò.¨tÑ4Ô4Ñ5Ô5Ð5r   c                óP   — t          | j                             |¦  «        ¦  «        S )ux  
        Compute the var value of the lists in the array.

        Parameters
        ----------
        ddof
            â€œDelta Degrees of Freedomâ€: the divisor used in the calculation is N - ddof,
            where N represents the number of elements.
            By default ddof is 1.

        Examples
        --------
        >>> df = pl.DataFrame({"values": [[-1, 0, 1], [1, 10]]})
        >>> df.with_columns(pl.col("values").list.var().alias("var"))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
        â”‚ values     â”† var  â”‚
        â”‚ ---        â”† ---  â”‚
        â”‚ list[i64]  â”† f64  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
        â”‚ [-1, 0, 1] â”† 1.0  â”‚
        â”‚ [1, 10]    â”† 40.5 â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_varrW   s     r   ÚvarzExprListNameSpace.varB  rY   r   )Ú
descendingÚ
nulls_lastr]   r^   c               óR   — t          | j                             ||¦  «        ¦  «        S )u£  
        Sort the lists in this column.

        Parameters
        ----------
        descending
            Sort in descending order.
        nulls_last
            Place null values last.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[3, 2, 1], [9, 1, 2]],
        ...     }
        ... )
        >>> df.with_columns(sort=pl.col("a").list.sort())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† sort      â”‚
        â”‚ ---       â”† ---       â”‚
        â”‚ list[i64] â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† [1, 2, 3] â”‚
        â”‚ [9, 1, 2] â”† [1, 2, 9] â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        >>> df.with_columns(sort=pl.col("a").list.sort(descending=True))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† sort      â”‚
        â”‚ ---       â”† ---       â”‚
        â”‚ list[i64] â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† [3, 2, 1] â”‚
        â”‚ [9, 1, 2] â”† [9, 2, 1] â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Ú	list_sort)r   r]   r^   s      r   ÚsortzExprListNameSpace.sort]  s%   € õN ˜œ×/Ò/°
¸JÑGÔGÑHÔHÐHr   c                óN   — t          | j                             ¦   «         ¦  «        S )uð  
        Reverse the arrays in the list.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[3, 2, 1], [9, 1, 2]],
        ...     }
        ... )
        >>> df.with_columns(reverse=pl.col("a").list.reverse())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† reverse   â”‚
        â”‚ ---       â”† ---       â”‚
        â”‚ list[i64] â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† [1, 2, 3] â”‚
        â”‚ [9, 1, 2] â”† [2, 1, 9] â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_reverser(   s    r   ÚreversezExprListNameSpace.reverse†  s    € õ, ˜œ×2Ò2Ñ4Ô4Ñ5Ô5Ð5r   )Úmaintain_orderre   c               óP   — t          | j                             |¦  «        ¦  «        S )uB  
        Get the unique/distinct values in the list.

        Parameters
        ----------
        maintain_order
            Maintain order of data. This requires more work.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 1, 2]],
        ...     }
        ... )
        >>> df.with_columns(unique=pl.col("a").list.unique())
        shape: (1, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† unique    â”‚
        â”‚ ---       â”† ---       â”‚
        â”‚ list[i64] â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 1, 2] â”† [1, 2]    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_unique)r   re   s     r   ÚuniquezExprListNameSpace.uniquež  s"   € õ4 ˜œ×1Ò1°.ÑAÔAÑBÔBÐBr   c                óN   — t          | j                             ¦   «         ¦  «        S )uú  
        Count the number of unique values in every sub-lists.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 1, 2], [2, 3, 4]],
        ...     }
        ... )
        >>> df.with_columns(n_unique=pl.col("a").list.n_unique())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† n_unique â”‚
        â”‚ ---       â”† ---      â”‚
        â”‚ list[i64] â”† u32      â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 1, 2] â”† 2        â”‚
        â”‚ [2, 3, 4] â”† 3        â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_n_uniquer(   s    r   Ún_uniquezExprListNameSpace.n_uniqueº  s    € õ, ˜œ×3Ò3Ñ5Ô5Ñ6Ô6Ð6r   Úotherú2list[Expr | str] | Expr | str | Series | list[Any]c                ó°  — t          |t          ¦  «        rZt          |d         t          j        t          t          j        f¦  «        s(|                      t          j        |g¦  «        ¦  «        S t          |t          ¦  «        s|gnt          j        |¦  «        }|                     dt          | j
        ¦  «        ¦  «         t          j        |¦  «        S )u¯  
        Concat the arrays in a Series dtype List in linear time.

        Parameters
        ----------
        other
            Columns to concat into a List Series

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [["a"], ["x"]],
        ...         "b": [["b", "c"], ["y", "z"]],
        ...     }
        ... )
        >>> df.with_columns(concat=pl.col("a").list.concat("b"))
        shape: (2, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† b          â”† concat          â”‚
        â”‚ ---       â”† ---        â”† ---             â”‚
        â”‚ list[str] â”† list[str]  â”† list[str]       â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ ["a"]     â”† ["b", "c"] â”† ["a", "b", "c"] â”‚
        â”‚ ["x"]     â”† ["y", "z"] â”† ["x", "y", "z"] â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        r   )Ú
isinstancer   Úplr   Ústrr   ÚconcatÚcopyÚinsertr   r   ÚFÚconcat_list)r   rl   Ú
other_lists      r   rr   zExprListNameSpace.concatÒ  s­   € õ8 eTÑ"Ô"ð 	3Ý˜5 œ8¥b¤g­sµB´IÐ%>Ñ?Ô?ð	3ð —;’;rœy¨%¨Ñ1Ô1Ñ2Ô2Ð2õ %/¨uµdÑ$;Ô$;ÐQeWWÅÄÈ5ÑAQÔAQˆ
à×Ò˜!Y t¤|Ñ4Ô4Ñ5Ô5Ð5ÝŒ}˜ZÑ(Ô(Ð(r   ©Únull_on_oobÚindexúint | Expr | strry   c               óp   — t          |¦  «        }t          | j                             ||¦  «        ¦  «        S )uN  
        Get the value by index in the sublists.

        So index `0` would return the first item of every sublist
        and index `-1` would return the last item of every sublist
        if an index is out of bounds, it will return a `None`.

        Parameters
        ----------
        index
            Index to return per sublist
        null_on_oob
            Behavior if an index is out of bounds:

            * True -> set as null
            * False -> raise an error

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[3, 2, 1], [], [1, 2]]})
        >>> df.with_columns(get=pl.col("a").list.get(0, null_on_oob=True))
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† get  â”‚
        â”‚ ---       â”† ---  â”‚
        â”‚ list[i64] â”† i64  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† 3    â”‚
        â”‚ []        â”† null â”‚
        â”‚ [1, 2]    â”† 1    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
        )r
   r   r   Úlist_get)r   rz   ry   s      r   r$   zExprListNameSpace.getù  s2   € õL & eÑ,Ô,ˆÝ˜œ×.Ò.¨u°kÑBÔBÑCÔCÐCr   Úindicesú+Expr | Series | list[int] | list[list[int]]c               óp   — t          |¦  «        }t          | j                             ||¦  «        ¦  «        S )uæ  
        Take sublists by multiple indices.

        The indices may be defined in a single column, or by sublists in another
        column of dtype `List`.

        Parameters
        ----------
        indices
            Indices to return per sublist
        null_on_oob
            Behavior if an index is out of bounds:
            True -> set as null
            False -> raise an error
            Note that defaulting to raising an error is much cheaper

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[3, 2, 1], [], [1, 2, 3, 4, 5]]})
        >>> df.with_columns(gather=pl.col("a").list.gather([0, 4], null_on_oob=True))
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a           â”† gather       â”‚
        â”‚ ---         â”† ---          â”‚
        â”‚ list[i64]   â”† list[i64]    â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1]   â”† [3, null]    â”‚
        â”‚ []          â”† [null, null] â”‚
        â”‚ [1, 2, â€¦ 5] â”† [1, 5]       â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r
   r   r   Úlist_gather)r   r~   ry   s      r   ÚgatherzExprListNameSpace.gather"  s2   € õJ (¨Ñ0Ô0ˆÝ˜œ×1Ò1°'¸;ÑGÔGÑHÔHÐHr   r   úint | IntoExprColumnÚoffsetc                óŽ   — t          |¦  «        }t          |¦  «        }t          | j                             ||¦  «        ¦  «        S )uî  
        Take every n-th value start from offset in sublists.

        Parameters
        ----------
        n
            Gather every n-th element.
        offset
            Starting index.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2, 3, 4, 5], [6, 7, 8], [9, 10, 11, 12]],
        ...         "n": [2, 1, 3],
        ...         "offset": [0, 1, 0],
        ...     }
        ... )
        >>> df.with_columns(
        ...     gather_every=pl.col("a").list.gather_every(
        ...         n=pl.col("n"), offset=pl.col("offset")
        ...     )
        ... )
        shape: (3, 4)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a             â”† n   â”† offset â”† gather_every â”‚
        â”‚ ---           â”† --- â”† ---    â”† ---          â”‚
        â”‚ list[i64]     â”† i64 â”† i64    â”† list[i64]    â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 5]   â”† 2   â”† 0      â”† [1, 3, 5]    â”‚
        â”‚ [6, 7, 8]     â”† 1   â”† 1      â”† [7, 8]       â”‚
        â”‚ [9, 10, â€¦ 12] â”† 3   â”† 0      â”† [9, 12]      â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r
   r   r   Úlist_gather_every)r   r8   r„   s      r   Úgather_everyzExprListNameSpace.gather_everyJ  s?   € õP " !Ñ$Ô$ˆÝ& vÑ.Ô.ˆÝ˜œ×7Ò7¸¸6ÑBÔBÑCÔCÐCr   c                ó0   — |                       dd¬¦  «        S )u™  
        Get the first value of the sublists.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[3, 2, 1], [], [1, 2]]})
        >>> df.with_columns(first=pl.col("a").list.first())
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† first â”‚
        â”‚ ---       â”† ---   â”‚
        â”‚ list[i64] â”† i64   â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† 3     â”‚
        â”‚ []        â”† null  â”‚
        â”‚ [1, 2]    â”† 1     â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
        r   Trx   r#   r(   s    r   ÚfirstzExprListNameSpace.firstv  s   € ð& xŠx˜ tˆxÑ,Ô,Ð,r   c                ó0   — |                       dd¬¦  «        S )u‡  
        Get the last value of the sublists.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[3, 2, 1], [], [1, 2]]})
        >>> df.with_columns(last=pl.col("a").list.last())
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† last â”‚
        â”‚ ---       â”† ---  â”‚
        â”‚ list[i64] â”† i64  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† 1    â”‚
        â”‚ []        â”† null â”‚
        â”‚ [1, 2]    â”† 2    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
        éÿÿÿÿTrx   r#   r(   s    r   ÚlastzExprListNameSpace.last‹  s   € ð& xŠx˜¨ˆxÑ-Ô-Ð-r   T)Únulls_equalr   r   c               ót   — t          |d¬¦  «        }t          | j                             ||¦  «        ¦  «        S )u  
        Check if sublists contain the given item.

        Parameters
        ----------
        item
            Item that will be checked for membership
        nulls_equal : bool, default True
            If True, treat null as a distinct value. Null values will not propagate.

        Returns
        -------
        Expr
            Expression of data type :class:`Boolean`.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[3, 2, 1], [], [1, 2]]})
        >>> df.with_columns(contains=pl.col("a").list.contains(1))
        shape: (3, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† contains â”‚
        â”‚ ---       â”† ---      â”‚
        â”‚ list[i64] â”† bool     â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [3, 2, 1] â”† true     â”‚
        â”‚ []        â”† false    â”‚
        â”‚ [1, 2]    â”† true     â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        T©Ú
str_as_lit)r
   r   r   Úlist_contains)r   r    r   s      r   ÚcontainszExprListNameSpace.contains   s6   € õ> % T°dÐ;Ñ;Ô;ˆÝ˜œ×3Ò3°D¸+ÑFÔFÑGÔGÐGr   )Úignore_nullsÚ	separatorr   r“   c               ót   — t          |d¬¦  «        }t          | j                             ||¦  «        ¦  «        S )u4  
        Join all string items in a sublist and place a separator between them.

        This errors if inner type of list `!= String`.

        Parameters
        ----------
        separator
            string to separate the items with
        ignore_nulls
            Ignore null values (default).

            If set to ``False``, null values will be propagated.
            If the sub-list contains any null values, the output is ``None``.

        Returns
        -------
        Expr
            Expression of data type :class:`String`.

        Examples
        --------
        >>> df = pl.DataFrame({"s": [["a", "b", "c"], ["x", "y"]]})
        >>> df.with_columns(join=pl.col("s").list.join(" "))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ s               â”† join  â”‚
        â”‚ ---             â”† ---   â”‚
        â”‚ list[str]       â”† str   â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ ["a", "b", "c"] â”† a b c â”‚
        â”‚ ["x", "y"]      â”† x y   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜

        >>> df = pl.DataFrame(
        ...     {"s": [["a", "b", "c"], ["x", "y"]], "separator": ["*", "_"]}
        ... )
        >>> df.with_columns(join=pl.col("s").list.join(pl.col("separator")))
        shape: (2, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ s               â”† separator â”† join  â”‚
        â”‚ ---             â”† ---       â”† ---   â”‚
        â”‚ list[str]       â”† str       â”† str   â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•¡
        â”‚ ["a", "b", "c"] â”† *         â”† a*b*c â”‚
        â”‚ ["x", "y"]      â”† _         â”† x_y   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”˜
        Tr   )r
   r   r   Ú	list_join)r   r”   r“   s      r   ÚjoinzExprListNameSpace.joinÂ  s7   € õb *¨)ÀÐEÑEÔEˆ	Ý˜œ×/Ò/°	¸<ÑHÔHÑIÔIÐIr   c                óN   — t          | j                             ¦   «         ¦  «        S )u…  
        Retrieve the index of the minimal value in every sublist.

        Returns
        -------
        Expr
            Expression of data type :class:`UInt32` or :class:`UInt64`
            (depending on compilation).

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2], [2, 1]],
        ...     }
        ... )
        >>> df.with_columns(arg_min=pl.col("a").list.arg_min())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† arg_min â”‚
        â”‚ ---       â”† ---     â”‚
        â”‚ list[i64] â”† u32     â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2]    â”† 0       â”‚
        â”‚ [2, 1]    â”† 1       â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_arg_minr(   s    r   Úarg_minzExprListNameSpace.arg_minö  ó    € õ8 ˜œ×2Ò2Ñ4Ô4Ñ5Ô5Ð5r   c                óN   — t          | j                             ¦   «         ¦  «        S )u…  
        Retrieve the index of the maximum value in every sublist.

        Returns
        -------
        Expr
            Expression of data type :class:`UInt32` or :class:`UInt64`
            (depending on compilation).

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2], [2, 1]],
        ...     }
        ... )
        >>> df.with_columns(arg_max=pl.col("a").list.arg_max())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† arg_max â”‚
        â”‚ ---       â”† ---     â”‚
        â”‚ list[i64] â”† u32     â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2]    â”† 1       â”‚
        â”‚ [2, 1]    â”† 0       â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_arg_maxr(   s    r   Úarg_maxzExprListNameSpace.arg_max  r›   r   ÚignoreÚnull_behaviorr   c                óR   — t          | j                             ||¦  «        ¦  «        S )uÜ  
        Calculate the first discrete difference between shifted items of every sublist.

        Parameters
        ----------
        n
            Number of slots to shift.
        null_behavior : {'ignore', 'drop'}
            How to handle null values.

        Examples
        --------
        >>> df = pl.DataFrame({"n": [[1, 2, 3, 4], [10, 2, 1]]})
        >>> df.with_columns(diff=pl.col("n").list.diff())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ n           â”† diff           â”‚
        â”‚ ---         â”† ---            â”‚
        â”‚ list[i64]   â”† list[i64]      â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 4] â”† [null, 1, â€¦ 1] â”‚
        â”‚ [10, 2, 1]  â”† [null, -8, -1] â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        >>> df.with_columns(diff=pl.col("n").list.diff(n=2))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ n           â”† diff              â”‚
        â”‚ ---         â”† ---               â”‚
        â”‚ list[i64]   â”† list[i64]         â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 4] â”† [null, null, â€¦ 2] â”‚
        â”‚ [10, 2, 1]  â”† [null, null, -9]  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        >>> df.with_columns(diff=pl.col("n").list.diff(n=2, null_behavior="drop"))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ n           â”† diff      â”‚
        â”‚ ---         â”† ---       â”‚
        â”‚ list[i64]   â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 4] â”† [2, 2]    â”‚
        â”‚ [10, 2, 1]  â”† [-9]      â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Ú	list_diff)r   r8   r    s      r   ÚdiffzExprListNameSpace.diff2  s%   € õ^ ˜œ×/Ò/°°=ÑAÔAÑBÔBÐBr   c                ón   — t          |¦  «        }t          | j                             |¦  «        ¦  «        S )u[  
        Shift list values by the given number of indices.

        Parameters
        ----------
        n
            Number of indices to shift forward. If a negative value is passed, values
            are shifted in the opposite direction instead.

        Notes
        -----
        This method is similar to the `LAG` operation in SQL when the value for `n`
        is positive. With a negative value for `n`, it is similar to `LEAD`.

        Examples
        --------
        By default, list values are shifted forward by one index.

        >>> df = pl.DataFrame({"a": [[1, 2, 3], [4, 5]]})
        >>> df.with_columns(shift=pl.col("a").list.shift())
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† shift        â”‚
        â”‚ ---       â”† ---          â”‚
        â”‚ list[i64] â”† list[i64]    â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† [null, 1, 2] â”‚
        â”‚ [4, 5]    â”† [null, 4]    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        Pass a negative value to shift in the opposite direction instead.

        >>> df.with_columns(shift=pl.col("a").list.shift(-2))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† shift           â”‚
        â”‚ ---       â”† ---             â”‚
        â”‚ list[i64] â”† list[i64]       â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† [3, null, null] â”‚
        â”‚ [4, 5]    â”† [null, null]    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r
   r   r   Ú
list_shift©r   r8   s     r   ÚshiftzExprListNameSpace.shiftc  s0   € õX " !Ñ$Ô$ˆÝ˜œ×0Ò0°Ñ3Ô3Ñ4Ô4Ð4r   úint | str | ExprÚlengthúint | str | Expr | Nonec                óŽ   — t          |¦  «        }t          |¦  «        }t          | j                             ||¦  «        ¦  «        S )u´  
        Slice every sublist.

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

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[1, 2, 3, 4], [10, 2, 1]]})
        >>> df.with_columns(slice=pl.col("a").list.slice(1, 2))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a           â”† slice     â”‚
        â”‚ ---         â”† ---       â”‚
        â”‚ list[i64]   â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 4] â”† [2, 3]    â”‚
        â”‚ [10, 2, 1]  â”† [2, 1]    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r
   r   r   Ú
list_slice)r   r„   r©   s      r   ÚslicezExprListNameSpace.slice’  s>   € õ8 ' vÑ.Ô.ˆÝ& vÑ.Ô.ˆÝ˜œ×0Ò0°¸Ñ@Ô@ÑAÔAÐAr   é   c                ó.   — |                       d|¦  «        S )u?  
        Slice the first `n` values of every sublist.

        Parameters
        ----------
        n
            Number of values to return for each sublist.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[1, 2, 3, 4], [10, 2, 1]]})
        >>> df.with_columns(head=pl.col("a").list.head(2))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a           â”† head      â”‚
        â”‚ ---         â”† ---       â”‚
        â”‚ list[i64]   â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 4] â”† [1, 2]    â”‚
        â”‚ [10, 2, 1]  â”† [10, 2]   â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        r   )r­   r¦   s     r   ÚheadzExprListNameSpace.head²  s   € ð. zŠz˜!˜QÑÔÐr   c                ón   — t          |¦  «        }t          | j                             |¦  «        ¦  «        S )u>  
        Slice the last `n` values of every sublist.

        Parameters
        ----------
        n
            Number of values to return for each sublist.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[1, 2, 3, 4], [10, 2, 1]]})
        >>> df.with_columns(tail=pl.col("a").list.tail(2))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a           â”† tail      â”‚
        â”‚ ---         â”† ---       â”‚
        â”‚ list[i64]   â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, â€¦ 4] â”† [3, 4]    â”‚
        â”‚ [10, 2, 1]  â”† [2, 1]    â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r
   r   r   Ú	list_tailr¦   s     r   ÚtailzExprListNameSpace.tailË  s/   € õ. " !Ñ$Ô$ˆÝ˜œ×/Ò/°Ñ2Ô2Ñ3Ô3Ð3r   c                óN   — t          | j                             ¦   «         ¦  «        S )uä  
        Returns a column with a separate row for every list element.

        Returns
        -------
        Expr
            Expression with the data type of the list elements.

        See Also
        --------
        Expr.reshape: Reshape this Expr to a flat Series or a Series of Lists.

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[1, 2, 3], [4, 5, 6]]})
        >>> df.select(pl.col("a").list.explode())
        shape: (6, 1)
        â”Œâ”€â”€â”€â”€â”€â”
        â”‚ a   â”‚
        â”‚ --- â”‚
        â”‚ i64 â”‚
        â•žâ•â•â•â•â•â•¡
        â”‚ 1   â”‚
        â”‚ 2   â”‚
        â”‚ 3   â”‚
        â”‚ 4   â”‚
        â”‚ 5   â”‚
        â”‚ 6   â”‚
        â””â”€â”€â”€â”€â”€â”˜
        )r   r   Úexploder(   s    r   rµ   zExprListNameSpace.explodeå  s    € õ> ˜œ×-Ò-Ñ/Ô/Ñ0Ô0Ð0r   Úelementc                ór   — t          |d¬¦  «        }t          | j                             |¦  «        ¦  «        S )uE  
        Count how often the value produced by `element` occurs.

        Parameters
        ----------
        element
            An expression that produces a single value

        Examples
        --------
        >>> df = pl.DataFrame({"a": [[0], [1], [1, 2, 3, 2], [1, 2, 1], [4, 4]]})
        >>> df.with_columns(number_of_twos=pl.col("a").list.count_matches(2))
        shape: (5, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a           â”† number_of_twos â”‚
        â”‚ ---         â”† ---            â”‚
        â”‚ list[i64]   â”† u32            â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [0]         â”† 0              â”‚
        â”‚ [1]         â”† 0              â”‚
        â”‚ [1, 2, â€¦ 2] â”† 2              â”‚
        â”‚ [1, 2, 1]   â”† 1              â”‚
        â”‚ [4, 4]      â”† 0              â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Tr   )r
   r   r   Úlist_count_matches)r   r¶   s     r   Úcount_matcheszExprListNameSpace.count_matches  s4   € õ4 (¨¸DÐAÑAÔAˆÝ˜œ×8Ò8¸ÑAÔAÑBÔBÐBr   Úwidthc                óP   — t          | j                             |¦  «        ¦  «        S )u  
        Convert a List column into an Array column with the same inner data type.

        Parameters
        ----------
        width
            Width of the resulting Array column.

        Returns
        -------
        Expr
            Expression of data type :class:`Array`.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     data={"a": [[1, 2], [3, 4]]},
        ...     schema={"a": pl.List(pl.Int8)},
        ... )
        >>> df.with_columns(array=pl.col("a").list.to_array(2))
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a        â”† array        â”‚
        â”‚ ---      â”† ---          â”‚
        â”‚ list[i8] â”† array[i8, 2] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2]   â”† [1, 2]       â”‚
        â”‚ [3, 4]   â”† [3, 4]       â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_to_array)r   rº   s     r   Úto_arrayzExprListNameSpace.to_array#  s"   € õ> ˜œ×3Ò3°EÑ:Ô:Ñ;Ô;Ð;r   Úfirst_non_null)Ú_eagerÚn_field_strategyr   Úfieldsú+Sequence[str] | Callable[[int], str] | NoneÚupper_boundr¿   c               ó   — t          |t          ¦  «        r)| j                             |¦  «        }t	          |¦  «        S |s$d}t          j        |t          ¦   «         ¬¦  «         | j                             |||¦  «        }t	          |¦  «        S )uY  
        Convert the Series of type `List` to a Series of type `Struct`.

        Parameters
        ----------
        n_field_strategy : {'first_non_null', 'max_width'}
            Strategy to determine the number of fields of the struct.

            * "first_non_null": set number of fields equal to the length of the
              first non zero-length sublist.
            * "max_width": set number of fields as max length of all sublists.
        fields
            If the name and number of the desired fields is known in advance
            a list of field names can be given, which will be assigned by index.
            Otherwise, to dynamically assign field names, a custom function can be
            used; if neither are set, fields will be `field_0, field_1 .. field_n`.
        upper_bound
            A polars `LazyFrame` needs to know the schema at all times, so the
            caller must provide an upper bound of the number of struct fields that
            will be created; if set incorrectly, subsequent operations may fail.
            (For example, an `all().sum()` expression will look in the current
            schema to determine which columns to select).

            When operating on a `DataFrame`, the schema does not need to be
            tracked or pre-determined, as the result will be eagerly evaluated,
            so you can leave this parameter unset.

        Notes
        -----
        It is recommended to set 'upper_bound' to the correct output size of the struct.
        If this is not set, Polars will not know the output type of this operation and
        will set it to 'Unknown' which can lead to errors because Polars is not able
        to resolve the query.

        For performance reasons, the length of the first non-null sublist is used
        to determine the number of output fields. If the sublists can be of different
        lengths then `n_field_strategy="max_width"` must be used to obtain the expected
        result.

        Examples
        --------
        Convert list to struct with default field name assignment:

        >>> df = pl.DataFrame({"n": [[0, 1], [0, 1, 2]]})
        >>> df.with_columns(struct=pl.col("n").list.to_struct())  # doctest: +SKIP
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ n         â”† struct    â”‚
        â”‚ ---       â”† ---       â”‚
        â”‚ list[i64] â”† struct[2] â”‚ # <- struct with 2 fields
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [0, 1]    â”† {0,1}     â”‚ # OK
        â”‚ [0, 1, 2] â”† {0,1}     â”‚ # NOT OK - last value missing
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        As the shorter sublist comes first, we must use the `max_width`
        strategy to force a search for the longest.

        >>> df.with_columns(
        ...     struct=pl.col("n").list.to_struct(n_field_strategy="max_width")
        ... )  # doctest: +SKIP
        shape: (2, 2)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ n         â”† struct     â”‚
        â”‚ ---       â”† ---        â”‚
        â”‚ list[i64] â”† struct[3]  â”‚ # <- struct with 3 fields
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [0, 1]    â”† {0,1,null} â”‚ # OK
        â”‚ [0, 1, 2] â”† {0,1,2}    â”‚ # OK
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        Convert list to struct with field name assignment by function/index:

        >>> df = pl.DataFrame({"n": [[0, 1], [2, 3]]})
        >>> df.select(pl.col("n").list.to_struct(fields=lambda idx: f"n{idx}")).rows(
        ...     named=True
        ... )  # doctest: +SKIP
        [{'n': {'n0': 0, 'n1': 1}}, {'n': {'n0': 2, 'n1': 3}}]

        Convert list to struct with field name assignment by index from a list of names:

        >>> df.select(pl.col("n").list.to_struct(fields=["one", "two"])).rows(
        ...     named=True
        ... )
        [{'n': {'one': 0, 'two': 1}}, {'n': {'one': 2, 'two': 3}}]
        z`to_struct()` should be passed a list of field names to avoid query errors in subsequent operations (e.g. <struct operation> not supported for dtype Unknown))Ú
stacklevel)	ro   r   r   Úlist_to_struct_fixed_widthr   ÚwarningsÚwarnr   Úlist_to_struct)r   rÀ   rÁ   rÃ   r¿   ÚpyexprrB   s          r   Ú	to_structzExprListNameSpace.to_structD  s’   € õ| fhÑ'Ô'ð 	%Ø”\×<Ò<¸VÑDÔDˆFÝ˜VÑ$Ô$Ð$àð Að7ð õ
 ”˜c­oÑ.?Ô.?Ð@Ñ@Ô@Ð@Ø”\×0Ò0Ð1AÀ6È;ÑWÔWˆFÝ˜VÑ$Ô$Ð$r   )ÚparallelrÌ   c               ó\   — t          | j                             |j        |¦  «        ¦  «        S )u
  
        Run any polars expression against the lists' elements.

        Parameters
        ----------
        expr
            Expression to run. Note that you can select an element with `pl.first()`, or
            `pl.col()`
        parallel
            Run all expression parallel. Don't activate this blindly.
            Parallelism is worth it if there is enough work to do per thread.

            This likely should not be used in the group by context, because we already
            parallel execution per group

        Examples
        --------
        >>> df = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
        >>> df.with_columns(
        ...     rank=pl.concat_list("a", "b").list.eval(pl.element().rank())
        ... )
        shape: (3, 3)
        â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a   â”† b   â”† rank       â”‚
        â”‚ --- â”† --- â”† ---        â”‚
        â”‚ i64 â”† i64 â”† list[f64]  â”‚
        â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ 1   â”† 4   â”† [1.0, 2.0] â”‚
        â”‚ 8   â”† 5   â”† [2.0, 1.0] â”‚
        â”‚ 3   â”† 2   â”† [2.0, 1.0] â”‚
        â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Ú	list_eval)r   r   rÌ   s      r   ÚevalzExprListNameSpace.eval°  s'   € õB ˜œ×/Ò/°´¸hÑGÔGÑHÔHÐHr   Ú	predicatec                óZ   — t          | j                             |j        ¦  «        ¦  «        S )u  
        Filter elements in each list by a boolean expression.

        Parameters
        ----------
        predicate
            A boolean expression that is evaluated per list element.
            You can refer to the current element with `pl.element()`.

        Examples
        --------
        >>> import polars as pl
        >>> df = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2]})
        >>> df.with_columns(
        ...     evens=pl.concat_list("a", "b").list.filter(pl.element() % 2 == 0)
        ... )
        shape: (3, 3)
        â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a   â”† b   â”† evens     â”‚
        â”‚ --- â”† --- â”† ---       â”‚
        â”‚ i64 â”† i64 â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•ªâ•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ 1   â”† 4   â”† [4]       â”‚
        â”‚ 8   â”† 5   â”† [8]       â”‚
        â”‚ 3   â”† 2   â”† [2]       â”‚
        â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        )r   r   Úlist_filter)r   rÐ   s     r   ÚfilterzExprListNameSpace.filterÓ  s%   € õ8 ˜œ×1Ò1°)Ô2CÑDÔDÑEÔEÐEr   úIntoExpr | Collection[Any]c                ón  — t          |t          ¦  «        rjt          |t          ¦  «        sUt          |t          t          j        t          j        f¦  «        st          |¦  «        }t          j	        |¦  «        j
        }nt          |¦  «        }t          | j
                             |d¦  «        ¦  «        S )u¦  
        Compute the SET UNION between the elements in this list and the elements of `other`.

        Parameters
        ----------
        other
            Right hand side of the set operation.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2, 3], [], [None, 3], [5, 6, 7]],
        ...         "b": [[2, 3, 4], [3], [3, 4, None], [6, 8]],
        ...     }
        ... )
        >>> df.with_columns(
        ...     union=pl.col("a").list.set_union("b")
        ... )  # doctest: +IGNORE_RESULT
        shape: (4, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† b            â”† union         â”‚
        â”‚ ---       â”† ---          â”† ---           â”‚
        â”‚ list[i64] â”† list[i64]    â”† list[i64]     â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† [2, 3, 4]    â”† [1, 2, 3, 4]  â”‚
        â”‚ []        â”† [3]          â”† [3]           â”‚
        â”‚ [null, 3] â”† [3, 4, null] â”† [null, 3, 4]  â”‚
        â”‚ [5, 6, 7] â”† [6, 8]       â”† [5, 6, 7, 8]  â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Úunion©ro   r   rq   r   rp   r   Ú	DataFramer   ru   Úlitr   r
   r   Úlist_set_operation©r   rl   s     r   Ú	set_unionzExprListNameSpace.set_unionñ  s   € õ@ eZÑ(Ô(ð 	1µ¸EÅ3Ñ1GÔ1Gð 	1Ý˜e¥hµ´	½2¼<Ð%HÑIÔIð $Ý˜U™œÝ”E˜%‘L”LÔ(ˆEˆEå)¨%Ñ0Ô0ˆEÝ˜œ×8Ò8¸ÀÑHÔHÑIÔIÐIr   c                ón  — t          |t          ¦  «        rjt          |t          ¦  «        sUt          |t          t          j        t          j        f¦  «        st          |¦  «        }t          j	        |¦  «        j
        }nt          |¦  «        }t          | j
                             |d¦  «        ¦  «        S )uÈ  
        Compute the SET DIFFERENCE between the elements in this list and the elements of `other`.

        Parameters
        ----------
        other
            Right hand side of the set operation.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2, 3], [], [None, 3], [5, 6, 7]],
        ...         "b": [[2, 3, 4], [3], [3, 4, None], [6, 8]],
        ...     }
        ... )
        >>> df.with_columns(difference=pl.col("a").list.set_difference("b"))
        shape: (4, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† b            â”† difference â”‚
        â”‚ ---       â”† ---          â”† ---        â”‚
        â”‚ list[i64] â”† list[i64]    â”† list[i64]  â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† [2, 3, 4]    â”† [1]        â”‚
        â”‚ []        â”† [3]          â”† []         â”‚
        â”‚ [null, 3] â”† [3, 4, null] â”† []         â”‚
        â”‚ [5, 6, 7] â”† [6, 8]       â”† [5, 7]     â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

        See Also
        --------
        polars.Expr.list.diff: Calculates the n-th discrete difference of every sublist.
        Ú
differencer×   rÛ   s     r   Úset_differencez ExprListNameSpace.set_difference  s   € õD eZÑ(Ô(ð 	1µ¸EÅ3Ñ1GÔ1Gð 	1Ý˜e¥hµ´	½2¼<Ð%HÑIÔIð $Ý˜U™œÝ”E˜%‘L”LÔ(ˆEˆEå)¨%Ñ0Ô0ˆEÝ˜œ×8Ò8¸ÀÑMÔMÑNÔNÐNr   c                ón  — t          |t          ¦  «        rjt          |t          ¦  «        sUt          |t          t          j        t          j        f¦  «        st          |¦  «        }t          j	        |¦  «        j
        }nt          |¦  «        }t          | j
                             |d¦  «        ¦  «        S )ur  
        Compute the SET INTERSECTION between the elements in this list and the elements of `other`.

        Parameters
        ----------
        other
            Right hand side of the set operation.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2, 3], [], [None, 3], [5, 6, 7]],
        ...         "b": [[2, 3, 4], [3], [3, 4, None], [6, 8]],
        ...     }
        ... )
        >>> df.with_columns(intersection=pl.col("a").list.set_intersection("b"))
        shape: (4, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† b            â”† intersection â”‚
        â”‚ ---       â”† ---          â”† ---          â”‚
        â”‚ list[i64] â”† list[i64]    â”† list[i64]    â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† [2, 3, 4]    â”† [2, 3]       â”‚
        â”‚ []        â”† [3]          â”† []           â”‚
        â”‚ [null, 3] â”† [3, 4, null] â”† [null, 3]    â”‚
        â”‚ [5, 6, 7] â”† [6, 8]       â”† [6]          â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Úintersectionr×   rÛ   s     r   Úset_intersectionz"ExprListNameSpace.set_intersectionC  sŽ   € õ< eZÑ(Ô(ð 	1µ¸EÅ3Ñ1GÔ1Gð 	1Ý˜e¥hµ´	½2¼<Ð%HÑIÔIð $Ý˜U™œÝ”E˜%‘L”LÔ(ˆEˆEå)¨%Ñ0Ô0ˆEÝ˜œ×8Ò8¸ÀÑOÔOÑPÔPÐPr   c                ón  — t          |t          ¦  «        rjt          |t          ¦  «        sUt          |t          t          j        t          j        f¦  «        st          |¦  «        }t          j	        |¦  «        j
        }nt          |¦  «        }t          | j
                             |d¦  «        ¦  «        S )uK  
        Compute the SET SYMMETRIC DIFFERENCE between the elements in this list and the elements of `other`.

        Parameters
        ----------
        other
            Right hand side of the set operation.

        Examples
        --------
        >>> df = pl.DataFrame(
        ...     {
        ...         "a": [[1, 2, 3], [], [None, 3], [5, 6, 7]],
        ...         "b": [[2, 3, 4], [3], [3, 4, None], [6, 8]],
        ...     }
        ... )
        >>> df.with_columns(sdiff=pl.col("b").list.set_symmetric_difference("a"))
        shape: (4, 3)
        â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
        â”‚ a         â”† b            â”† sdiff     â”‚
        â”‚ ---       â”† ---          â”† ---       â”‚
        â”‚ list[i64] â”† list[i64]    â”† list[i64] â”‚
        â•žâ•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•¡
        â”‚ [1, 2, 3] â”† [2, 3, 4]    â”† [4, 1]    â”‚
        â”‚ []        â”† [3]          â”† [3]       â”‚
        â”‚ [null, 3] â”† [3, 4, null] â”† [4]       â”‚
        â”‚ [5, 6, 7] â”† [6, 8]       â”† [8, 5, 7] â”‚
        â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
        Úsymmetric_differencer×   rÛ   s     r   Úset_symmetric_differencez*ExprListNameSpace.set_symmetric_differencei  s   € õ< eZÑ(Ô(ð 	1µ¸EÅ3Ñ1GÔ1Gð 	1Ý˜e¥hµ´	½2¼<Ð%HÑIÔIð $Ý˜U™œÝ”E˜%‘L”LÔ(ˆEˆEå)¨%Ñ0Ô0ˆEÝ˜œ×8Ò8¸Ð@VÑWÔWÑXÔXÐXr   )r   r   r   r   )r    r!   r   r   )r   r   r   )r8   r9   r4   r:   r5   r;   r6   r;   r7   r<   r   r   )r>   )rT   r!   r   r   )r]   r;   r^   r;   r   r   )re   r;   r   r   )rl   rm   r   r   )rz   r{   ry   r;   r   r   )r~   r   ry   r;   r   r   )r   )r8   rƒ   r„   rƒ   r   r   )r    r   r   r;   r   r   )r”   r   r“   r;   r   r   )r>   rŸ   )r8   r!   r    r   r   r   )r8   rƒ   r   r   )r„   r¨   r©   rª   r   r   )r®   )r8   r¨   r   r   )r¶   r   r   r   )rº   r!   r   r   )r¾   NN)
rÀ   r   rÁ   rÂ   rÃ   r<   r¿   r;   r   r   )r   r   rÌ   r;   r   r   )rÐ   r   r   r   )rl   rÔ   r   r   )0Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	_accessorr   r%   r)   r-   r0   r3   rC   rF   rJ   rM   rP   rS   rX   r\   ra   rd   rh   rk   rr   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      sÒ  € € € € € Ø1Ð1à€Ið$ð $ð $ð $ðð ð ð ð2ð 2ð 2ð 2ð42ð 2ð 2ð 2ð42ð 2ð 2ð 2ð69ð 9ð 9ð 9ð2 *.ð8Yð 37Ø!&ØØð8Yð 8Yð 8Yð 8Yð 8Yð 8Yðt2ð 2ð 2ð 2ð(2ð 2ð 2ð 2ð(2ð 2ð 2ð 2ð(3ð 3ð 3ð 3ð(5ð 5ð 5ð 5ð(6ð 6ð 6ð 6ð 6ð66ð 6ð 6ð 6ð 6ð6 */À5ð 'Ið 'Ið 'Ið 'Ið 'Ið 'IðR6ð 6ð 6ð 6ð0 05ð Cð Cð Cð Cð Cð Cð87ð 7ð 7ð 7ð0%)ð %)ð %)ð %)ðV "ð	'Dð 'Dð 'Dð 'Dð 'Dð 'DðZ "ð	&Ið &Ið &Ið &Ið &Ið &IðV ()ð*Dð *Dð *Dð *Dð *DðX-ð -ð -ð -ð*.ð .ð .ð .ð* ?Cð  Hð  Hð  Hð  Hð  Hð  HðD GKð 2Jð 2Jð 2Jð 2Jð 2Jð 2Jðh6ð 6ð 6ð 6ð<6ð 6ð 6ð 6ð</Cð /Cð /Cð /Cð /Cðb-5ð -5ð -5ð -5ð -5ð` KOðBð Bð Bð Bð Bð@ ð  ð  ð  ð  ð24ð 4ð 4ð 4ð 4ð41ð 1ð 1ð 1ðBCð Cð Cð Cð:<ð <ð <ð <ðF 7GØ>BØ"&ð	j%ð ðj%ð j%ð j%ð j%ð j%ð j%ðX 49ð !Ið !Ið !Ið !Ið !Ið !IðFFð Fð Fð Fð<&Jð &Jð &Jð &JðP(Oð (Oð (Oð (OðT$Qð $Qð $Qð $QðL$Yð $Yð $Yð $Yð $Yð $Yr   r   )Ú
__future__r   rs   rÇ   Úcollections.abcr   r   Útypingr   r   r   Úpolars._reexportÚ	_reexportrp   Úpolarsr	   ru   Úpolars._utils.parser
   Úpolars._utils.variousr   Úpolars._utils.wrapr   r   r   Úpolars._typingr   r   r   r   r   rë   r   r   ú<module>rö      s[  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ð /à Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø (Ð (Ð (Ð (Ð (Ð (àð Ø#Ð#Ð#Ð#Ð#Ð#Ð#Ð#ðð ð ð ð ð ð ð ð ð ð ð ðuYð uYð uYð uYð uYñ uYô uYð uYð uYð uYr   