
    -Ph                    x    d dl mZ d dlmZmZmZ erd dlmZ  edd          Z G d dee                   Z	d	S )
    )annotations)TYPE_CHECKINGGenericTypeVar)ExprExprTr   )boundc                      e Zd ZddZd	dZdS )
ExprCatNamespaceexprr   returnNonec                    || _         d S N)_expr)selfr   s     Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/narwhals/expr_cat.py__init__zExprCatNamespace.__init__   s    


    c                >      j                              fd          S )u  Get unique categories from column.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> df_native = pl.DataFrame(
            ...     {"fruits": ["apple", "mango", "mango"]},
            ...     schema={"fruits": pl.Categorical},
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("fruits").cat.get_categories()).to_native()
            shape: (2, 1)
            ┌────────┐
            │ fruits │
            │ ---    │
            │ str    │
            ╞════════╡
            │ apple  │
            │ mango  │
            └────────┘
        c                f    j                             |           j                                        S r   )r   _to_compliant_exprcatget_categories)plxr   s    r   <lambda>z1ExprCatNamespace.get_categories.<locals>.<lambda>)   s&    
55c::>MMOO r   )r   _with_elementwise_op)r   s   `r   r   zExprCatNamespace.get_categories   s+    2 z..OOOO
 
 	
r   N)r   r   r   r   )r   r   )__name__
__module____qualname__r   r    r   r   r   r      s<           
 
 
 
 
 
r   r   N)

__future__r   typingr   r   r   narwhals.exprr   r   r   r!   r   r   <module>r%      s    " " " " " " 2 2 2 2 2 2 2 2 2 2 #""""""v&&&
 
 
 
 
wu~ 
 
 
 
 
r   