ó
    œþöhŒÚ  ã                  óÎ   • S SK Jr  S SKrS SKJrJr  S SKJrJrJ	r	  S SK
Jr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  \(       a  S S
KJrJr  S SKJrJrJrJr   " S S5      rg)é    )ÚannotationsN)Ú
CollectionÚSequence)ÚTYPE_CHECKINGÚAnyÚCallable)Ú
exceptions)Ú	functions)Úparse_into_expression)Úissue_warning)Ú	wrap_expr)ÚExprÚSeries)ÚIntoExprÚIntoExprColumnÚListToStructWidthStrategyÚNullBehaviorc                  ó’  • \ rS rSrSrSrS:S jrS;S jrS<S jrS<S jr	S<S jr
S<S	 jr S=S
SSS
S.           S>S jjjrS<S jrS<S jrS<S jrS<S jrS<S jrS?S@S jjrS?S@S jjrSSS.SAS jjrS<S jrSS.SBS jjrS<S jrSCS jrSS.     SDS jjrSS.     SES jjr SF     SGS jjrS<S  jrS<S! jrS"S#.SHS$ jjrS"S%.SIS& jjrS<S' jr S<S( jr!SJSKS) jjr"S?SLS* jjr# S=     SMS+ jjr$SNSOS, jjr%SNSOS- jjr&S<S. jr'SPS/ jr(SQS0 jr)   SR       SSS1 jjr*SS2.STS3 jjr+SUS4 jr,SVS5 jr-SVS6 jr.SVS7 jr/SVS8 jr0S9r1g
)WÚExprListNameSpaceé   z'Namespace for list related expressions.Úlistc                ó&   • UR                   U l         g ©N©Ú_pyexpr)ÚselfÚexprs     ÚJ/home/james-whalen/.local/lib/python3.13/site-packages/polars/expr/list.pyÚ__init__ÚExprListNameSpace.__init__   s   € Ø—|‘|ˆó    c                ó$   • U R                  U5      $ r   ©Úget)r   Úitems     r   Ú__getitem__ÚExprListNameSpace.__getitem__    s   € Øx‰x˜‹~Ðr!   c                óH   • [        U R                  R                  5       5      $ )u[  
Evaluate whether all boolean values in a list are true.

