§
    {Øje   ã                  óf   — d dl mZ d dlmZmZ d dlmZ erd dlmZ  G d„ dee         ¦  «        ZdS )é    )Úannotations)ÚTYPE_CHECKINGÚGeneric)ÚSeriesT)ÚNonNestedLiteralc                  ót   — e Zd Zdd„Zdd„Zddœdd„Zdd„Zd d„Zdd„Zdd„Z	dd„Z
dd„Zdd„Zdddœd!d„ZdS )"ÚSeriesListNamespaceÚseriesr   ÚreturnÚNonec                ó   — || _         d S )N)Ú_narwhals_series)Úselfr
   s     ú‰/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/narwhals/series_list.pyÚ__init__zSeriesListNamespace.__init__   s   € Ø &ˆÔÐÐó    c                óx   — | j                              | j         j        j                             ¦   «         ¦  «        S )aM  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   zSeriesListNamespace.len   s7   € ð* Ô$×4Ò4ØÔ!Ô3Ô8×<Ò<Ñ>Ô>ñ
ô 
ð 	
r   F©Úmaintain_orderr   Úboolc               ó|   — | j                              | j         j        j                             |¬¦  «        ¦  «        S )aj  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   zSeriesListNamespace.unique(   sD   € ð8 Ô$×4Ò4ØÔ!Ô3Ô8×?Ò?Ø-ð @ñ ô ñ
ô 
ð 	
r   Úitemr   c                óz   — | j                              | j         j        j                             |¦  «        ¦  «        S )aF  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   r   s     r   r    zSeriesListNamespace.containsJ   s9   € ð( Ô$×4Ò4ØÔ!Ô3Ô8×AÒAÀ$ÑGÔGñ
ô 
ð 	
r   ÚindexÚintc                ó(  — t          |t          ¦  «        s'dt          |¦  «        j        › d�}t	          |¦  «        ‚|dk     rd|› d�}t          |¦  «        ‚| j                             | j        j        j	         
                    |¦  «        ¦  «        S )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.)Ú
isinstancer"   ÚtypeÚ__name__Ú	TypeErrorÚ
ValueErrorr   r   r   r   Úget)r   r!   Úmsgs      r   r)   zSeriesListNamespace.getb   sš   € õ& ˜%¥Ñ%Ô%ð 	!àZ½$¸u¹+¼+Ô:NÐZÐZÐZð õ ˜C‘.”.Ð à�1Š9ˆ9ØZ˜5ÐZÐZÐZˆCÝ˜S‘/”/Ð!àÔ$×4Ò4ØÔ!Ô3Ô8×<Ò<¸UÑCÔCñ
ô 
ð 	
r   c                óx   — | j                              | j         j        j                             ¦   «         ¦  «        S )a×  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   r,   zSeriesListNamespace.minƒ   ó7   € ð  Ô$×4Ò4ØÔ!Ô3Ô8×<Ò<Ñ>Ô>ñ
ô 
ð 	
r   c                óx   — | j                              | j         j        j                             ¦   «         ¦  «        S )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   r/   zSeriesListNamespace.max—   s7   € ð" Ô$×4Ò4ØÔ!Ô3Ô8×<Ò<Ñ>Ô>ñ
ô 
ð 	
r   c                óx   — | j                              | j         j        j                             ¦   «         ¦  «        S )aÝ  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   r1   zSeriesListNamespace.mean¬   s7   € ð  Ô$×4Ò4ØÔ!Ô3Ô8×=Ò=Ñ?Ô?ñ
ô 
ð 	
r   c                óx   — | j                              | j         j        j                             ¦   «         ¦  «        S )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   r3   zSeriesListNamespace.medianÀ   s7   € ð" Ô$×4Ò4ØÔ!Ô3Ô8×?Ò?ÑAÔAñ
ô 
ð 	
r   c                óx   — | j                              | j         j        j                             ¦   «         ¦  «        S )a×  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   r5   zSeriesListNamespace.sumÕ   r-   r   ©Ú
descendingÚ
nulls_lastr7   r8   c               ó~   — | j                              | j         j        j                             ||¬¦  «        ¦  «        S )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]
            ]
        r6   )r   r   r   r   Úsort)r   r7   r8   s      r   r:   zSeriesListNamespace.sorté   sE   € ð( Ô$×4Ò4ØÔ!Ô3Ô8×=Ò=Ø%°*ð >ñ ô ñ
ô 
ð 	
r   N)r
   r   r   r   )r   r   )r   r   r   r   )r   r   r   r   )r!   r"   r   r   )r7   r   r8   r   r   r   )r&   Ú
__module__Ú__qualname__r   r   r   r    r)   r,   r/   r1   r3   r5   r:   © r   r   r	   r	      s  € € € € € ð'ð 'ð 'ð 'ð
ð 
ð 
ð 
ð2 05ð  
ð  
ð  
ð  
ð  
ð  
ðD
ð 
ð 
ð 
ð0
ð 
ð 
ð 
ðB
ð 
ð 
ð 
ð(
ð 
ð 
ð 
ð*
ð 
ð 
ð 
ð(
ð 
ð 
ð 
ð*
ð 
ð 
ð 
ð( */À5ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   r	   N)	Ú
__future__r   Útypingr   r   Únarwhals.typingr   r   r	   r=   r   r   ú<module>rA      sž   ðØ "Ð "Ð "Ð "Ð "Ð "à )Ð )Ð )Ð )Ð )Ð )Ð )Ð )à #Ð #Ð #Ð #Ð #Ð #àð 1Ø0Ð0Ð0Ð0Ð0Ð0ðv
ð v
ð v
ð v
ð v
˜' 'Ô*ñ v
ô v
ð v
ð v
ð v
r   