
    Lpje                     b    S SK Jr  S SKJrJr  S SKJr  \(       a  S SKJr   " S S\\   5      rg)    )annotations)TYPE_CHECKINGGeneric)SeriesT)NonNestedLiteralc                      \ rS rSrSS jrSS jrSS.SS 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 jrSS jrSSS.SS jjrSrg)SeriesListNamespace   c                    Xl         g )N_narwhals_series)selfseriess     P/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/narwhals/series_list.py__init__SeriesListNamespace.__init__   s     &    c                    U R                   R                  U R                   R                  R                  R	                  5       5      $ )a  Return the number of elements in each list.

Null values count towards the total.

Examples:
    >>> import pyarrow as pa
    >>> import narwhals as nw
    >>> s_native = pa.chunked_array([[[1, 2], [3, 4, None], None, []]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.len().to_native()  # doctest: +ELLIPSIS
    <pyarrow.lib.ChunkedArray object at ...>
    [
      [
        2,
        3,
        null,
        0
      ]
    ]
)r   _with_compliant_compliant_serieslistlenr   s    r   r   SeriesListNamespace.len   s;    * $$44!!3388<<>
 	
r   Fmaintain_orderc                   U R                   R                  U R                   R                  R                  R	                  US95      $ )a  Get the unique/distinct values in the list.

Null values are included in the result.

Arguments:
    maintain_order: Keep the same order as the input data.

Notes:
    `maintain_order=True` is not supported by all backends: backends whose
    native distinct operation does not preserve order (e.g. DuckDB, Ibis)
    raise `NotImplementedError`.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[1, 1, 2], [3, 3, None], None, []])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.unique().to_native()  # doctest: +SKIP
    shape: (4,)
    Series: '' [list[i64]]
    [
       [1, 2]
       [null, 3]
       null
       []
    ]
r   )r   r   r   r   unique)r   r   s     r   r   SeriesListNamespace.unique(   sF    8 $$44!!3388??- @ 
 	
r   c                    U R                   R                  U R                   R                  R                  R	                  U5      5      $ )a  Check if sublists contain the given item.

Arguments:
    item: Item that will be checked for membership.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[1, 2], None, []])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.contains(1).to_native()  # doctest: +NORMALIZE_WHITESPACE
    shape: (3,)
    Series: '' [bool]
    [
            true
            null
            false
    ]
)r   r   r   r   contains)r   items     r   r!   SeriesListNamespace.containsJ   s=    ( $$44!!3388AA$G
 	
r   c                2   [        U[        5      (       d$  S[        U5      R                   S3n[	        U5      eUS:  a  SU S3n[        U5      eU R                  R                  U R                  R                  R                  R                  U5      5      $ )a  Return the value by index in each list.

Negative indices are not accepted.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[1, 2], [3, 4, None], [None, 5]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.get(1).to_native()  # doctest: +NORMALIZE_WHITESPACE
    shape: (3,)
    Series: '' [i64]
    [
            2
            4
            5
    ]
z'Index must be of type 'int'. Got type 'z
' instead.r   zIndex z8 is out of bounds: should be greater than or equal to 0.)
isinstanceinttype__name__	TypeError
ValueErrorr   r   r   r   get)r   indexmsgs      r   r+   SeriesListNamespace.getb   s    & %%%9$u+:N:N9OzZ  C. 195'!YZCS/!$$44!!3388<<UC
 	
r   c                    U R                   R                  U R                   R                  R                  R	                  5       5      $ )ao  Compute the min value of the lists in the array.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[1], [3, 4, None]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.min().to_native()  # doctest: +NORMALIZE_WHITESPACE
    shape: (2,)
    Series: '' [i64]
    [
            1
            3
    ]
)r   r   r   r   minr   s    r   r0   SeriesListNamespace.min   ;      $$44!!3388<<>
 	
r   c                    U R                   R                  U R                   R                  R                  R	                  5       5      $ )a~  Compute the max value of the lists in the array.

Examples:
    >>> import pyarrow as pa
    >>> import narwhals as nw
    >>> s_native = pa.chunked_array([[[1], [3, 4, None]]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.max().to_native()  # doctest: +ELLIPSIS
    <pyarrow.lib.ChunkedArray object at ...>
    [
      [
        1,
        4
      ]
    ]
)r   r   r   r   maxr   s    r   r4   SeriesListNamespace.max   s;    " $$44!!3388<<>
 	
r   c                    U R                   R                  U R                   R                  R                  R	                  5       5      $ )au  Compute the mean value of the lists in the array.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[1], [3, 4, None]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.mean().to_native()  # doctest: +NORMALIZE_WHITESPACE
    shape: (2,)
    Series: '' [f64]
    [
            1.0
            3.5
    ]
)r   r   r   r   meanr   s    r   r7   SeriesListNamespace.mean   s;      $$44!!3388==?
 	
r   c                    U R                   R                  U R                   R                  R                  R	                  5       5      $ )a  Compute the median value of the lists in the array.

Examples:
    >>> import pyarrow as pa
    >>> import narwhals as nw
    >>> s_native = pa.chunked_array([[[1], [3, 4, None]]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.median().to_native()  # doctest: +ELLIPSIS
    <pyarrow.lib.ChunkedArray object at ...>
    [
      [
        1,
        3
      ]
    ]
)r   r   r   r   medianr   s    r   r:   SeriesListNamespace.median   s;    " $$44!!3388??A
 	
r   c                    U R                   R                  U R                   R                  R                  R	                  5       5      $ )ao  Compute the sum value of the lists in the array.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[1], [3, 4, None]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.sum().to_native()  # doctest: +NORMALIZE_WHITESPACE
    shape: (2,)
    Series: '' [i64]
    [
            1
            7
    ]
)r   r   r   r   sumr   s    r   r=   SeriesListNamespace.sum   r2   r   
descending
nulls_lastc                   U R                   R                  U R                   R                  R                  R	                  XS95      $ )a  Sort the lists of the series.

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

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> s_native = pl.Series([[2, -1, 1], [3, -4, None]])
    >>> s = nw.from_native(s_native, series_only=True)
    >>> s.list.sort().to_native()  # doctest: +NORMALIZE_WHITESPACE
    shape: (2,)
    Series: '' [list[i64]]
    [
            [-1, 1, 2]
            [null, -4, 3]
    ]
r?   )r   r   r   r   sort)r   r@   rA   s      r   rC   SeriesListNamespace.sort   sE    ( $$44!!3388==% > 
 	
r   r   N)r   r   returnNone)rE   r   )r   boolrE   r   )r"   r   rE   r   )r,   r&   rE   r   )r@   rG   rA   rG   rE   r   )r(   
__module____qualname____firstlineno__r   r   r   r!   r+   r0   r4   r7   r:   r=   rC   __static_attributes__ r   r   r	   r	      sL    '
2 05  
D
0
B
(
*
(
*
( */5 
 
r   r	   N)	
__future__r   typingr   r   narwhals.typingr   r   r	   rL   r   r   <module>rP      s'    " ) #0v
''* v
r   