Notes
-----
If there are no non-null elements in a row, the output is `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   ÚallÚExprListNameSpace.all#   ó   € ô8 ˜Ÿ™×.Ñ.Ó0Ó1Ð1r!   c                óH   • [        U R                  R                  5       5      $ )uZ  
Evaluate whether any boolean value in a list is true.

Notes
-----
If there are no non-null elements in a row, the output is `False`.

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   ÚanyÚExprListNameSpace.anyA   r-   r!   c                óH   • [        U R                  R                  5       5      $ )us  
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   ÚlenÚExprListNameSpace.len_   s   € ô2 ˜Ÿ™×.Ñ.Ó0Ó1Ð1r!   c                óH   • [        U R                  R                  5       5      $ )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_nullsÚExprListNameSpace.drop_nullsz   s   € ô* ˜Ÿ™×5Ñ5Ó7Ó8Ð8r!   NF)ÚfractionÚwith_replacementÚshuffleÚseedc               óø   • Ub  Ub  Sn[        U5      eUb0  [        U5      n[        U R                  R	                  XsXE5      5      $ Uc  Sn[        U5      n[        U R                  R                  XƒXE5      5      $ )ul  
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, 3]    â”‚
â”‚ [4, 5]    â”† 1   â”† [5]       â”‚
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
z&cannot specify both `n` and `fraction`é   )Ú
ValueErrorr   r   r   Úlist_sample_fractionÚlist_sample_n)	r   Únr:   r;   r<   r=   ÚmsgÚfraction_pyexprÚn_pyexprs	            r   ÚsampleÚExprListNameSpace.sample‘   s‰   € ðR ‰=˜XÑ1Ø:ˆCÜ˜S“/Ð!àÑÜ3°HÓ=ˆOÜØ—‘×1Ñ1Ø#°wóóð ð ‰9ØˆAÜ(¨Ó+ˆÜØL‰L×&Ñ& xÀ7ÓQó
ð 	
r!   c                óH   • [        U R                  R                  5       5      $ )u$  
Sum all the lists in the array.

Notes
-----
If there are no non-null elements in a row, the output is `0`.

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   ÚsumÚExprListNameSpace.sumÍ   s   € ô, ˜Ÿ™×.Ñ.Ó0Ó1Ð1r!   c                óH   • [        U R                  R                  5       5      $ )ué  
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   ÚmaxÚExprListNameSpace.maxå   ó   € ô$ ˜Ÿ™×.Ñ.Ó0Ó1Ð1r!   c                óH   • [        U R                  R                  5       5      $ )ué  
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   ÚminÚExprListNameSpace.minù   rQ   r!   c                óH   • [        U R                  R                  5       5      $ )uú  
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   ÚmeanÚExprListNameSpace.mean  s   € ô$ ˜Ÿ™×/Ñ/Ó1Ó2Ð2r!   c                óH   • [        U R                  R                  5       5      $ )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   ÚmedianÚExprListNameSpace.median!  s   € ô$ ˜Ÿ™×1Ñ1Ó3Ó4Ð4r!   c                óJ   • [        U R                  R                  U5      5      $ )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   Úddofs     r   ÚstdÚExprListNameSpace.std5  ó   € ô2 ˜Ÿ™×.Ñ.¨tÓ4Ó5Ð5r!   c                óJ   • [        U R                  R                  U5      5      $ )uÐ  
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_varr`   s     r   ÚvarÚExprListNameSpace.varP  rd   r!   )Ú
descendingÚ
nulls_lastc               óJ   • [        U R                  R                  X5      5      $ )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   ri   rj   s      r   ÚsortÚExprListNameSpace.sortk  s   € ôN ˜Ÿ™×/Ñ/°
ÓGÓHÐHr!   c                óH   • [        U R                  R                  5       5      $ )uX  
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   ÚreverseÚExprListNameSpace.reverse”  s   € ô, ˜Ÿ™×2Ñ2Ó4Ó5Ð5r!   )Úmaintain_orderc               óJ   • [        U R                  R                  U5      5      $ )u’  
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   rs   s     r   ÚuniqueÚExprListNameSpace.unique¬  s   € ô4 ˜Ÿ™×1Ñ1°.ÓAÓBÐBr!   c                óH   • [        U R                  R                  5       5      $ )ub  
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_uniqueÚExprListNameSpace.n_uniqueÈ  s   € ô, ˜Ÿ™×3Ñ3Ó5Ó6Ð6r!   c                ó¸  • [        U[        5      (       a]  [        US   [        R                  [        [        R
                  45      (       d&  U R                  [        R
                  " U/5      5      $ [        U[        5      (       d  U/O[        R                  " U5      nUR                  S[        U R                  5      5        [        R                  " U5      $ )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   ÚotherÚ
other_lists      r   r€   ÚExprListNameSpace.concatà  s“   € ô8 eœT×"Ñ"Ü˜5 ™8¤b§g¡g¬s´B·I±IÐ%>×?Ñ?à—;‘;œrŸyšy¨%¨Ó1Ó2Ð2ô %/¨u´d×$;Ñ$;e‘WÄÇÂÈ5ÓAQˆ
à×Ñ˜!œY t§|¡|Ó4Ô5Ü}Š}˜ZÓ(Ð(r!   ©Únull_on_oobc               ó`   • [        U5      n[        U R                  R                  X25      5      $ )uv  
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   Úindexr‰   Úindex_pyexprs       r   r$   ÚExprListNameSpace.get  s)   € ôL -¨UÓ3ˆÜ˜Ÿ™×.Ñ.¨|ÓIÓJÐJr!   c               ó`   • [        U5      n[        U R                  R                  X25      5      $ )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   Úindicesr‰   Úindices_pyexprs       r   ÚgatherÚExprListNameSpace.gather0  s)   € ôJ /¨wÓ7ˆÜ˜Ÿ™×1Ñ1°.ÓNÓOÐOr!   c                óv   • [        U5      n[        U5      n[        U R                  R                  X45      5      $ )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   rC   ÚoffsetrF   Úoffset_pyexprs        r   Úgather_everyÚExprListNameSpace.gather_everyX  s3   € ôP )¨Ó+ˆÜ-¨fÓ5ˆÜ˜Ÿ™×7Ñ7¸ÓPÓQÐQr!   c                ó"   • U R                  SSS9$ )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   Trˆ   r#   r*   s    r   ÚfirstÚExprListNameSpace.first„  s   € ð& x‰x˜ tˆxÐ,Ð,r!   c                ó"   • U R                  SSS9$ )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    â”‚
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”˜
éÿÿÿÿTrˆ   r#   r*   s    r   ÚlastÚExprListNameSpace.last™  s   € ð& x‰x˜¨ˆxÐ-Ð-r!   T)Únulls_equalc               ó^   • [        USS9n[        U R                  R                  X25      5      $ )uM  
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¢   Úitem_pyexprs       r   ÚcontainsÚExprListNameSpace.contains®  s*   € ô> ,¨D¸TÑBˆÜ˜Ÿ™×3Ñ3°KÓMÓNÐNr!   )Úignore_nullsc               ó^   • [        USS9n[        U R                  R                  X25      5      $ )uì  
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   Ú	separatorrª   Úseparator_pyexprs       r   ÚjoinÚExprListNameSpace.joinÐ  s-   € ôb 1°ÀtÑLÐÜ˜Ÿ™×/Ñ/Ð0@ÓOÓPÐPr!   c                óH   • [        U R                  R                  5       5      $ )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_minÚExprListNameSpace.arg_min  ó   € ô8 ˜Ÿ™×2Ñ2Ó4Ó5Ð5r!   c                óH   • [        U R                  R                  5       5      $ )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_maxÚExprListNameSpace.arg_max"  rµ   r!   c                óJ   • [        U R                  R                  X5      5      $ )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   rC   Únull_behaviors      r   ÚdiffÚExprListNameSpace.diff@  s   € ô^ ˜Ÿ™×/Ñ/°ÓAÓBÐBr!   c                ó`   • [        U5      n[        U R                  R                  U5      5      $ )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   rC   rF   s      r   ÚshiftÚExprListNameSpace.shiftq  s)   € ôX )¨Ó+ˆÜ˜Ÿ™×0Ñ0°Ó:Ó;Ð;r!   c                óv   • [        U5      n[        U5      n[        U R                  R                  X45      5      $ )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—   Úlengthr˜   Úlength_pyexprs        r   ÚsliceÚExprListNameSpace.slice   s2   € ô8 .¨fÓ5ˆÜ-¨fÓ5ˆÜ˜Ÿ™×0Ñ0°ÓNÓOÐOr!   c                ó&   • U R                  SU5      $ )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   rC   s     r   ÚheadÚExprListNameSpace.headÀ  s   € ð. z‰z˜!˜QÓÐr!   c                ó`   • [        U5      n[        U R                  R                  U5      5      $ )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   ÚtailÚExprListNameSpace.tailÙ  s(   € ô. )¨Ó+ˆÜ˜Ÿ™×/Ñ/°Ó9Ó:Ð:r!   c                óH   • [        U R                  R                  5       5      $ )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Ò   ÚExprListNameSpace.explodeó  s   € ô> ˜Ÿ™×-Ñ-Ó/Ó0Ð0r!   c                ó^   • [        USS9n[        U R                  R                  U5      5      $ )u•  
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   ÚelementÚelement_pyexprs      r   Úcount_matchesÚExprListNameSpace.count_matches  s*   € ô4 /¨wÀ4ÑHˆÜ˜Ÿ™×8Ñ8¸ÓHÓIÐIr!   c                óJ   • [        U R                  R                  U5      5      $ )u7  
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   Úwidths     r   Úto_arrayÚExprListNameSpace.to_array1  s   € ô> ˜Ÿ™×3Ñ3°EÓ:Ó;Ð;r!   c                óh  • Ub  [        S[        5        [        U[        5      (       d]  Uc  Sn[        R
                  " U5      eUc  [        U5       Vs/ s H  nSU 3PM
     nnO [        U5       Vs/ s H
  oR" U5      PM     nn[        U R                  R                  U5      5      $ s  snf s  snf )ui  
Convert the Series of type `List` to a Series of type `Struct`.

Parameters
----------
n_field_strategy : {'first_non_null', 'max_width'}
    Deprecated and ignored.
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 expression needs to be able to evaluate the output datatype at all
    times, so the caller must provide an upper bound of the number of struct
    fields that will be created if `fields` is not a sequence of field names.

.. versionchanged: 1.33.0
    The `n_field_strategy` parameter is ignored and deprecated. The `fields`
    needs to be a sequence of field names or the upper bound is regarded as
    ground truth.

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(upper_bound=2)
... )  # 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
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

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}", upper_bound=2)
... ).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[`Expr.list.to_struct` with `n_field_strategy` is deprecated and has no effect on execution.z˜`Expr.list.to_struct` requires either `fields` to be a sequence or `upper_bound` to be set.

This used to be allowed but produced unpredictable results.Úfield_)
r   ÚDeprecationWarningr}   r   r	   ÚInvalidOperationErrorÚranger   r   Úlist_to_struct)r   Ún_field_strategyÚfieldsÚupper_boundrD   Úis         r   Ú	to_structÚExprListNameSpace.to_structR  s±   € ðz Ñ'ÜØmÜ"ôô
 ˜&¤(×+Ñ+ØÑ"ð sÜ ×6Ò6°sÓ;Ð;à‰~Ü05°kÔ0BÓCÒ0B¨1˜F 1 #›,Ñ0BÐCä-2°;Ô-?Ó@Ò-?¨˜& ž)Ñ-?Ð@ä˜Ÿ™×4Ñ4°VÓ<Ó=Ð=ùò	 Dùâ@s   ÁB*Á3B/)Úparallelc               ó`   • [        U R                  R                  UR                  U5      5      $ )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   ÚevalÚExprListNameSpace.eval¡  s%   € ôB ˜Ÿ™×/Ñ/°·±¸hÓGÓHÐHr!   c                ó^   • [        U R                  R                  UR                  5      5      $ )uY  
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   Ú	predicates     r   ÚfilterÚExprListNameSpace.filterÄ  s$   € ô8 ˜Ÿ™×1Ñ1°)×2CÑ2CÓDÓEÐEr!   c                óv  • [        U[        5      (       au  [        U[        5      (       d`  [        U[        [        R
                  [        R                  45      (       d  [        U5      n[        R                  " U5      R                  nO[        U5      n[        U R                  R                  US5      5      $ )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©r}   r   r   r   r~   r   Ú	DataFramer   rƒ   Úlitr   r   r   Úlist_set_operation©r   r…   Úother_pyexprs      r   Ú	set_unionÚExprListNameSpace.set_unionâ  s|   € ô@ eœZ×(Ñ(´¸EÄ3×1GÑ1GÜ˜e¤h´·	±	¼2¿<¹<Ð%H×IÑIÜ˜U›ÜŸ5š5 ›<×/Ñ/‰Lä0°Ó7ˆLÜ˜Ÿ™×8Ñ8¸ÀwÓOÓPÐPr!   c                óv  • [        U[        5      (       au  [        U[        5      (       d`  [        U[        [        R
                  [        R                  45      (       d  [        U5      n[        R                  " U5      R                  nO[        U5      n[        U R                  R                  US5      5      $ )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_differenceÚ ExprListNameSpace.set_difference
  s|   € ôD eœZ×(Ñ(´¸EÄ3×1GÑ1GÜ˜e¤h´·	±	¼2¿<¹<Ð%H×IÑIÜ˜U›ÜŸ5š5 ›<×/Ñ/‰Lä0°Ó7ˆLÜ˜Ÿ™×8Ñ8¸À|ÓTÓUÐUr!   c                óv  • [        U[        5      (       au  [        U[        5      (       d`  [        U[        [        R
                  [        R                  45      (       d  [        U5      n[        R                  " U5      R                  nO[        U5      n[        U R                  R                  US5      5      $ )u¢  
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_intersectionÚ"ExprListNameSpace.set_intersection4  s{   € ô< eœZ×(Ñ(´¸EÄ3×1GÑ1GÜ˜e¤h´·	±	¼2¿<¹<Ð%H×IÑIÜ˜U›ÜŸ5š5 ›<×/Ñ/‰Lä0°Ó7ˆLÜ˜Ÿ™×8Ñ8¸À~ÓVÓWÐWr!   c                óv  • [        U[        5      (       au  [        U[        5      (       d`  [        U[        [        R
                  [        R                  45      (       d  [        U5      n[        R                  " U5      R                  nO[        U5      n[        U R                  R                  US5      5      $ )u{  
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_differenceÚ*ExprListNameSpace.set_symmetric_differenceZ  s   € ô< eœZ×(Ñ(´¸EÄ3×1GÑ1GÜ˜e¤h´·	±	¼2¿<¹<Ð%H×IÑIÜ˜U›ÜŸ5š5 ›<×/Ñ/‰Lä0°Ó7ˆLÜØL‰L×+Ñ+¨LÐ:PÓQó
ð 	
r!   r   )r   r   ÚreturnÚNone)r%   Úintr  r   )r  r   r   )rC   zint | IntoExprColumn | Noner:   zfloat | IntoExprColumn | Noner;   Úboolr<   r  r=   ú
int | Noner  r   )r?   )ra   r  r  r   )ri   r  rj   r  r  r   )rs   r  r  r   )r…   z2list[Expr | str] | Expr | str | Series | list[Any]r  r   )rŒ   zint | Expr | strr‰   r  r  r   )r‘   z+Expr | Series | list[int] | list[list[int]]r‰   r  r  r   )r   )rC   úint | IntoExprColumnr—   r  r  r   )r%   r   r¢   r  r  r   )r­   r   rª   r  r  r   )r?   Úignore)rC   r  r¼   r   r  r   )rC   r  r  r   )r—   úint | str | ExprrÆ   zint | str | Expr | Noner  r   )é   )rC   r  r  r   )rÖ   r   r  r   )rÜ   r  r  r   )NNN)rå   z ListToStructWidthStrategy | Noneræ   z+Sequence[str] | Callable[[int], str] | Nonerç   r  r  r   )r   r   rë   r  r  r   )rò   r   r  r   )r…   zIntoExpr | Collection[Any]r  r   )2Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	_accessorr   r&   r+   r0   r4   r8   rG   rK   rO   rT   rX   r\   rb   rg   rm   rq   rv   rz   r€   r$   r“   r™   rœ   r    r¨   r¯   r³   r¸   r½   rÂ   rÈ   rË   rÏ   rÒ   rØ   rÝ   ré   rî   ró   rý   r  r  r	  Ú__static_attributes__© r!   r   r   r      s7  † Ù1à€Iô$ôô2ô<2ô<2ô69ð2 *.ð:
ð 37Ø!&ØØñ:
à&ð:
ð 0ð	:
ð
 ð:
ð ð:
ð ð:
ð 
ö:
ôx2ô02ô(2ô(3ô(5ö(6ö66ð6 */À5÷ 'IôR6ð0 05÷ Cô87ô0%)ðV "ñ	'Kàð'Kð ð	'Kð
 
õ'KðZ "ñ	&Pà<ð&Pð ð	&Pð
 
õ&PðV ()ð*Ràð*Rð %ð*Rð 
õ	*RôX-ô*.ð* ?C÷  OðD GK÷ 2Qôh6ô<6ö</Cöb-<ð` KOðPØ&ðPØ0GðPà	õPö@ ö2;ô41ôBJô:<ðF >BØ>BØ"&ð	M>à:ðM>ð <ðM>ð  ð	M>ð
 
õM>ð^ 49÷ !IôFFô<&QôP(VôT$X÷L&
r!   r   )Ú
__future__r   r   Úcollections.abcr   r   Útypingr   r   r   Úpolars._reexportÚ	_reexportr~   Úpolarsr	   r
   rƒ   Úpolars._utils.parser   Úpolars._utils.variousr   Úpolars._utils.wrapr   r   r   Úpolars._typingr   r   r   r   r   r  r!   r   Ú<module>r&     sB   ðÝ "ã ß 0ß /Ñ /å Ý Ý !Ý 5Ý /Ý (æß#÷ó ÷h
ò h
r!   