o
    Lh                     @  sT   d dl mZ d dlmZmZmZ erd dlmZ edddZG dd dee Z	d	S )
    )annotations)TYPE_CHECKINGGenericTypeVar)ExprExprTr   )boundc                   @  s    e Zd Zd
ddZdddZd	S )ExprCatNamespaceexprr   returnNonec                 C  s
   || _ d S N)_expr)selfr
    r   R/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/narwhals/expr_cat.py__init__   s   
zExprCatNamespace.__init__c                   s    j  fddS )u  Get unique categories from column.

        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                   s    j | j S r   )r   _to_compliant_exprcatget_categories)plxr   r   r   <lambda>&   s    z1ExprCatNamespace.get_categories.<locals>.<lambda>)r   _with_elementwiser   r   r   r   r      s   
zExprCatNamespace.get_categoriesN)r
   r   r   r   )r   r   )__name__
__module____qualname__r   r   r   r   r   r   r	      s    
r	   N)

__future__r   typingr   r   r   narwhals.exprr   r   r	   r   r   r   r   <module>   s    