Ë
    	êñijŠ ã                  ó`  — d dl mZ d dlZd dlZd dlZd dlmZmZm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZmZmZmZ d dlmc mZ d dlmZ d d	lmZ d d
lm Z  d dl!m"Z"m#Z# d dl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+ d dl,m-Z-  ej\                  e/«      5  d dl0m1Z1m2Z2 ddd«       d dl3m4Z4 er8d dl5Z5d dlm6Z6 d dlm7Z7m8Z8 d dl9m:Z:m;Z;m<Z< e5jz                  dk\  rd dlm>Z> nd dl?m>Z> g d¢Z@dKd„ZAddœ	 	 	 	 	 	 	 dLd„ZBdMd„ZCddœ	 	 	 	 	 	 	 	 	 	 	 dNd„ZD	 	 	 	 	 	 dOd„ZE G d „ de-«      ZFdd!œdPd"„ZGdQd#„ZHdRdd$œdSd%„ZI	 dRdd$œ	 	 	 	 	 dSd&„ZJdQd'„ZKdQd(„ZL	 	 	 	 dTd)„ZMdd*œ	 	 	 	 	 dUd+„ZNdd*œdVd,„ZOdQd-„ZP e «       dQd.„«       ZQ e «       dWdXd/„«       ZR e «       dWdd0œdYd1„«       ZS e «       dQd2„«       ZT e «       dQd3„«       ZUdQd4„ZVdZd5„ZWdQd6„ZX	 	 d[	 	 	 	 	 d\d7„ZdQd8„Z
dRd]d9„ZY	 dW	 	 	 d^d:„ZZd_d;„Z[	 	 	 	 	 	 d`d<„Z\ddœdad=„Z]dQd>„Z^dQd?„Z_dQd@„Z`dQdA„ZaddœdadB„ZbdbdC„ZcdQdD„ZddQdE„ZedcdF„ZfddGœdddH„ZgdQdI„ZhdQdJ„Ziy# 1 sw Y   �Œ”xY w)eé    )ÚannotationsN)Ú
CollectionÚMappingÚSequence)ÚDecimal)Úreduce)Úor_)ÚTYPE_CHECKINGÚAnyÚNoReturnÚoverload)Ú	functions)Ú_parse_inputs_as_iterable)Úunstable)Ú	is_columnÚ	re_escape)ÚBinaryÚBooleanÚCategoricalÚDateÚStringÚTimeÚis_polars_dtype)ÚExpr)ÚPyExprÚ
PySelector)ÚNoneType)ÚIterable)Ú	DataFrameÚ	LazyFrame)ÚPolarsDataTypeÚPythonDataTypeÚTimeUnit)é   é   )ÚTypeIs)%ÚSelectorÚallÚalphaÚalphanumericÚarrayÚbinaryÚbooleanÚby_dtypeÚby_indexÚby_nameÚcategoricalÚcontainsÚdateÚdatetimeÚdecimalÚdigitÚdurationÚ	ends_withÚenumÚexcludeÚexpand_selectorÚfirstÚfloatÚintegerÚis_selectorÚlastÚlistÚmatchesÚnestedÚnumericÚsigned_integerÚstarts_withÚstringÚstructÚtemporalÚtimeÚunsigned_integerc                ó"   — t        | t        «      S )a  
    Indicate whether the given object/expression is a selector.

    Examples
    --------
    >>> from polars.selectors import is_selector
    >>> import polars.selectors as cs
    >>> is_selector(pl.col("colx"))
    False
    >>> is_selector(cs.first() | cs.last())
    True
    )Ú
isinstancer'   )Úobjs    úR/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/polars/selectors.pyr?   r?   ]   s   € ô �cœ8Ó$Ð$ó    T©Ústrictc               ó  — t        | t        «      rddlm}  || ¬«      } |rt	        |«      s.n|j
                  j                  d¬«      sd|›d�}t        |«      ‚t        | j                  |«      j                  «       «      S )ax  
    Expand selector to column names, with respect to a specific frame or target schema.

    .. versionadded:: 0.20.30
        The `strict` parameter was added.

    Parameters
    ----------
    target
        A Polars DataFrame, LazyFrame or Schema.
    selector
        An arbitrary polars selector (or compound selector).
    strict
        Setting False additionally allows for a broader range of column selection
        expressions (such as bare columns or use of `.exclude()`) to be expanded,
        not just the dedicated selectors.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "colx": ["a", "b", "c"],
    ...         "coly": [123, 456, 789],
    ...         "colz": [2.0, 5.5, 8.0],
    ...     }
    ... )

    Expand selector with respect to an existing `DataFrame`:

    >>> cs.expand_selector(df, cs.numeric())
    ('coly', 'colz')
    >>> cs.expand_selector(df, cs.first() | cs.last())
    ('colx', 'colz')

    This also works with `LazyFrame`:

    >>> cs.expand_selector(df.lazy(), ~(cs.first() | cs.last()))
    ('coly',)

    Expand selector with respect to a standalone `Schema` dict:

    >>> schema = {
    ...     "id": pl.Int64,
    ...     "desc": pl.String,
    ...     "count": pl.UInt32,
    ...     "value": pl.Float64,
    ... }
    >>> cs.expand_selector(schema, cs.string() | cs.float())
    ('desc', 'value')

    Allow for non-strict selection expressions (such as those
    including use of an `.exclude()` constraint) to be expanded:

    >>> cs.expand_selector(schema, cs.numeric().exclude("id"), strict=False)
    ('count', 'value')
    r   )r   )ÚschemaF)Úallow_aliasingzexpected a selector; found ú	 instead.)rM   r   Úpolars.dataframer   r?   ÚmetaÚis_column_selectionÚ	TypeErrorÚtupleÚselectÚcollect_schema)ÚtargetÚselectorrR   r   Úmsgs        rO   r;   r;   o   su   € ô~ �&œ'Ô"Ý.á &Ô)ˆñ ô 	�HÕà�]‰]×.Ñ.¸eÐ.ÔDà+¨H¨<°yÐAˆÜ˜‹nÐä�—‘˜xÓ(×7Ñ7Ó9Ó:Ð:rP   c                ó¢   — t        |«      }g }|D ]<  }t        |«      rt        | |«      }|j                  |«       Œ,|j	                  |«       Œ> |S )as  
    Internal function that expands any selectors to column names in the given input.

    Non-selector values are left as-is.

    Examples
    --------
    >>> from polars.selectors import _expand_selectors
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "colw": ["a", "b"],
    ...         "colx": ["x", "y"],
    ...         "coly": [123, 456],
    ...         "colz": [2.0, 5.5],
    ...     }
    ... )
    >>> _expand_selectors(df, ["colx", cs.numeric()])
    ['colx', 'coly', 'colz']
    >>> _expand_selectors(df, cs.string(), cs.float())
    ['colw', 'colx', 'colz']
    )r   r?   r;   ÚextendÚappend)ÚframeÚitemsÚ
items_iterÚexpandedÚitemÚselector_colss         rO   Ú_expand_selectorsrj   À   sU   € ô. +¨5Ó1€Jà#%€HØò "ˆÜ�tÔÜ+¨E°4Ó8ˆMØ�O‰O˜MÕ*à�O‰O˜DÕ!ð"ð €OrP   F)Ú
tuple_keysc               ó   — i }|xs i j                  «       D ]t  \  }}|r t        |«      rt        | |¬«      ||<   ||   }|rFt        |«      r;t        | |¬«      }|r|||<   ŒJ|j                  t        j                  ||«      «       Œp|||<   Œv |S )zCExpand dict key/value selectors into their underlying column names.)r_   )re   r?   r;   ÚupdateÚdictÚfromkeys)	ÚdfÚdÚexpand_keysÚexpand_valuesrk   rg   ÚkeyÚvalueÚcolss	            rO   Ú_expand_selector_dictsrw   ã   s“   € ð €HØ’w˜B—o‘oÓ'ò "‰
ˆˆUÙœ[¨Ô/Ü+¨B¸Ô?ˆH�S‰MØ˜S‘MˆEÙœ; sÔ+Ü" 2°Ô4ˆDÙØ!&�˜’à—‘¤§¡¨d°EÓ :Õ;à!ˆH�SŠMð"ð €OrP   r'   c                óX  — g g g }}}g }g t        | t        «      rt        | t        «      s| n| g¢|¢­D ]×  }t        |«      r|j	                  |«       Œ t        |«      r|j	                  |«       Œ=t        |t        «      rF|j                  d«      r#|j                  d«      r|j	                  |«       Œ�|j	                  |«       Œ“t        |«      r*|j	                  |j                  j                  «       «       ŒÈd|›d�}t        |«      ‚ g }|r|j	                  t        |ddiŽ«       |r|j	                  t        |Ž «       |rC|j	                  t        t        |«      dkD  rdj!                  d	„ |D «       «      n|d
   «      «       |r|j#                  |«       t%        t&        |«      S )zLCreate a combined selector from cols, names, dtypes, and/or other selectors.ú^ú$z:expected one or more `str`, `DataType` or selector; found rV   Úrequire_allFé   ú|c              3  ó(   K  — | ]
  }d |› d�–— Œ y­w)ú(ú)N© )Ú.0Úrxs     rO   ú	<genexpr>z'_combine_as_selector.<locals>.<genexpr>(  s   è ø€ Ò5 r˜1˜R˜D œÑ5ùs   ‚r   )rM   r   Ústrr?   rc   r   Ú
startswithÚendswithr   rX   Úoutput_namerZ   r0   r.   rB   ÚlenÚjoinrb   r   r	   )	re   Ú
more_itemsÚnamesÚregexesÚdtypesÚ	selectorsrh   r`   Úselecteds	            rO   Ú_combine_as_selectorr‘   ü   sƒ  € ð    R�Fˆ7€EØ)+€Iðô ˜%¤Ô,´ZÀÄsÔ5Kñ à�ð	ð 
ñò !ˆô �tÔØ×Ñ˜TÕ"Ü˜TÔ"Ø�M‰M˜$ÕÜ˜œcÔ"Ø�‰˜sÔ#¨¯©°cÔ(:Ø—‘˜tÕ$à—‘˜TÕ"Ü�tŒ_Ø�L‰L˜Ÿ™×.Ñ.Ó0Õ1àNÈtÈhÐV_Ð`ˆCÜ˜C“.Ð ð+!ð. €HÙØ�‰œ Ð:°EÑ:Ô;ÙØ�‰œ &Ð)Ô*ÙØ�‰Üä�w“< !Ò#ð —‘Ñ5¨WÔ5Ô5à˜Q‘Zóô	
ñ Ø�‰˜	Ô"ä”#�xÓ Ð rP   c                  ó’  — e Zd ZU dZdZded<   ed!d„«       Zd"d„Zd#d„Z	d$d„Z
d%d	„Ze	 	 	 	 d&d
„«       Ze	 	 	 	 	 	 	 	 d'd„«       Zd(d„Zd)d„Zd)d„Zed*d„«       Zed)d„«       Zd+d„Zd)d„Zed*d„«       Zed)d„«       Zd+d„Zd)d„Zed*d„«       Zed)d„«       Zd+d„Zd,d„Zed*d„«       Zed)d„«       Zd+d„Zd)d„Z	 	 	 	 	 	 d-d„Zd.d „Zy)/r'   z&Base column selector expression/proxy.Nr   Ú_pyselectorc                óV   —  | «       }||_         t        j                  |«      |_        |S ©N)r“   r   Únew_selectorÚ_pyexpr)ÚclsÚ
pyselectorÚslfs      rO   Ú_from_pyselectorzSelector._from_pyselector9  s'   € á‹eˆØ$ˆŒÜ×)Ñ)¨*Ó5ˆŒØˆ
rP   c                ó6   — | j                   j                  «       S r•   )r—   Ú__getstate__©Úselfs    rO   r�   zSelector.__getstate__@  s   € Ø�|‰|×(Ñ(Ó*Ð*rP   c                óÔ   — t        j                  d«      j                  | _        | j                  j                  |«       | j                  j                  «       j                  | _        y )Nr   )ÚFÚlitr—   Ú__setstate__rX   Úas_selectorr“   )rŸ   Ústates     rO   r£   zSelector.__setstate__C  sD   € Ü—u‘u˜Q“x×'Ñ'ˆŒØ�‰×!Ñ! %Ô(ØŸ9™9×0Ñ0Ó2×>Ñ>ˆÕrP   c                óR   — t        t        j                  | j                  «      «      S r•   )r…   r   Ú_from_pyexprr—   rž   s    rO   Ú__repr__zSelector.__repr__H  s   € Ü”4×$Ñ$ T§\¡\Ó2Ó3Ð3rP   c                ó6   — | j                   j                  «       S r•   )r“   Úhashrž   s    rO   Ú__hash__zSelector.__hash__K  s   € ð ×Ñ×$Ñ$Ó&Ð&rP   c                ó´  — g }g }|D �]ò  }t        |«      �rX|t        j                  u r|t        «       gz  }Œ1t	        |t        j                  «      r+|j
                  dk(  r|t        |j                  d¬«      gz  }Œv|t        j                  u r|t        «       gz  }Œ—|t        j                  u r|t        «       gz  }Œ¸|t        j                  u r|t        «       gz  }ŒÙ|t        j                  u r|t        «       gz  }Œú|t        j                  u r|t!        «       gz  }�Œ|t        j"                  u r|t%        «       gz  }�Œ>|t        j&                  u r|t)        «       gz  }�Œ`||gz  }�Œht	        |t*        «      �r|t,        u r|t/        «       gz  }�Œ‘|t0        j2                  u r|t3        «       gz  }�Œ³|t4        u r|t7        «       gz  }�ŒË|t8        u r|t        j:                  «       gz  }�Œí|t<        u r|t        j>                  «       gz  }�Œ|t@        u r|tA        «       gz  }�Œ'|tB        u r|t        jD                  «       gz  }�ŒI|tF        jH                  u r|t        jJ                  «       gz  }�Œu|tF        j                  u r|t        «       gz  }�Œ—|tF        jL                  u r|t        «       gz  }�Œ¹|tF        jN                  u r|tO        «       gz  }�ŒÛ|tP        u r|t)        «       gz  }�Œó|t0        j                  u s|tR        u r|t        «       gz  }�Œt+        tT        «      t*        u rtT        ndt+        tT        «      jV                  ›�}t+        tT        «      t*        u rdn	dtT        ›d�}d|› d|› �}tY        |«      d ‚t+        tT        «      t*        u rtT        ndt+        tT        «      jV                  ›�}t+        tT        «      t*        u rdn	dtT        ›d�}d|› d|› �}tY        |«      d ‚ | j[                  t]        j^                  |«      «      }ta        |«      d	k(  r|S |d	   }	|d
d  D ]  }
|	|
z  }	Œ	 ta        |«      d	k(  r|	S ||	z  S )NÚ*)Ú	time_unitÚ	time_zonezof type Ú z	 (given: r€   zcannot parse input z into Polars selectorr   r|   )1r   ÚpldtÚDatetimer4   rM   r¯   r®   ÚDurationr7   r   r1   ÚEnumr9   ÚListrA   ÚArrayr+   ÚStructrH   r   r5   ÚtypeÚintr>   Úbuiltinsr=   Úboolr-   r…   r   Úbytesr   Úobjectr   ÚNullÚ
pydatetimerJ   r   Ú	timedeltar3   Ú	PyDecimalr[   ÚinputÚ__name__rZ   r›   r   r.   r‰   )r˜   rŽ   r�   Úconcrete_dtypesÚdtÚ
input_typeÚinput_detailr`   Údtype_selectorr_   Úss              rO   Ú	_by_dtypezSelector._by_dtypeP  sÒ  € ð ˆ	ØˆØó B	/ˆBÜ˜rÕ"ØœŸ™Ñ&Ø¤(£* Ñ-‘IÜ ¤D§M¡MÔ2°r·|±|ÀsÒ7JØ¤(°R·\±\ÈSÔ"QÐ!RÑR‘IØœ4Ÿ=™=Ñ(Ø¤(£* Ñ-‘IØœ4×+Ñ+Ñ+Ø¤+£- Ñ0‘IØœ4Ÿ9™9‘_Ø¤$£& Ñ)‘IØœ4Ÿ9™9‘_Ø¤$£& Ñ)‘IØœ4Ÿ:™:Ñ%Ø¤%£' Ñ*’IØœ4Ÿ;™;Ñ&Ø¤&£( Ñ+’IØœ4Ÿ<™<Ñ'Ø¤'£) Ñ,’Ià#¨ tÑ+’OÜ˜B¤Õ%Øœ‘9Ø¤'£) Ñ,’IØœ8Ÿ>™>Ñ)Ø¤%£' Ñ*’IØœ4‘ZØ¤'£) Ñ,’IØœ3‘YØ#¬¯©« Ñ6’OØœ5‘[Ø#¬¯©« Ñ6’OØœ6‘\Ø¤&£( Ñ+’IØœ8‘^Ø#¬¯	©	« }Ñ4’OØœ:Ÿ?™?Ñ*Ø#¬¯	©	« }Ñ4’OØœ:×.Ñ.Ñ.Ø¤(£* Ñ-’IØœ:×/Ñ/Ñ/Ø¤(£* Ñ-’IØœ:Ÿ?™?Ñ*Ø¤$£& Ñ)’IØœ9‘_Ø¤'£) Ñ,’IØœ8Ÿ=™=Ñ(¨B´%©KØ¤$£& Ñ)’Iô  ¤›;¬$Ñ.õ à'¬¬U«×(<Ñ(<Ð'?Ð@ð ô
 *.¬e«¼Ñ)<¡2ÀIÌeÈYÐVWÐBX�LØ/°
¨|Ð;PÐQ]ÐP^Ð_�CÜ# C›.¨dÐ2ô œE“{¤dÑ*õ à#¤D¬£K×$8Ñ$8Ð#;Ð<ð ô
 &*¬%£[´DÑ%8™rÀ	Ì%ÈÐRSÐ>T�Ø+¨J¨<Ð7LÈ\ÈNÐ[�Ü “n¨$Ð.ðEB	/ðH ×-Ñ-¬j×.AÑ.AÀ/Ó.RÓSˆäˆy‹>˜QÒØ!Ð!à˜Q‘<ˆØ˜1˜2�ò 	$ˆAØ !‘|‰Hð	$äˆÓ 1Ò$ØˆOà! HÑ,Ð,rP   c               óN   — | j                  t        j                  |||«      «      S r•   )r›   r   r0   )r˜   rŒ   rR   Úexpand_patternss       rO   Ú_by_namezSelector._by_name§  s$   € ð ×#Ñ#¤J×$6Ñ$6°u¸fÀoÓ$VÓWÐWrP   c                ó   — t        «       | z
  S )zInvert the selector.)r(   )r˜   s    rO   Ú
__invert__zSelector.__invert__­  s   € ä‹u�s‰{ÐrP   c                ó°   — t        |«      r-| j                  «       j                  |j                  «       «      S | j                  «       j                  |«      S r•   )r?   Úas_exprÚ__add__©rŸ   Úothers     rO   rÒ   zSelector.__add__±  s>   € Ü�uÔØ—<‘<“>×)Ñ)¨%¯-©-«/Ó:Ð:à—<‘<“>×)Ñ)¨%Ó0Ð0rP   c                óp   — t        |«      rd}t        |«      ‚| j                  «       j                  |«      S )Nz=unsupported operand type(s) for op: ('Selector' + 'Selector'))r?   rZ   rÑ   Ú__radd__©rŸ   rÔ   r`   s      rO   rÖ   zSelector.__radd__·  s0   € Ü�uÔØQˆCÜ˜C“.Ð à—<‘<“>×*Ñ*¨5Ó1Ð1rP   c                 ó   — y r•   r�   rÓ   s     rO   Ú__and__zSelector.__and__¾  ó   € Ø47rP   c                 ó   — y r•   r�   rÓ   s     rO   rÙ   zSelector.__and__Á  ó   € Ø+.rP   c                ó0  — t        |«      r%|j                  j                  «       }t        |«      }t	        |«      r=t
        j                  t        j                  | j                  |j                  «      «      S | j                  «       j                  |«      S r•   )r   rX   rˆ   r0   r?   r'   r›   r   Ú	intersectr“   rÑ   rÙ   )rŸ   rÔ   Úcolnames      rO   rÙ   zSelector.__and__Ä  sv   € Ü�UÔØ—j‘j×,Ñ,Ó.ˆGÜ˜GÓ$ˆEÜ�uÔÜ×,Ñ,Ü×$Ñ$ T×%5Ñ%5°u×7HÑ7HÓIóð ð —<‘<“>×)Ñ)¨%Ó0Ð0rP   c                ó@   — | j                  «       j                  |«      S r•   )rÑ   Ú__rand__rÓ   s     rO   rá   zSelector.__rand__Ï  s   € Ø�|‰|‹~×&Ñ& uÓ-Ð-rP   c                 ó   — y r•   r�   rÓ   s     rO   Ú__or__zSelector.__or__Ò  s   € Ø36rP   c                 ó   — y r•   r�   rÓ   s     rO   rã   zSelector.__or__Õ  s   € Ø*-rP   c                ó,  — t        |«      r#t        |j                  j                  «       «      }t	        |«      r=t
        j                  t        j                  | j                  |j                  «      «      S | j                  «       j                  |«      S r•   )r   r0   rX   rˆ   r?   r'   r›   r   Úunionr“   rÑ   rã   rÓ   s     rO   rã   zSelector.__or__Ø  sq   € Ü�UÔÜ˜EŸJ™J×2Ñ2Ó4Ó5ˆEÜ�uÔÜ×,Ñ,Ü× Ñ  ×!1Ñ!1°5×3DÑ3DÓEóð ð —<‘<“>×(Ñ(¨Ó/Ð/rP   c                óœ   — t        |«      r#t        |j                  j                  «       «      }| j	                  «       j                  |«      S r•   )r   r0   rX   rˆ   rÑ   Ú__ror__rÓ   s     rO   rè   zSelector.__ror__â  s8   € Ü�UÔÜ˜EŸJ™J×2Ñ2Ó4Ó5ˆEØ�|‰|‹~×%Ñ% eÓ,Ð,rP   c                 ó   — y r•   r�   rÓ   s     rO   Ú__sub__zSelector.__sub__ç  rÚ   rP   c                 ó   — y r•   r�   rÓ   s     rO   rê   zSelector.__sub__ê  rÜ   rP   c                óÐ   — t        |«      r=t        j                  t        j                  | j
                  |j
                  «      «      S | j                  «       j                  |«      S r•   )r?   r'   r›   r   Ú
differencer“   rÑ   rê   rÓ   s     rO   rê   zSelector.__sub__í  sR   € Ü�uÔÜ×,Ñ,Ü×%Ñ% d×&6Ñ&6¸×8IÑ8IÓJóð ð —<‘<“>×)Ñ)¨%Ó0Ð0rP   c                ó   — d}t        |«      ‚)Nz9unsupported operand type(s) for op: ('Expr' - 'Selector'))rZ   r×   s      rO   Ú__rsub__zSelector.__rsub__õ  s   € ØIˆÜ˜‹nÐrP   c                 ó   — y r•   r�   rÓ   s     rO   Ú__xor__zSelector.__xor__ù  rÚ   rP   c                 ó   — y r•   r�   rÓ   s     rO   rñ   zSelector.__xor__ü  rÜ   rP   c                ó,  — t        |«      r#t        |j                  j                  «       «      }t	        |«      r=t
        j                  t        j                  | j                  |j                  «      «      S | j                  «       j                  |«      S r•   )r   r0   rX   rˆ   r?   r'   r›   r   Úexclusive_orr“   rÑ   rñ   rÓ   s     rO   rñ   zSelector.__xor__ÿ  sq   € Ü�UÔÜ˜EŸJ™J×2Ñ2Ó4Ó5ˆEÜ�uÔÜ×,Ñ,Ü×'Ñ'¨×(8Ñ(8¸%×:KÑ:KÓLóð ð —<‘<“>×)Ñ)¨%Ó0Ð0rP   c                óœ   — t        |«      r#t        |j                  j                  «       «      }| j	                  «       j                  |«      S r•   )r   r0   rX   rˆ   rÑ   Ú__rxor__rÓ   s     rO   rö   zSelector.__rxor__	  s8   € Ü�UÔÜ˜EŸJ™J×2Ñ2Ó4Ó5ˆEØ�|‰|‹~×&Ñ& uÓ-Ð-rP   c                ó|  — g }g }g t        |t        «      rt        |t        «      s|n|g¢|¢­D ]Q  }t        |t        «      r|j                  |«       Œ%t	        |«      r|j                  |«       ŒBd|›d�}t        |«      ‚ |r|rd}t        |«      ‚|rt        |«      nt        j                  |dd¬«      }| |z
  S )aV  
        Exclude columns from a multi-column expression.

        Only works after a wildcard or regex column selection, and you cannot provide
        both string column names *and* dtypes (you may prefer to use selectors instead).

        Parameters
        ----------
        columns
            The name or datatype of the column(s) to exclude. Accepts regular expression
            input. Regular expressions should start with `^` and end with `$`.
        *more_columns
            Additional names or datatypes of columns to exclude, specified as positional
            arguments.
        zMinvalid input for `exclude`

Expected one or more `str` or `DataType`; found rV   z,cannot exclude by both column name and dtypeFT©rR   rÌ   )	rM   r   r…   rc   r   rZ   r.   r'   rÍ   )rŸ   ÚcolumnsÚmore_columnsÚexclude_colsÚexclude_dtypesrh   r`   Úexcludeds           rO   r:   zSelector.exclude  sô   € ð( ,.ˆØ8:ˆð
ô ˜g¤zÔ2¼:ÀgÌsÔ;Sñ à�Yð	
ð ñ
ò 	%ˆDô ˜$¤Ô$Ø×#Ñ# DÕ)Ü  Ô&Ø×%Ñ% dÕ+ðKØKOÈ(ÐR[ð]ð ô   “nÐ$ð#	%ñ& ™NØ@ˆCÜ˜C“.Ð ñ ô �^Ô$ä×"Ñ"ØØØ $ð #ó ð 	ð �h‰ÐrP   c                ó@   — t        j                  | j                  «      S )u‹  
        Materialize the `selector` as a normal expression.

        This ensures that the operators `|`, `&`, `~` and `-`
        are applied on the data and not on the selector sets.

        Examples
        --------
        >>> import polars.selectors as cs
        >>> df = pl.DataFrame(
        ...     {
        ...         "colx": ["aa", "bb", "cc"],
        ...         "coly": [True, False, True],
        ...         "colz": [1, 2, 3],
        ...     }
        ... )

        Inverting the boolean selector will choose the non-boolean columns:

        >>> df.select(~cs.boolean())
        shape: (3, 2)
        ┌──────┬──────┐
        │ colx ┆ colz │
        │ ---  ┆ ---  │
        │ str  ┆ i64  │
        ╞══════╪══════╡
        │ aa   ┆ 1    │
        │ bb   ┆ 2    │
        │ cc   ┆ 3    │
        └──────┴──────┘

        To invert the *values* in the selected boolean columns, we need to
        materialize the selector as a standard expression instead:

        >>> df.select(~cs.boolean().as_expr())
        shape: (3, 1)
        ┌───────┐
        │ coly  │
        │ ---   │
        │ bool  │
        ╞═══════╡
        │ false │
        │ true  │
        │ false │
        └───────┘
        )r   r§   r—   rž   s    rO   rÑ   zSelector.as_exprF  s   € ô^ × Ñ  §¡Ó.Ð.rP   )r™   r   Úreturnr'   )rÿ   r¼   )r¥   r¼   rÿ   ÚNone)rÿ   r…   )rÿ   r¹   )rŽ   z.builtins.list[PythonDataType | PolarsDataType]rÿ   r'   )rŒ   zbuiltins.list[str]rR   r»   rÌ   r»   rÿ   r'   ©rÿ   r'   )rÔ   r   rÿ   r   )rÔ   r'   rÿ   r'   )rÔ   r   rÿ   úSelector | Expr)rÔ   r   rÿ   r   )rù   z7str | PolarsDataType | Collection[str | PolarsDataType]rú   zstr | PolarsDataTyperÿ   r'   )rÿ   r   )rÃ   Ú
__module__Ú__qualname__Ú__doc__r“   Ú__annotations__Úclassmethodr›   r�   r£   r¨   r«   rÊ   rÍ   rÏ   rÒ   rÖ   r   rÙ   rá   rã   rè   rê   rï   rñ   rö   r:   rÑ   r�   rP   rO   r'   r'   3  sp  … Ù0ð #€K�Ó"àòó ðó+ó?ó
4ó'ð
 ðT-ØCðT-à	òT-ó ðT-ðl ðXØ&ðXØ37ðXØJNðXà	òXó ðXó
ó1ó2ð Ú7ó Ø7àÚ.ó Ø.ó	1ó.ð Ú6ó Ø6àÚ-ó Ø-ó0ó-ð
 Ú7ó Ø7àÚ.ó Ø.ó1óð Ú7ó Ø7àÚ.ó Ø.ó1ó.ð
6àHð6ð ,ð6ð 
ó	6ôp//rP   )Úescapec               ó  ‡— t        | t        «      r‰rt        | «      n| }nfg }| D ]E  }t        |t        «      r"t        |t        «      s|j	                  |«       Œ5|j                  |«       ŒG dj                  ˆfd„|D «       «      }d|› d�S )zIReturn escaped regex, potentially representing multiple string fragments.r}   c              3  ó<   •K  — | ]  }‰rt        |«      n|–— Œ y ­wr•   )r   )r‚   Úxr  s     €rO   r„   z_re_string.<locals>.<genexpr>ƒ  s   øè ø€ ÒG¸!¡v”y ”|°1Ó4ÑGùs   ƒr   r€   )rM   r…   r   r   rb   rc   rŠ   )rG   r  rƒ   ÚstringsÚsts    `   rO   Ú
_re_stringr  x  s~   ø€ ä�&œ#ÔÙ"(ŒY�vÔ¨f‰à&(ˆØò 	#ˆBÜ˜"œjÔ)´*¸RÄÔ2EØ—‘˜rÕ"à—‘˜rÕ"ð		#ð
 �X‰XÓG¸wÔGÓGˆØˆrˆd�!ˆ9ÐrP   c                 óP   — t         j                  t        j                  «       «      S )uz  
    Select all columns.

    See Also
    --------
    first : Select the first column in the current scope.
    last : Select the last column in the current scope.

    Examples
    --------
    >>> from datetime import date
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "dt": [date(1999, 12, 31), date(2024, 1, 1)],
    ...         "value": [1_234_500, 5_000_555],
    ...     },
    ...     schema_overrides={"value": pl.Int32},
    ... )

    Select all columns, casting them to string:

    >>> df.select(cs.all().cast(pl.String))
    shape: (2, 2)
    ┌────────────┬─────────┐
    │ dt         ┆ value   │
    │ ---        ┆ ---     │
    │ str        ┆ str     │
    ╞════════════╪═════════╡
    │ 1999-12-31 ┆ 1234500 │
    │ 2024-01-01 ┆ 5000555 │
    └────────────┴─────────┘

    Select all columns *except* for those matching the given dtypes:

    >>> df.select(cs.all() - cs.numeric())
    shape: (2, 1)
    ┌────────────┐
    │ dt         │
    │ ---        │
    │ date       │
    ╞════════════╡
    │ 1999-12-31 │
    │ 2024-01-01 │
    └────────────┘
    )r'   r›   r   r(   r�   rP   rO   r(   r(   ‡  s   € ô^ ×$Ñ$¤Z§^¡^Ó%5Ó6Ð6rP   )Úignore_spacesc               óv   — | rdnd}|rdnd}t         j                  t        j                  d|› |› d�«      «      S )uW  
    Select all columns with alphabetic names (eg: only letters).

    Parameters
    ----------
    ascii_only
        Indicate whether to consider only ASCII alphabetic characters, or the full
        Unicode range of valid letters (accented, idiographic, etc).
    ignore_spaces
        Indicate whether to ignore the presence of spaces in column names; if so,
        only the other (non-space) characters are considered.

    Notes
    -----
    Matching column names cannot contain *any* non-alphabetic characters. Note
    that the definition of "alphabetic" consists of all valid Unicode alphabetic
    characters (`\p{Alphabetic}`) by default; this can be changed by setting
    `ascii_only=True`.

    Examples
    --------
    >>> import polars as pl
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "no1": [100, 200, 300],
    ...         "café": ["espresso", "latte", "mocha"],
    ...         "t or f": [True, False, None],
    ...         "hmm": ["aaa", "bbb", "ccc"],
    ...         "都市": ["東京", "大阪", "京都"],
    ...     }
    ... )

    Select columns with alphabetic names; note that accented
    characters and kanji are recognised as alphabetic here:

    >>> df.select(cs.alpha())
    shape: (3, 3)
    ┌──────────┬─────┬──────┐
    │ café     ┆ hmm ┆ 都市 │
    │ ---      ┆ --- ┆ ---  │
    │ str      ┆ str ┆ str  │
    ╞══════════╪═════╪══════╡
    │ espresso ┆ aaa ┆ 東京 │
    │ latte    ┆ bbb ┆ 大阪 │
    │ mocha    ┆ ccc ┆ 京都 │
    └──────────┴─────┴──────┘

    Constrain the definition of "alphabetic" to ASCII characters only:

    >>> df.select(cs.alpha(ascii_only=True))
    shape: (3, 1)
    ┌─────┐
    │ hmm │
    │ --- │
    │ str │
    ╞═════╡
    │ aaa │
    │ bbb │
    │ ccc │
    └─────┘

    >>> df.select(cs.alpha(ascii_only=True, ignore_spaces=True))
    shape: (3, 2)
    ┌────────┬─────┐
    │ t or f ┆ hmm │
    │ ---    ┆ --- │
    │ bool   ┆ str │
    ╞════════╪═════╡
    │ true   ┆ aaa │
    │ false  ┆ bbb │
    │ null   ┆ ccc │
    └────────┴─────┘

    Select all columns *except* for those with alphabetic names:

    >>> df.select(~cs.alpha())
    shape: (3, 2)
    ┌─────┬────────┐
    │ no1 ┆ t or f │
    │ --- ┆ ---    │
    │ i64 ┆ bool   │
    ╞═════╪════════╡
    │ 100 ┆ true   │
    │ 200 ┆ false  │
    │ 300 ┆ null   │
    └─────┴────────┘

    >>> df.select(~cs.alpha(ignore_spaces=True))
    shape: (3, 1)
    ┌─────┐
    │ no1 │
    │ --- │
    │ i64 │
    ╞═════╡
    │ 100 │
    │ 200 │
    │ 300 │
    └─────┘
    úa-zA-Zú\p{Alphabetic}ú r°   ú^[ú]+$©r'   r›   r   rB   )Ú
ascii_onlyr  Úre_alphaÚre_spaces       rO   r)   r)   ¹  sB   € ñL '‰yÐ,=€HÙ#‰s¨€HÜ×$Ñ$¤Z×%7Ñ%7¸"¸X¸JÀxÀjÐPSÐ8TÓ%UÓVÐVrP   c          	     ó†   — | rdnd}| rdnd}|rdnd}t         j                  t        j                  d|› |› |› d�«      «      S )	uF  
    Select all columns with alphanumeric names (eg: only letters and the digits 0-9).

    Parameters
    ----------
    ascii_only
        Indicate whether to consider only ASCII alphabetic characters, or the full
        Unicode range of valid letters (accented, idiographic, etc).
    ignore_spaces
        Indicate whether to ignore the presence of spaces in column names; if so,
        only the other (non-space) characters are considered.

    Notes
    -----
    Matching column names cannot contain *any* non-alphabetic or integer characters.
    Note that the definition of "alphabetic" consists of all valid Unicode alphabetic
    characters (`\p{Alphabetic}`) and digit characters (`\d`) by default; this
    can be changed by setting `ascii_only=True`.

    Examples
    --------
    >>> import polars as pl
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "1st_col": [100, 200, 300],
    ...         "flagged": [True, False, True],
    ...         "00prefix": ["01:aa", "02:bb", "03:cc"],
    ...         "last col": ["x", "y", "z"],
    ...     }
    ... )

    Select columns with alphanumeric names:

    >>> df.select(cs.alphanumeric())
    shape: (3, 2)
    ┌─────────┬──────────┐
    │ flagged ┆ 00prefix │
    │ ---     ┆ ---      │
    │ bool    ┆ str      │
    ╞═════════╪══════════╡
    │ true    ┆ 01:aa    │
    │ false   ┆ 02:bb    │
    │ true    ┆ 03:cc    │
    └─────────┴──────────┘

    >>> df.select(cs.alphanumeric(ignore_spaces=True))
    shape: (3, 3)
    ┌─────────┬──────────┬──────────┐
    │ flagged ┆ 00prefix ┆ last col │
    │ ---     ┆ ---      ┆ ---      │
    │ bool    ┆ str      ┆ str      │
    ╞═════════╪══════════╪══════════╡
    │ true    ┆ 01:aa    ┆ x        │
    │ false   ┆ 02:bb    ┆ y        │
    │ true    ┆ 03:cc    ┆ z        │
    └─────────┴──────────┴──────────┘

    Select all columns *except* for those with alphanumeric names:

    >>> df.select(~cs.alphanumeric())
    shape: (3, 2)
    ┌─────────┬──────────┐
    │ 1st_col ┆ last col │
    │ ---     ┆ ---      │
    │ i64     ┆ str      │
    ╞═════════╪══════════╡
    │ 100     ┆ x        │
    │ 200     ┆ y        │
    │ 300     ┆ z        │
    └─────────┴──────────┘

    >>> df.select(~cs.alphanumeric(ignore_spaces=True))
    shape: (3, 1)
    ┌─────────┐
    │ 1st_col │
    │ ---     │
    │ i64     │
    ╞═════════╡
    │ 100     │
    │ 200     │
    │ 300     │
    └─────────┘
    r  r  z0-9ú\dr  r°   r  r  r  )r  r  r  Úre_digitr  s        rO   r*   r*   $  sS   € ñt '‰yÐ,=€HÙ"‰u¨€HÙ#‰s¨€HÜ×$Ñ$Ü×Ñ˜R ˜z¨(¨°H°:¸SÐAÓBóð rP   c                 ó"   — t        t        g«      S )u¶  
    Select all binary columns.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    string : Select all string columns (optionally including categoricals).

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame({"a": [b"hello"], "b": ["world"], "c": [b"!"], "d": [":)"]})
    >>> df
    shape: (1, 4)
    ┌──────────┬───────┬────────┬─────┐
    │ a        ┆ b     ┆ c      ┆ d   │
    │ ---      ┆ ---   ┆ ---    ┆ --- │
    │ binary   ┆ str   ┆ binary ┆ str │
    ╞══════════╪═══════╪════════╪═════╡
    │ b"hello" ┆ world ┆ b"!"   ┆ :)  │
    └──────────┴───────┴────────┴─────┘

    Select binary columns and export as a dict:

    >>> df.select(cs.binary()).to_dict(as_series=False)
    {'a': [b'hello'], 'c': [b'!']}

    Select all columns *except* for those that are binary:

    >>> df.select(~cs.binary()).to_dict(as_series=False)
    {'b': ['world'], 'd': [':)']}
    )r.   r   r�   rP   rO   r,   r,   †  s   € ôB ”V�HÓÐrP   c                 ó"   — t        t        g«      S )u)  
    Select all boolean columns.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame({"n": range(1, 5)}).with_columns(n_even=pl.col("n") % 2 == 0)
    >>> df
    shape: (4, 2)
    ┌─────┬────────┐
    │ n   ┆ n_even │
    │ --- ┆ ---    │
    │ i64 ┆ bool   │
    ╞═════╪════════╡
    │ 1   ┆ false  │
    │ 2   ┆ true   │
    │ 3   ┆ false  │
    │ 4   ┆ true   │
    └─────┴────────┘

    Select and invert boolean columns:

    >>> df.with_columns(is_odd=cs.boolean().not_())
    shape: (4, 3)
    ┌─────┬────────┬────────┐
    │ n   ┆ n_even ┆ is_odd │
    │ --- ┆ ---    ┆ ---    │
    │ i64 ┆ bool   ┆ bool   │
    ╞═════╪════════╪════════╡
    │ 1   ┆ false  ┆ true   │
    │ 2   ┆ true   ┆ false  │
    │ 3   ┆ false  ┆ true   │
    │ 4   ┆ true   ┆ false  │
    └─────┴────────┴────────┘

    Select all columns *except* for those that are boolean:

    >>> df.select(~cs.boolean())
    shape: (4, 1)
    ┌─────┐
    │ n   │
    │ --- │
    │ i64 │
    ╞═════╡
    │ 1   │
    │ 2   │
    │ 3   │
    │ 4   │
    └─────┘
    )r.   r   r�   rP   rO   r-   r-   ª  s   € ôn ”W�IÓÐrP   c                 ó^  — g }| D ]’  }t        |«      st        |t        «      r|j                  |«       Œ0t        |t        «      rD|D ]>  }t        |«      s t        |t        «      sd|›�}t        |«      ‚|j                  |«       Œ@ Œ„d|›�}t        |«      ‚ t        j                  |«      S )u´  
    Select all columns matching the given dtypes.

    See Also
    --------
    by_name : Select all columns matching the given names.
    by_index : Select all columns matching the given indices.

    Examples
    --------
    >>> from datetime import date
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "dt": [date(1999, 12, 31), date(2024, 1, 1), date(2010, 7, 5)],
    ...         "value": [1_234_500, 5_000_555, -4_500_000],
    ...         "other": ["foo", "bar", "foo"],
    ...     }
    ... )

    Select all columns with date or string dtypes:

    >>> df.select(cs.by_dtype(pl.Date, pl.String))
    shape: (3, 2)
    ┌────────────┬───────┐
    │ dt         ┆ other │
    │ ---        ┆ ---   │
    │ date       ┆ str   │
    ╞════════════╪═══════╡
    │ 1999-12-31 ┆ foo   │
    │ 2024-01-01 ┆ bar   │
    │ 2010-07-05 ┆ foo   │
    └────────────┴───────┘

    Select all columns that are not of date or string dtype:

    >>> df.select(~cs.by_dtype(pl.Date, pl.String))
    shape: (3, 1)
    ┌──────────┐
    │ value    │
    │ ---      │
    │ i64      │
    ╞══════════╡
    │ 1234500  │
    │ 5000555  │
    │ -4500000 │
    └──────────┘

    Group by string columns and sum the numeric columns:

    >>> df.group_by(cs.string()).agg(cs.numeric().sum()).sort(by="other")
    shape: (2, 2)
    ┌───────┬──────────┐
    │ other ┆ value    │
    │ ---   ┆ ---      │
    │ str   ┆ i64      │
    ╞═══════╪══════════╡
    │ bar   ┆ 5000555  │
    │ foo   ┆ -3265500 │
    └───────┴──────────┘
    zinvalid dtype: )r   rM   r¸   rc   r   rZ   r'   rÊ   )rŽ   Ú
all_dtypesÚtpÚtr`   s        rO   r.   r.   ä  s³   € ðJ BD€JØò !ˆÜ˜2Ô¤*¨R´Ô"6Ø×Ñ˜bÕ!Ü˜œJÔ'Øò %�Ü'¨Ô*¬j¸¼DÔ.AØ+¨A¨5Ð1�CÜ# C›.Ð(Ø×!Ñ! !Õ$ñ	%ð $ B 6Ð*ˆCÜ˜C“.Ð ð!ô ×Ñ˜jÓ)Ð)rP   )r{   c                ó  — g }|D ][  }t        |t        t        f«      r|j                  |«       Œ+t        |t        «      r|j                  |«       ŒMd|›�}t        |«      ‚ t        j                  t        j                  || «      «      S )uM  
    Select all columns matching the given indices (or range objects).

    Parameters
    ----------
    *indices
        One or more column indices (or range objects).
        Negative indexing is supported.
    require_all
        By default, all specified indices must be valid; if any index is out of bounds,
        an error is raised. If set to `False`, out-of-bounds indices are ignored

    Notes
    -----
    Matching columns are returned in the order in which their indexes
    appear in the selector, not the underlying schema order.

    See Also
    --------
    by_dtype : Select all columns matching the given dtypes.
    by_name : Select all columns matching the given names.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "key": ["abc"],
    ...         **{f"c{i:02}": [0.5 * i] for i in range(100)},
    ...     },
    ... )
    >>> print(df)
    shape: (1, 101)
    ┌─────┬─────┬─────┬─────┬───┬──────┬──────┬──────┬──────┐
    │ key ┆ c00 ┆ c01 ┆ c02 ┆ … ┆ c96  ┆ c97  ┆ c98  ┆ c99  │
    │ --- ┆ --- ┆ --- ┆ --- ┆   ┆ ---  ┆ ---  ┆ ---  ┆ ---  │
    │ str ┆ f64 ┆ f64 ┆ f64 ┆   ┆ f64  ┆ f64  ┆ f64  ┆ f64  │
    ╞═════╪═════╪═════╪═════╪═══╪══════╪══════╪══════╪══════╡
    │ abc ┆ 0.0 ┆ 0.5 ┆ 1.0 ┆ … ┆ 48.0 ┆ 48.5 ┆ 49.0 ┆ 49.5 │
    └─────┴─────┴─────┴─────┴───┴──────┴──────┴──────┴──────┘

    Select columns by index ("key" column and the two first/last columns):

    >>> df.select(cs.by_index(0, 1, 2, -2, -1))
    shape: (1, 5)
    ┌─────┬─────┬─────┬──────┬──────┐
    │ key ┆ c00 ┆ c01 ┆ c98  ┆ c99  │
    │ --- ┆ --- ┆ --- ┆ ---  ┆ ---  │
    │ str ┆ f64 ┆ f64 ┆ f64  ┆ f64  │
    ╞═════╪═════╪═════╪══════╪══════╡
    │ abc ┆ 0.0 ┆ 0.5 ┆ 49.0 ┆ 49.5 │
    └─────┴─────┴─────┴──────┴──────┘

    Select the "key" column and use a `range` object to select various columns.
    Note that you can freely mix and match integer indices and `range` objects:

    >>> df.select(cs.by_index(0, range(1, 101, 20)))
    shape: (1, 6)
    ┌─────┬─────┬──────┬──────┬──────┬──────┐
    │ key ┆ c00 ┆ c20  ┆ c40  ┆ c60  ┆ c80  │
    │ --- ┆ --- ┆ ---  ┆ ---  ┆ ---  ┆ ---  │
    │ str ┆ f64 ┆ f64  ┆ f64  ┆ f64  ┆ f64  │
    ╞═════╪═════╪══════╪══════╪══════╪══════╡
    │ abc ┆ 0.0 ┆ 10.0 ┆ 20.0 ┆ 30.0 ┆ 40.0 │
    └─────┴─────┴──────┴──────┴──────┴──────┘

    >>> df.select(cs.by_index(0, range(101, 0, -25), require_all=False))
    shape: (1, 5)
    ┌─────┬──────┬──────┬──────┬─────┐
    │ key ┆ c75  ┆ c50  ┆ c25  ┆ c00 │
    │ --- ┆ ---  ┆ ---  ┆ ---  ┆ --- │
    │ str ┆ f64  ┆ f64  ┆ f64  ┆ f64 │
    ╞═════╪══════╪══════╪══════╪═════╡
    │ abc ┆ 37.5 ┆ 25.0 ┆ 12.5 ┆ 0.0 │
    └─────┴──────┴──────┴──────┴─────┘

    Select all columns *except* for the even-indexed ones:

    >>> df.select(~cs.by_index(range(1, 100, 2)))
    shape: (1, 51)
    ┌─────┬─────┬─────┬─────┬───┬──────┬──────┬──────┬──────┐
    │ key ┆ c01 ┆ c03 ┆ c05 ┆ … ┆ c93  ┆ c95  ┆ c97  ┆ c99  │
    │ --- ┆ --- ┆ --- ┆ --- ┆   ┆ ---  ┆ ---  ┆ ---  ┆ ---  │
    │ str ┆ f64 ┆ f64 ┆ f64 ┆   ┆ f64  ┆ f64  ┆ f64  ┆ f64  │
    ╞═════╪═════╪═════╪═════╪═══╪══════╪══════╪══════╪══════╡
    │ abc ┆ 0.5 ┆ 1.5 ┆ 2.5 ┆ … ┆ 46.5 ┆ 47.5 ┆ 48.5 ┆ 49.5 │
    └─────┴─────┴─────┴─────┴───┴──────┴──────┴──────┴──────┘
    zinvalid index value: )rM   Úranger   rb   r¹   rc   rZ   r'   r›   r   r/   )r{   ÚindicesÚall_indicesÚidxr`   s        rO   r/   r/   :  s„   € ðv ')€KØò !ˆÜ�cœE¤8Ð,Ô-Ø×Ñ˜sÕ#Ü˜œSÔ!Ø×Ñ˜sÕ#à)¨#¨Ð1ˆCÜ˜C“.Ð ð!ô ×$Ñ$¤Z×%8Ñ%8¸ÀkÓ%RÓSÐSrP   c                ó8  — g }|D ]|  }t        |t        «      r|j                  |«       Œ%t        |t        «      r9|D ]3  }t        |t        «      sd|›�}t	        |«      ‚|j                  |«       Œ5 Œnd|›�}t	        |«      ‚ t
        j                  || d¬«      S )u  
    Select all columns matching the given names.

    .. versionadded:: 0.20.27
      The `require_all` parameter was added.

    Parameters
    ----------
    *names
        One or more names of columns to select.
    require_all
        Whether to match *all* names (the default) or *any* of the names.

    Notes
    -----
    Matching columns are returned in the order in which they are declared in
    the selector, not the underlying schema order.

    See Also
    --------
    by_dtype : Select all columns matching the given dtypes.
    by_index : Select all columns matching the given indices.
    matches: Select columns matching the given regex pattern.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [False, True],
    ...     }
    ... )

    Select columns by name:

    >>> df.select(cs.by_name("foo", "bar"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ foo ┆ bar │
    │ --- ┆ --- │
    │ str ┆ i64 │
    ╞═════╪═════╡
    │ x   ┆ 123 │
    │ y   ┆ 456 │
    └─────┴─────┘

    Match *any* of the given columns by name:

    >>> df.select(cs.by_name("baz", "moose", "foo", "bear", require_all=False))
    shape: (2, 2)
    ┌─────┬─────┐
    │ baz ┆ foo │
    │ --- ┆ --- │
    │ f64 ┆ str │
    ╞═════╪═════╡
    │ 2.0 ┆ x   │
    │ 5.5 ┆ y   │
    └─────┴─────┘

    Match all columns *except* for those given:

    >>> df.select(~cs.by_name("foo", "bar"))
    shape: (2, 2)
    ┌─────┬───────┐
    │ baz ┆ zap   │
    │ --- ┆ ---   │
    │ f64 ┆ bool  │
    ╞═════╪═══════╡
    │ 2.0 ┆ false │
    │ 5.5 ┆ true  │
    └─────┴───────┘
    zinvalid name: Frø   )rM   r…   rc   r   rZ   r'   rÍ   )r{   rŒ   Ú	all_namesÚnmÚnr`   s         rO   r0   r0   ¢  sª   € ðX €IØò !ˆÜ�bœ#ÔØ×Ñ˜RÕ Ü˜œJÔ'Øò $�Ü! !¤SÔ)Ø*¨1¨%Ð0�CÜ# C›.Ð(Ø× Ñ  Õ#ñ	$ð # 2 &Ð)ˆCÜ˜C“.Ð ð!ô ×Ñ˜Y¨{ÈEÐÓRÐRrP   c                 óP   — t         j                  t        j                  «       «      S )uR  
    Select no columns.

    This is useful for composition with other selectors.

    See Also
    --------
    all : Select all columns in the current scope.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> pl.DataFrame({"a": 1, "b": 2}).select(cs.empty())
    shape: (0, 0)
    ┌┐
    ╞╡
    └┘
    )r'   r›   r   Úemptyr�   rP   rO   r.  r.  ÿ  s   € ô& ×$Ñ$¤Z×%5Ñ%5Ó%7Ó8Ð8rP   c                 óP   — t         j                  t        j                  «       «      S )u%  
    Select all enum columns.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    categorical : Select all categorical columns.
    string : Select all string columns (optionally including categoricals).

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["xx", "yy"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...     },
    ...     schema_overrides={"foo": pl.Enum(["xx", "yy"])},
    ... )

    Select all enum columns:

    >>> df.select(cs.enum())
    shape: (2, 1)
    ┌──────┐
    │ foo  │
    │ ---  │
    │ enum │
    ╞══════╡
    │ xx   │
    │ yy   │
    └──────┘

    Select all columns *except* for those that are enum:

    >>> df.select(~cs.enum())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘
    )r'   r›   r   Úenum_r�   rP   rO   r9   r9     s   € ôj ×$Ñ$¤Z×%5Ñ%5Ó%7Ó8Ð8rP   c                ór   — | �| j                   nd}t        j                  t        j                  |«      «      S )u%  
    Select all list columns.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    array : Select all array columns.
    nested : Select all nested columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [["xx", "yy"], ["x"]],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...     },
    ... )

    Select all list columns:

    >>> df.select(cs.list())
    shape: (2, 1)
    ┌──────────────┐
    │ foo          │
    │ ---          │
    │ list[str]    │
    ╞══════════════╡
    │ ["xx", "yy"] │
    │ ["x"]        │
    └──────────────┘

    Select all columns *except* for those that are list:

    >>> df.select(~cs.list())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘

    Select all list columns with a certain matching inner type:

    >>> df.select(cs.list(cs.string()))
    shape: (2, 1)
    ┌──────────────┐
    │ foo          │
    │ ---          │
    │ list[str]    │
    ╞══════════════╡
    │ ["xx", "yy"] │
    │ ["x"]        │
    └──────────────┘
    >>> df.select(cs.list(cs.integer()))
    shape: (0, 0)
    ┌┐
    ╞╡
    └┘
    N)r“   r'   r›   r   rA   )ÚinnerÚinner_ss     rO   rA   rA   M  s1   € ðL $)Ð#4ˆe×Ò¸$€GÜ×$Ñ$¤Z§_¡_°WÓ%=Ó>Ð>rP   )Úwidthc               ót   — | �| j                   nd}t        j                  t        j                  ||«      «      S )uC	  
    Select all array columns.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    list : Select all list columns.
    nested : Select all nested columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [["xx", "yy"], ["x", "y"]],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...     },
    ...     schema_overrides={"foo": pl.Array(pl.String, 2)},
    ... )

    Select all array columns:

    >>> df.select(cs.array())
    shape: (2, 1)
    ┌───────────────┐
    │ foo           │
    │ ---           │
    │ array[str, 2] │
    ╞═══════════════╡
    │ ["xx", "yy"]  │
    │ ["x", "y"]    │
    └───────────────┘

    Select all columns *except* for those that are array:

    >>> df.select(~cs.array())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘

    Select all array columns with a certain matching inner type:

    >>> df.select(cs.array(cs.string()))
    shape: (2, 1)
    ┌───────────────┐
    │ foo           │
    │ ---           │
    │ array[str, 2] │
    ╞═══════════════╡
    │ ["xx", "yy"]  │
    │ ["x", "y"]    │
    └───────────────┘
    >>> df.select(cs.array(cs.integer()))
    shape: (0, 0)
    ┌┐
    ╞╡
    └┘
    >>> df.select(cs.array(width=2))
    shape: (2, 1)
    ┌───────────────┐
    │ foo           │
    │ ---           │
    │ array[str, 2] │
    ╞═══════════════╡
    │ ["xx", "yy"]  │
    │ ["x", "y"]    │
    └───────────────┘
    >>> df.select(cs.array(width=3))
    shape: (0, 0)
    ┌┐
    ╞╡
    └┘
    N)r“   r'   r›   r   r+   )r2  r4  r3  s      rO   r+   r+   —  s5   € ðl $)Ð#4ˆe×Ò¸$€GÜ×$Ñ$¤Z×%5Ñ%5°g¸uÓ%EÓFÐFrP   c                 óP   — t         j                  t        j                  «       «      S )u[  
    Select all struct columns.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    list : Select all list columns.
    array : Select all array columns.
    nested : Select all nested columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [{"a": "xx", "b": "z"}, {"a": "x", "b": "y"}],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...     },
    ... )

    Select all struct columns:

    >>> df.select(cs.struct())
    shape: (2, 1)
    ┌────────────┐
    │ foo        │
    │ ---        │
    │ struct[2]  │
    ╞════════════╡
    │ {"xx","z"} │
    │ {"x","y"}  │
    └────────────┘

    Select all columns *except* for those that are struct:

    >>> df.select(~cs.struct())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘
    )r'   r›   r   Ústruct_r�   rP   rO   rH   rH   ñ  s   € ôj ×$Ñ$¤Z×%7Ñ%7Ó%9Ó:Ð:rP   c                 óP   — t         j                  t        j                  «       «      S )ud  
    Select all nested columns.

    A nested column is a list, array or struct.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    list : Select all list columns.
    array : Select all array columns.
    struct : Select all struct columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [{"a": "xx", "b": "z"}, {"a": "x", "b": "y"}],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "wow": [[1, 2], [3]],
    ...     },
    ... )

    Select all nested columns:

    >>> df.select(cs.nested())
    shape: (2, 2)
    ┌────────────┬───────────┐
    │ foo        ┆ wow       │
    │ ---        ┆ ---       │
    │ struct[2]  ┆ list[i64] │
    ╞════════════╪═══════════╡
    │ {"xx","z"} ┆ [1, 2]    │
    │ {"x","y"}  ┆ [3]       │
    └────────────┴───────────┘

    Select all columns *except* for those that are nested:

    >>> df.select(~cs.nested())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘
    )r'   r›   r   rC   r�   rP   rO   rC   rC   )  s   € ôp ×$Ñ$¤Z×%6Ñ%6Ó%8Ó9Ð9rP   c                 óP   — t         j                  t        j                  «       «      S )ub  
    Select all categorical columns.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    string : Select all string columns (optionally including categoricals).

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["xx", "yy"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...     },
    ...     schema_overrides={"foo": pl.Categorical},
    ... )

    Select all categorical columns:

    >>> df.select(cs.categorical())
    shape: (2, 1)
    ┌─────┐
    │ foo │
    │ --- │
    │ cat │
    ╞═════╡
    │ xx  │
    │ yy  │
    └─────┘

    Select all columns *except* for those that are categorical:

    >>> df.select(~cs.categorical())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘
    )r'   r›   r   r1   r�   rP   rO   r1   r1   d  s   € ô^ ×$Ñ$¤Z×%;Ñ%;Ó%=Ó>Ð>rP   c                 óh   — t        | «      }t        j                  t        j                  |«      «      S )u¸  
    Select columns whose names contain the given literal substring(s).

    Parameters
    ----------
    substring
        Substring(s) that matching column names should contain.

    See Also
    --------
    matches : Select all columns that match the given regex pattern.
    ends_with : Select columns that end with the given substring(s).
    starts_with : Select columns that start with the given substring(s).

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [False, True],
    ...     }
    ... )

    Select columns that contain the substring 'ba':

    >>> df.select(cs.contains("ba"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘

    Select columns that contain the substring 'ba' or the letter 'z':

    >>> df.select(cs.contains("ba", "z"))
    shape: (2, 3)
    ┌─────┬─────┬───────┐
    │ bar ┆ baz ┆ zap   │
    │ --- ┆ --- ┆ ---   │
    │ i64 ┆ f64 ┆ bool  │
    ╞═════╪═════╪═══════╡
    │ 123 ┆ 2.0 ┆ false │
    │ 456 ┆ 5.5 ┆ true  │
    └─────┴─────┴───────┘

    Select all columns *except* for those that contain the substring 'ba':

    >>> df.select(~cs.contains("ba"))
    shape: (2, 2)
    ┌─────┬───────┐
    │ foo ┆ zap   │
    │ --- ┆ ---   │
    │ str ┆ bool  │
    ╞═════╪═══════╡
    │ x   ┆ false │
    │ y   ┆ true  │
    └─────┴───────┘
    ©r  r'   r›   r   rB   )Ú	substringÚpatterns     rO   r2   r2   –  s+   € ôD ˜Ó#€GÜ×$Ñ$¤Z×%7Ñ%7¸Ó%@ÓAÐArP   c                 ó"   — t        t        g«      S )u�  
    Select all date columns.

    See Also
    --------
    datetime : Select all datetime columns, optionally filtering by time unit/zone.
    duration : Select all duration columns, optionally filtering by time unit.
    temporal : Select all temporal columns.
    time : Select all time columns.

    Examples
    --------
    >>> from datetime import date, datetime, time
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "dtm": [datetime(2001, 5, 7, 10, 25), datetime(2031, 12, 31, 0, 30)],
    ...         "dt": [date(1999, 12, 31), date(2024, 8, 9)],
    ...         "tm": [time(0, 0, 0), time(23, 59, 59)],
    ...     },
    ... )

    Select all date columns:

    >>> df.select(cs.date())
    shape: (2, 1)
    ┌────────────┐
    │ dt         │
    │ ---        │
    │ date       │
    ╞════════════╡
    │ 1999-12-31 │
    │ 2024-08-09 │
    └────────────┘

    Select all columns *except* for those that are dates:

    >>> df.select(~cs.date())
    shape: (2, 2)
    ┌─────────────────────┬──────────┐
    │ dtm                 ┆ tm       │
    │ ---                 ┆ ---      │
    │ datetime[μs]        ┆ time     │
    ╞═════════════════════╪══════════╡
    │ 2001-05-07 10:25:00 ┆ 00:00:00 │
    │ 2031-12-31 00:30:00 ┆ 23:59:59 │
    └─────────────────────┴──────────┘
    )r.   r   r�   rP   rO   r3   r3   Ü  ó   € ôb ”T�FÓÐrP   c                ó.  — | €g d¢}n(t        | t        «      r| gnt        j                  | «      }|€dg}n8t        |t        t        j
                  f«      r|gnt        j                  |«      }t        j                  t        j                  ||«      «      S )uO  
    Select all datetime columns, optionally filtering by time unit/zone.

    Parameters
    ----------
    time_unit
        One (or more) of the allowed timeunit precision strings, "ms", "us", and "ns".
        Omit to select columns with any valid timeunit.
    time_zone
        * One or more timezone strings, as defined in zoneinfo (to see valid options
          run `import zoneinfo; zoneinfo.available_timezones()` for a full list).
        * Set `None` to select Datetime columns that do not have a timezone.
        * Set "*" to select Datetime columns that have *any* timezone.

    See Also
    --------
    date : Select all date columns.
    duration : Select all duration columns, optionally filtering by time unit.
    temporal : Select all temporal columns.
    time : Select all time columns.

    Examples
    --------
    >>> from datetime import datetime, date, timezone
    >>> import polars.selectors as cs
    >>> from zoneinfo import ZoneInfo
    >>> tokyo_tz = ZoneInfo("Asia/Tokyo")
    >>> utc_tz = timezone.utc
    >>> df = pl.DataFrame(
    ...     {
    ...         "tstamp_tokyo": [
    ...             datetime(1999, 7, 21, 5, 20, 16, 987654, tzinfo=tokyo_tz),
    ...             datetime(2000, 5, 16, 6, 21, 21, 123465, tzinfo=tokyo_tz),
    ...         ],
    ...         "tstamp_utc": [
    ...             datetime(2023, 4, 10, 12, 14, 16, 999000, tzinfo=utc_tz),
    ...             datetime(2025, 8, 25, 14, 18, 22, 666000, tzinfo=utc_tz),
    ...         ],
    ...         "tstamp": [
    ...             datetime(2000, 11, 20, 18, 12, 16, 600000),
    ...             datetime(2020, 10, 30, 10, 20, 25, 123000),
    ...         ],
    ...         "dt": [date(1999, 12, 31), date(2010, 7, 5)],
    ...     },
    ...     schema_overrides={
    ...         "tstamp_tokyo": pl.Datetime("ns", "Asia/Tokyo"),
    ...         "tstamp_utc": pl.Datetime("us", "UTC"),
    ...     },
    ... )

    Select all datetime columns:

    >>> df.select(cs.datetime())
    shape: (2, 3)
    ┌────────────────────────────────┬─────────────────────────────┬─────────────────────────┐
    │ tstamp_tokyo                   ┆ tstamp_utc                  ┆ tstamp                  │
    │ ---                            ┆ ---                         ┆ ---                     │
    │ datetime[ns, Asia/Tokyo]       ┆ datetime[μs, UTC]           ┆ datetime[μs]            │
    ╞════════════════════════════════╪═════════════════════════════╪═════════════════════════╡
    │ 1999-07-21 05:20:16.987654 JST ┆ 2023-04-10 12:14:16.999 UTC ┆ 2000-11-20 18:12:16.600 │
    │ 2000-05-16 06:21:21.123465 JST ┆ 2025-08-25 14:18:22.666 UTC ┆ 2020-10-30 10:20:25.123 │
    └────────────────────────────────┴─────────────────────────────┴─────────────────────────┘

    Select all datetime columns that have 'us' precision:

    >>> df.select(cs.datetime("us"))
    shape: (2, 2)
    ┌─────────────────────────────┬─────────────────────────┐
    │ tstamp_utc                  ┆ tstamp                  │
    │ ---                         ┆ ---                     │
    │ datetime[μs, UTC]           ┆ datetime[μs]            │
    ╞═════════════════════════════╪═════════════════════════╡
    │ 2023-04-10 12:14:16.999 UTC ┆ 2000-11-20 18:12:16.600 │
    │ 2025-08-25 14:18:22.666 UTC ┆ 2020-10-30 10:20:25.123 │
    └─────────────────────────────┴─────────────────────────┘

    Select all datetime columns that have *any* timezone:

    >>> df.select(cs.datetime(time_zone="*"))
    shape: (2, 2)
    ┌────────────────────────────────┬─────────────────────────────┐
    │ tstamp_tokyo                   ┆ tstamp_utc                  │
    │ ---                            ┆ ---                         │
    │ datetime[ns, Asia/Tokyo]       ┆ datetime[μs, UTC]           │
    ╞════════════════════════════════╪═════════════════════════════╡
    │ 1999-07-21 05:20:16.987654 JST ┆ 2023-04-10 12:14:16.999 UTC │
    │ 2000-05-16 06:21:21.123465 JST ┆ 2025-08-25 14:18:22.666 UTC │
    └────────────────────────────────┴─────────────────────────────┘

    Select all datetime columns that have a *specific* timezone:

    >>> df.select(cs.datetime(time_zone="UTC"))
    shape: (2, 1)
    ┌─────────────────────────────┐
    │ tstamp_utc                  │
    │ ---                         │
    │ datetime[μs, UTC]           │
    ╞═════════════════════════════╡
    │ 2023-04-10 12:14:16.999 UTC │
    │ 2025-08-25 14:18:22.666 UTC │
    └─────────────────────────────┘

    Select all datetime columns that have NO timezone:

    >>> df.select(cs.datetime(time_zone=None))
    shape: (2, 1)
    ┌─────────────────────────┐
    │ tstamp                  │
    │ ---                     │
    │ datetime[μs]            │
    ╞═════════════════════════╡
    │ 2000-11-20 18:12:16.600 │
    │ 2020-10-30 10:20:25.123 │
    └─────────────────────────┘

    Select all columns *except* for datetime columns:

    >>> df.select(~cs.datetime())
    shape: (2, 1)
    ┌────────────┐
    │ dt         │
    │ ---        │
    │ date       │
    ╞════════════╡
    │ 1999-12-31 │
    │ 2010-07-05 │
    └────────────┘
    N©ÚmsÚusÚns)
rM   r…   rº   rA   r¿   Útimezoner'   r›   r   r4   )r®   r¯   Útime_unit_lstÚtime_zone_lsts       rO   r4   r4     sŽ   € ðR ÐÚ*‰ô & i´Ô5ˆY‰K¼8¿=¹=ÈÓ;Sð 	ð
 ÐØ˜‰ô ˜)¤c¬:×+>Ñ+>Ð%?Ô@ð ‰Kä—‘˜yÓ)ð 	ô ×$Ñ$¤Z×%8Ñ%8¸ÈÓ%VÓWÐWrP   c                 óP   — t         j                  t        j                  «       «      S )u�  
    Select all decimal columns.

    See Also
    --------
    float : Select all float columns.
    integer : Select all integer columns.
    numeric : Select all numeric columns.

    Examples
    --------
    >>> from decimal import Decimal as D
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [D(123), D(456)],
    ...         "baz": [D("2.0005"), D("-50.5555")],
    ...     },
    ...     schema_overrides={"baz": pl.Decimal(scale=5, precision=10)},
    ... )

    Select all decimal columns:

    >>> df.select(cs.decimal())
    shape: (2, 2)
    ┌───────────────┬───────────────┐
    │ bar           ┆ baz           │
    │ ---           ┆ ---           │
    │ decimal[38,0] ┆ decimal[10,5] │
    ╞═══════════════╪═══════════════╡
    │ 123           ┆ 2.00050       │
    │ 456           ┆ -50.55550     │
    └───────────────┴───────────────┘

    Select all columns *except* the decimal ones:

    >>> df.select(~cs.decimal())
    shape: (2, 1)
    ┌─────┐
    │ foo │
    │ --- │
    │ str │
    ╞═════╡
    │ x   │
    │ y   │
    └─────┘
    )r'   r›   r   r5   r�   rP   rO   r5   r5   ­  ó   € ôd ×$Ñ$¤Z×%7Ñ%7Ó%9Ó:Ð:rP   c                óf   — | rdnd}t         j                  t        j                  d|› d�«      «      S )u‚
  
    Select all columns having names consisting only of digits.

    Notes
    -----
    Matching column names cannot contain *any* non-digit characters. Note that the
    definition of "digit" consists of all valid Unicode digit characters (`\d`)
    by default; this can be changed by setting `ascii_only=True`.

    Examples
    --------
    >>> import polars as pl
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "key": ["aaa", "bbb", "aaa", "bbb", "bbb"],
    ...         "year": [2001, 2001, 2025, 2025, 2001],
    ...         "value": [-25, 100, 75, -15, -5],
    ...     }
    ... ).pivot(
    ...     values="value",
    ...     index="key",
    ...     on="year",
    ...     aggregate_function="sum",
    ... )
    >>> print(df)
    shape: (2, 3)
    ┌─────┬──────┬──────┐
    │ key ┆ 2001 ┆ 2025 │
    │ --- ┆ ---  ┆ ---  │
    │ str ┆ i64  ┆ i64  │
    ╞═════╪══════╪══════╡
    │ aaa ┆ -25  ┆ 75   │
    │ bbb ┆ 95   ┆ -15  │
    └─────┴──────┴──────┘

    Select columns with digit names:

    >>> df.select(cs.digit())
    shape: (2, 2)
    ┌──────┬──────┐
    │ 2001 ┆ 2025 │
    │ ---  ┆ ---  │
    │ i64  ┆ i64  │
    ╞══════╪══════╡
    │ -25  ┆ 75   │
    │ 95   ┆ -15  │
    └──────┴──────┘

    Select all columns *except* for those with digit names:

    >>> df.select(~cs.digit())
    shape: (2, 1)
    ┌─────┐
    │ key │
    │ --- │
    │ str │
    ╞═════╡
    │ aaa │
    │ bbb │
    └─────┘

    Demonstrate use of `ascii_only` flag (by default all valid unicode digits
    are considered, but this can be constrained to ascii 0-9):

    >>> df = pl.DataFrame({"१९९९": [1999], "२०७७": [2077], "3000": [3000]})
    >>> df.select(cs.digit())
    shape: (1, 3)
    ┌──────┬──────┬──────┐
    │ १९९९ ┆ २०७७ ┆ 3000 │
    │ ---  ┆ ---  ┆ ---  │
    │ i64  ┆ i64  ┆ i64  │
    ╞══════╪══════╪══════╡
    │ 1999 ┆ 2077 ┆ 3000 │
    └──────┴──────┴──────┘

    >>> df.select(cs.digit(ascii_only=True))
    shape: (1, 1)
    ┌──────┐
    │ 3000 │
    │ ---  │
    │ i64  │
    ╞══════╡
    │ 3000 │
    └──────┘
    z[0-9]r  ry   z+$r  )r  r  s     rO   r6   r6   â  s3   € ñn &‰x¨5€HÜ×$Ñ$¤Z×%7Ñ%7¸1¸X¸JÀbÐ8IÓ%JÓKÐKrP   c                ó°   — | €g d¢} n(t        | t        «      r| gnt        j                  | «      } t        j                  t        j                  | «      «      S )ud  
    Select all duration columns, optionally filtering by time unit.

    Parameters
    ----------
    time_unit
        One (or more) of the allowed timeunit precision strings, "ms", "us", and "ns".
        Omit to select columns with any valid timeunit.

    See Also
    --------
    date : Select all date columns.
    datetime : Select all datetime columns, optionally filtering by time unit/zone.
    temporal : Select all temporal columns.
    time : Select all time columns.

    Examples
    --------
    >>> from datetime import date, timedelta
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "dt": [date(2022, 1, 31), date(2025, 7, 5)],
    ...         "td1": [
    ...             timedelta(days=1, milliseconds=123456),
    ...             timedelta(days=1, hours=23, microseconds=987000),
    ...         ],
    ...         "td2": [
    ...             timedelta(days=7, microseconds=456789),
    ...             timedelta(days=14, minutes=999, seconds=59),
    ...         ],
    ...         "td3": [
    ...             timedelta(weeks=4, days=-10, microseconds=999999),
    ...             timedelta(weeks=3, milliseconds=123456, microseconds=1),
    ...         ],
    ...     },
    ...     schema_overrides={
    ...         "td1": pl.Duration("ms"),
    ...         "td2": pl.Duration("us"),
    ...         "td3": pl.Duration("ns"),
    ...     },
    ... )

    Select all duration columns:

    >>> df.select(cs.duration())
    shape: (2, 3)
    ┌────────────────┬─────────────────┬────────────────────┐
    │ td1            ┆ td2             ┆ td3                │
    │ ---            ┆ ---             ┆ ---                │
    │ duration[ms]   ┆ duration[μs]    ┆ duration[ns]       │
    ╞════════════════╪═════════════════╪════════════════════╡
    │ 1d 2m 3s 456ms ┆ 7d 456789µs     ┆ 18d 999999µs       │
    │ 1d 23h 987ms   ┆ 14d 16h 39m 59s ┆ 21d 2m 3s 456001µs │
    └────────────────┴─────────────────┴────────────────────┘

    Select all duration columns that have 'ms' precision:

    >>> df.select(cs.duration("ms"))
    shape: (2, 1)
    ┌────────────────┐
    │ td1            │
    │ ---            │
    │ duration[ms]   │
    ╞════════════════╡
    │ 1d 2m 3s 456ms │
    │ 1d 23h 987ms   │
    └────────────────┘

    Select all duration columns that have 'ms' OR 'ns' precision:

    >>> df.select(cs.duration(["ms", "ns"]))
    shape: (2, 2)
    ┌────────────────┬────────────────────┐
    │ td1            ┆ td3                │
    │ ---            ┆ ---                │
    │ duration[ms]   ┆ duration[ns]       │
    ╞════════════════╪════════════════════╡
    │ 1d 2m 3s 456ms ┆ 18d 999999µs       │
    │ 1d 23h 987ms   ┆ 21d 2m 3s 456001µs │
    └────────────────┴────────────────────┘

    Select all columns *except* for duration columns:

    >>> df.select(~cs.duration())
    shape: (2, 1)
    ┌────────────┐
    │ dt         │
    │ ---        │
    │ date       │
    ╞════════════╡
    │ 2022-01-31 │
    │ 2025-07-05 │
    └────────────┘
    rA  )rM   r…   rº   rA   r'   r›   r   r7   )r®   s    rO   r7   r7   =  sN   € ðD ÐÚ&‰	ô & i´Ô5ˆY‰K¼8¿=¹=ÈÓ;Sð 	ô ×$Ñ$¤Z×%8Ñ%8¸Ó%CÓDÐDrP   c                 ón   — t        | «      › d�}t        j                  t        j                  |«      «      S )u/  
    Select columns that end with the given substring(s).

    See Also
    --------
    contains : Select columns that contain the given literal substring(s).
    matches : Select all columns that match the given regex pattern.
    starts_with : Select columns that start with the given substring(s).

    Parameters
    ----------
    suffix
        Substring(s) that matching column names should end with.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [False, True],
    ...     }
    ... )

    Select columns that end with the substring 'z':

    >>> df.select(cs.ends_with("z"))
    shape: (2, 1)
    ┌─────┐
    │ baz │
    │ --- │
    │ f64 │
    ╞═════╡
    │ 2.0 │
    │ 5.5 │
    └─────┘

    Select columns that end with *either* the letter 'z' or 'r':

    >>> df.select(cs.ends_with("z", "r"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘

    Select all columns *except* for those that end with the substring 'z':

    >>> df.select(~cs.ends_with("z"))
    shape: (2, 3)
    ┌─────┬─────┬───────┐
    │ foo ┆ bar ┆ zap   │
    │ --- ┆ --- ┆ ---   │
    │ str ┆ i64 ┆ bool  │
    ╞═════╪═════╪═══════╡
    │ x   ┆ 123 ┆ false │
    │ y   ┆ 456 ┆ true  │
    └─────┴─────┴───────┘
    rz   r;  )Úsuffixr=  s     rO   r8   r8   ©  s3   € ôD ˜FÓ#Ð$ AÐ&€GÜ×$Ñ$¤Z×%7Ñ%7¸Ó%@ÓAÐArP   c                ó   — t        | g|¢­Ž  S )uŸ  
    Select all columns except those matching the given columns, datatypes, or selectors.

    Parameters
    ----------
    columns
        One or more columns (col or name), datatypes, columns, or selectors representing
        the columns to exclude.
    *more_columns
        Additional columns, datatypes, or selectors to exclude, specified as positional
        arguments.

    Notes
    -----
    If excluding a single selector it is simpler to write as `~selector` instead.

    Examples
    --------
    Exclude by column name(s):

    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "aa": [1, 2, 3],
    ...         "ba": ["a", "b", None],
    ...         "cc": [None, 2.5, 1.5],
    ...     }
    ... )
    >>> df.select(cs.exclude("ba", "xx"))
    shape: (3, 2)
    ┌─────┬──────┐
    │ aa  ┆ cc   │
    │ --- ┆ ---  │
    │ i64 ┆ f64  │
    ╞═════╪══════╡
    │ 1   ┆ null │
    │ 2   ┆ 2.5  │
    │ 3   ┆ 1.5  │
    └─────┴──────┘

    Exclude using a column name, a selector, and a dtype:

    >>> df.select(cs.exclude("aa", cs.string(), pl.UInt32))
    shape: (3, 1)
    ┌──────┐
    │ cc   │
    │ ---  │
    │ f64  │
    ╞══════╡
    │ null │
    │ 2.5  │
    │ 1.5  │
    └──────┘
    )r‘   )rù   rú   s     rO   r:   r:   ï  s   € ô@ ! Ð8¨<Ò8Ð8Ð8rP   c                óR   — t         j                  t        j                  | «      «      S )ub  
    Select the first column in the current scope.

    See Also
    --------
    all : Select all columns.
    last : Select the last column in the current scope.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [0, 1],
    ...     }
    ... )

    Select the first column:

    >>> df.select(cs.first())
    shape: (2, 1)
    ┌─────┐
    │ foo │
    │ --- │
    │ str │
    ╞═════╡
    │ x   │
    │ y   │
    └─────┘

    Select everything  *except* for the first column:

    >>> df.select(~cs.first())
    shape: (2, 3)
    ┌─────┬─────┬─────┐
    │ bar ┆ baz ┆ zap │
    │ --- ┆ --- ┆ --- │
    │ i64 ┆ f64 ┆ i64 │
    ╞═════╪═════╪═════╡
    │ 123 ┆ 2.0 ┆ 0   │
    │ 456 ┆ 5.5 ┆ 1   │
    └─────┴─────┴─────┘
    )r'   r›   r   r<   rQ   s    rO   r<   r<   2	  s!   € ô^ ×$Ñ$¤Z×%5Ñ%5°fÓ%=Ó>Ð>rP   c                 óP   — t         j                  t        j                  «       «      S )u  
    Select all float columns.

    See Also
    --------
    integer : Select all integer columns.
    numeric : Select all numeric columns.
    signed_integer : Select all signed integer columns.
    unsigned_integer : Select all unsigned integer columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [0.0, 1.0],
    ...     },
    ...     schema_overrides={"baz": pl.Float32, "zap": pl.Float64},
    ... )

    Select all float columns:

    >>> df.select(cs.float())
    shape: (2, 2)
    ┌─────┬─────┐
    │ baz ┆ zap │
    │ --- ┆ --- │
    │ f32 ┆ f64 │
    ╞═════╪═════╡
    │ 2.0 ┆ 0.0 │
    │ 5.5 ┆ 1.0 │
    └─────┴─────┘

    Select all columns *except* for those that are float:

    >>> df.select(~cs.float())
    shape: (2, 2)
    ┌─────┬─────┐
    │ foo ┆ bar │
    │ --- ┆ --- │
    │ str ┆ i64 │
    ╞═════╪═════╡
    │ x   ┆ 123 │
    │ y   ┆ 456 │
    └─────┴─────┘
    )r'   r›   r   r=   r�   rP   rO   r=   r=   d	  s   € ôd ×$Ñ$¤Z×%5Ñ%5Ó%7Ó8Ð8rP   c                 óP   — t         j                  t        j                  «       «      S )uô  
    Select all integer columns.

    See Also
    --------
    by_dtype : Select columns by dtype.
    float : Select all float columns.
    numeric : Select all numeric columns.
    signed_integer : Select all signed integer columns.
    unsigned_integer : Select all unsigned integer columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [0, 1],
    ...     }
    ... )

    Select all integer columns:

    >>> df.select(cs.integer())
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ zap │
    │ --- ┆ --- │
    │ i64 ┆ i64 │
    ╞═════╪═════╡
    │ 123 ┆ 0   │
    │ 456 ┆ 1   │
    └─────┴─────┘

    Select all columns *except* for those that are integer :

    >>> df.select(~cs.integer())
    shape: (2, 2)
    ┌─────┬─────┐
    │ foo ┆ baz │
    │ --- ┆ --- │
    │ str ┆ f64 │
    ╞═════╪═════╡
    │ x   ┆ 2.0 │
    │ y   ┆ 5.5 │
    └─────┴─────┘
    )r'   r›   r   r>   r�   rP   rO   r>   r>   ™	  rI  rP   c                 óP   — t         j                  t        j                  «       «      S )u1  
    Select all signed integer columns.

    See Also
    --------
    by_dtype : Select columns by dtype.
    float : Select all float columns.
    integer : Select all integer columns.
    numeric : Select all numeric columns.
    unsigned_integer : Select all unsigned integer columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [-123, -456],
    ...         "bar": [3456, 6789],
    ...         "baz": [7654, 4321],
    ...         "zap": ["ab", "cd"],
    ...     },
    ...     schema_overrides={"bar": pl.UInt32, "baz": pl.UInt64},
    ... )

    Select all signed integer columns:

    >>> df.select(cs.signed_integer())
    shape: (2, 1)
    ┌──────┐
    │ foo  │
    │ ---  │
    │ i64  │
    ╞══════╡
    │ -123 │
    │ -456 │
    └──────┘

    >>> df.select(~cs.signed_integer())
    shape: (2, 3)
    ┌──────┬──────┬─────┐
    │ bar  ┆ baz  ┆ zap │
    │ ---  ┆ ---  ┆ --- │
    │ u32  ┆ u64  ┆ str │
    ╞══════╪══════╪═════╡
    │ 3456 ┆ 7654 ┆ ab  │
    │ 6789 ┆ 4321 ┆ cd  │
    └──────┴──────┴─────┘

    Select all integer columns (both signed and unsigned):

    >>> df.select(cs.integer())
    shape: (2, 3)
    ┌──────┬──────┬──────┐
    │ foo  ┆ bar  ┆ baz  │
    │ ---  ┆ ---  ┆ ---  │
    │ i64  ┆ u32  ┆ u64  │
    ╞══════╪══════╪══════╡
    │ -123 ┆ 3456 ┆ 7654 │
    │ -456 ┆ 6789 ┆ 4321 │
    └──────┴──────┴──────┘
    )r'   r›   r   rE   r�   rP   rO   rE   rE   Î	  s   € ô| ×$Ñ$¤Z×%>Ñ%>Ó%@ÓAÐArP   c                 óP   — t         j                  t        j                  «       «      S )u|  
    Select all unsigned integer columns.

    See Also
    --------
    by_dtype : Select columns by dtype.
    float : Select all float columns.
    integer : Select all integer columns.
    numeric : Select all numeric columns.
    signed_integer : Select all signed integer columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [-123, -456],
    ...         "bar": [3456, 6789],
    ...         "baz": [7654, 4321],
    ...         "zap": ["ab", "cd"],
    ...     },
    ...     schema_overrides={"bar": pl.UInt32, "baz": pl.UInt64},
    ... )

    Select all unsigned integer columns:

    >>> df.select(cs.unsigned_integer())
    shape: (2, 2)
    ┌──────┬──────┐
    │ bar  ┆ baz  │
    │ ---  ┆ ---  │
    │ u32  ┆ u64  │
    ╞══════╪══════╡
    │ 3456 ┆ 7654 │
    │ 6789 ┆ 4321 │
    └──────┴──────┘

    Select all columns *except* for those that are unsigned integers:

    >>> df.select(~cs.unsigned_integer())
    shape: (2, 2)
    ┌──────┬─────┐
    │ foo  ┆ zap │
    │ ---  ┆ --- │
    │ i64  ┆ str │
    ╞══════╪═════╡
    │ -123 ┆ ab  │
    │ -456 ┆ cd  │
    └──────┴─────┘

    Select all integer columns (both signed and unsigned):

    >>> df.select(cs.integer())
    shape: (2, 3)
    ┌──────┬──────┬──────┐
    │ foo  ┆ bar  ┆ baz  │
    │ ---  ┆ ---  ┆ ---  │
    │ i64  ┆ u32  ┆ u64  │
    ╞══════╪══════╪══════╡
    │ -123 ┆ 3456 ┆ 7654 │
    │ -456 ┆ 6789 ┆ 4321 │
    └──────┴──────┴──────┘
    )r'   r›   r   rK   r�   rP   rO   rK   rK   
  s   € ô@ ×$Ñ$¤Z×%@Ñ%@Ó%BÓCÐCrP   c                óR   — t         j                  t        j                  | «      «      S )u_  
    Select the last column in the current scope.

    See Also
    --------
    all : Select all columns.
    first : Select the first column in the current scope.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [0, 1],
    ...     }
    ... )

    Select the last column:

    >>> df.select(cs.last())
    shape: (2, 1)
    ┌─────┐
    │ zap │
    │ --- │
    │ i64 │
    ╞═════╡
    │ 0   │
    │ 1   │
    └─────┘

    Select everything  *except* for the last column:

    >>> df.select(~cs.last())
    shape: (2, 3)
    ┌─────┬─────┬─────┐
    │ foo ┆ bar ┆ baz │
    │ --- ┆ --- ┆ --- │
    │ str ┆ i64 ┆ f64 │
    ╞═════╪═════╪═════╡
    │ x   ┆ 123 ┆ 2.0 │
    │ y   ┆ 456 ┆ 5.5 │
    └─────┴─────┴─────┘
    )r'   r›   r   r@   rQ   s    rO   r@   r@   R
  s   € ô^ ×$Ñ$¤Z§_¡_°VÓ%<Ó=Ð=rP   c                óÊ   — | dk(  r
t        «       S | j                  d«      r| dd } n| j                  d«      r| dd } t        j	                  t        j                  | «      «      S )u÷  
    Select all columns that match the given regex pattern.

    See Also
    --------
    contains : Select all columns that contain the given substring.
    ends_with : Select all columns that end with the given substring(s).
    starts_with : Select all columns that start with the given substring(s).

    Parameters
    ----------
    pattern
        A valid regular expression pattern, compatible with the `regex crate
        <https://docs.rs/regex/latest/regex/>`_.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [0, 1],
    ...     }
    ... )

    Match column names containing an 'a', preceded by a character that is not 'z':

    >>> df.select(cs.matches("[^z]a"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ i64 ┆ f64 │
    ╞═════╪═════╡
    │ 123 ┆ 2.0 │
    │ 456 ┆ 5.5 │
    └─────┴─────┘

    Do not match column names ending in 'R' or 'z' (case-insensitively):

    >>> df.select(~cs.matches(r"(?i)R|z$"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ foo ┆ zap │
    │ --- ┆ --- │
    │ str ┆ i64 │
    ╞═════╪═════╡
    │ x   ┆ 0   │
    │ y   ┆ 1   │
    └─────┴─────┘
    z.*é   Néþÿÿÿ)r(   r†   r‡   r'   r›   r   rB   )r=  s    rO   rB   rB   „
  sa   € ðl �$‚Ü‹uˆà×Ñ˜dÔ#Ø˜a˜b�k‰GØ×Ñ˜dÔ#Ø˜c˜r�lˆGä×(Ñ(¬×);Ñ);¸GÓ)DÓEÐErP   c                 óP   — t         j                  t        j                  «       «      S )uF  
    Select all numeric columns.

    See Also
    --------
    by_dtype : Select columns by dtype.
    float : Select all float columns.
    integer : Select all integer columns.
    signed_integer : Select all signed integer columns.
    unsigned_integer : Select all unsigned integer columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": ["x", "y"],
    ...         "bar": [123, 456],
    ...         "baz": [2.0, 5.5],
    ...         "zap": [0, 0],
    ...     },
    ...     schema_overrides={"bar": pl.Int16, "baz": pl.Float32, "zap": pl.UInt8},
    ... )

    Match all numeric columns:

    >>> df.select(cs.numeric())
    shape: (2, 3)
    ┌─────┬─────┬─────┐
    │ bar ┆ baz ┆ zap │
    │ --- ┆ --- ┆ --- │
    │ i16 ┆ f32 ┆ u8  │
    ╞═════╪═════╪═════╡
    │ 123 ┆ 2.0 ┆ 0   │
    │ 456 ┆ 5.5 ┆ 0   │
    └─────┴─────┴─────┘

    Match all columns *except* for those that are numeric:

    >>> df.select(~cs.numeric())
    shape: (2, 1)
    ┌─────┐
    │ foo │
    │ --- │
    │ str │
    ╞═════╡
    │ x   │
    │ y   │
    └─────┘
    )r'   r›   r   rD   r�   rP   rO   rD   rD   Å
  s   € ôf ×$Ñ$¤Z×%7Ñ%7Ó%9Ó:Ð:rP   c                 óP   — t         j                  t        j                  «       «      S )u£	  
    Select all object columns.

    See Also
    --------
    by_dtype : Select columns by dtype.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> from uuid import uuid4
    >>> with pl.Config(fmt_str_lengths=36):
    ...     df = pl.DataFrame(
    ...         {
    ...             "idx": [0, 1],
    ...             "uuid_obj": [uuid4(), uuid4()],
    ...             "uuid_str": [str(uuid4()), str(uuid4())],
    ...         },
    ...         schema_overrides={"idx": pl.Int32},
    ...     )
    ...     print(df)  # doctest: +IGNORE_RESULT
    shape: (2, 3)
    ┌─────┬──────────────────────────────────────┬──────────────────────────────────────┐
    │ idx ┆ uuid_obj                             ┆ uuid_str                             │
    │ --- ┆ ---                                  ┆ ---                                  │
    │ i32 ┆ object                               ┆ str                                  │
    ╞═════╪══════════════════════════════════════╪══════════════════════════════════════╡
    │ 0   ┆ 6be063cf-c9c6-43be-878e-e446cfd42981 ┆ acab9fea-c05d-4b91-b639-418004a63f33 │
    │ 1   ┆ 7849d8f9-2cac-48e7-96d3-63cf81c14869 ┆ 28c65415-8b7d-4857-a4ce-300dca14b12b │
    └─────┴──────────────────────────────────────┴──────────────────────────────────────┘

    Select object columns and export as a dict:

    >>> df.select(cs.object()).to_dict(as_series=False)  # doctest: +IGNORE_RESULT
    {
        "uuid_obj": [
            UUID("6be063cf-c9c6-43be-878e-e446cfd42981"),
            UUID("7849d8f9-2cac-48e7-96d3-63cf81c14869"),
        ]
    }

    Select all columns *except* for those that are object and export as dict:

    >>> df.select(~cs.object())  # doctest: +IGNORE_RESULT
    {
        "idx": [0, 1],
        "uuid_str": [
            "acab9fea-c05d-4b91-b639-418004a63f33",
            "28c65415-8b7d-4857-a4ce-300dca14b12b",
        ],
    }
    )r'   r›   r   r½   r�   rP   rO   r½   r½   û
  s   € ôj ×$Ñ$¤Z×%6Ñ%6Ó%8Ó9Ð9rP   c                 ón   — dt        | «      › �}t        j                  t        j                  |«      «      S )uL  
    Select columns that start with the given substring(s).

    Parameters
    ----------
    prefix
        Substring(s) that matching column names should start with.

    See Also
    --------
    contains : Select all columns that contain the given substring.
    ends_with : Select all columns that end with the given substring(s).
    matches : Select all columns that match the given regex pattern.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "foo": [1.0, 2.0],
    ...         "bar": [3.0, 4.0],
    ...         "baz": [5, 6],
    ...         "zap": [7, 8],
    ...     }
    ... )

    Match columns starting with a 'b':

    >>> df.select(cs.starts_with("b"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ bar ┆ baz │
    │ --- ┆ --- │
    │ f64 ┆ i64 │
    ╞═════╪═════╡
    │ 3.0 ┆ 5   │
    │ 4.0 ┆ 6   │
    └─────┴─────┘

    Match columns starting with *either* the letter 'b' or 'z':

    >>> df.select(cs.starts_with("b", "z"))
    shape: (2, 3)
    ┌─────┬─────┬─────┐
    │ bar ┆ baz ┆ zap │
    │ --- ┆ --- ┆ --- │
    │ f64 ┆ i64 ┆ i64 │
    ╞═════╪═════╪═════╡
    │ 3.0 ┆ 5   ┆ 7   │
    │ 4.0 ┆ 6   ┆ 8   │
    └─────┴─────┴─────┘

    Match all columns *except* for those starting with 'b':

    >>> df.select(~cs.starts_with("b"))
    shape: (2, 2)
    ┌─────┬─────┐
    │ foo ┆ zap │
    │ --- ┆ --- │
    │ f64 ┆ i64 │
    ╞═════╪═════╡
    │ 1.0 ┆ 7   │
    │ 2.0 ┆ 8   │
    └─────┴─────┘
    ry   r;  )ÚprefixÚstarts_with_patterns     rO   rF   rF   3  s5   € ðD œj¨Ó0Ð1Ð2ÐÜ×$Ñ$¤Z×%7Ñ%7Ð8KÓ%LÓMÐMrP   )Úinclude_categoricalc                óT   — t         g}| r|j                  t        «       t        |«      S )ue  
    Select all String (and, optionally, Categorical) string columns.

    See Also
    --------
    binary : Select all binary columns.
    by_dtype : Select all columns matching the given dtype(s).
    categorical: Select all categorical columns.

    Examples
    --------
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "w": ["xx", "yy", "xx", "yy", "xx"],
    ...         "x": [1, 2, 1, 4, -2],
    ...         "y": [3.0, 4.5, 1.0, 2.5, -2.0],
    ...         "z": ["a", "b", "a", "b", "b"],
    ...     },
    ... ).with_columns(
    ...     z=pl.col("z").cast(pl.Categorical()),
    ... )

    Group by all string columns, sum the numeric columns, then sort by the string cols:

    >>> df.group_by(cs.string()).agg(cs.numeric().sum()).sort(by=cs.string())
    shape: (2, 3)
    ┌─────┬─────┬─────┐
    │ w   ┆ x   ┆ y   │
    │ --- ┆ --- ┆ --- │
    │ str ┆ i64 ┆ f64 │
    ╞═════╪═════╪═════╡
    │ xx  ┆ 0   ┆ 2.0 │
    │ yy  ┆ 6   ┆ 7.0 │
    └─────┴─────┴─────┘

    Group by all string *and* categorical columns:

    >>> df.group_by(cs.string(include_categorical=True)).agg(cs.numeric().sum()).sort(
    ...     by=cs.string(include_categorical=True)
    ... )
    shape: (3, 4)
    ┌─────┬─────┬─────┬──────┐
    │ w   ┆ z   ┆ x   ┆ y    │
    │ --- ┆ --- ┆ --- ┆ ---  │
    │ str ┆ cat ┆ i64 ┆ f64  │
    ╞═════╪═════╪═════╪══════╡
    │ xx  ┆ a   ┆ 2   ┆ 4.0  │
    │ xx  ┆ b   ┆ -2  ┆ -2.0 │
    │ yy  ┆ b   ┆ 6   ┆ 7.0  │
    └─────┴─────┴─────┴──────┘
    )r   rc   r   r.   )r]  Ústring_dtypess     rO   rG   rG   y  s(   € ôj 5;°8€MÙØ×Ñœ[Ô)ä�MÓ"Ð"rP   c                 óP   — t         j                  t        j                  «       «      S )u]  
    Select all temporal columns.

    See Also
    --------
    by_dtype : Select all columns matching the given dtype(s).
    date : Select all date columns.
    datetime : Select all datetime columns, optionally filtering by time unit/zone.
    duration : Select all duration columns, optionally filtering by time unit.
    time : Select all time columns.

    Examples
    --------
    >>> from datetime import date, time
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "dt": [date(2021, 1, 1), date(2021, 1, 2)],
    ...         "tm": [time(12, 0, 0), time(20, 30, 45)],
    ...         "value": [1.2345, 2.3456],
    ...     }
    ... )

    Match all temporal columns:

    >>> df.select(cs.temporal())
    shape: (2, 2)
    ┌────────────┬──────────┐
    │ dt         ┆ tm       │
    │ ---        ┆ ---      │
    │ date       ┆ time     │
    ╞════════════╪══════════╡
    │ 2021-01-01 ┆ 12:00:00 │
    │ 2021-01-02 ┆ 20:30:45 │
    └────────────┴──────────┘

    Match all temporal columns *except* for time columns:

    >>> df.select(cs.temporal() - cs.time())
    shape: (2, 1)
    ┌────────────┐
    │ dt         │
    │ ---        │
    │ date       │
    ╞════════════╡
    │ 2021-01-01 │
    │ 2021-01-02 │
    └────────────┘

    Match all columns *except* for temporal columns:

    >>> df.select(~cs.temporal())
    shape: (2, 1)
    ┌────────┐
    │ value  │
    │ ---    │
    │ f64    │
    ╞════════╡
    │ 1.2345 │
    │ 2.3456 │
    └────────┘
    )r'   r›   r   rI   r�   rP   rO   rI   rI   µ  s   € ô~ ×$Ñ$¤Z×%8Ñ%8Ó%:Ó;Ð;rP   c                 ó"   — t        t        g«      S )u�  
    Select all time columns.

    See Also
    --------
    date : Select all date columns.
    datetime : Select all datetime columns, optionally filtering by time unit/zone.
    duration : Select all duration columns, optionally filtering by time unit.
    temporal : Select all temporal columns.

    Examples
    --------
    >>> from datetime import date, datetime, time
    >>> import polars.selectors as cs
    >>> df = pl.DataFrame(
    ...     {
    ...         "dtm": [datetime(2001, 5, 7, 10, 25), datetime(2031, 12, 31, 0, 30)],
    ...         "dt": [date(1999, 12, 31), date(2024, 8, 9)],
    ...         "tm": [time(0, 0, 0), time(23, 59, 59)],
    ...     },
    ... )

    Select all time columns:

    >>> df.select(cs.time())
    shape: (2, 1)
    ┌──────────┐
    │ tm       │
    │ ---      │
    │ time     │
    ╞══════════╡
    │ 00:00:00 │
    │ 23:59:59 │
    └──────────┘

    Select all columns *except* for those that are times:

    >>> df.select(~cs.time())
    shape: (2, 2)
    ┌─────────────────────┬────────────┐
    │ dtm                 ┆ dt         │
    │ ---                 ┆ ---        │
    │ datetime[μs]        ┆ date       │
    ╞═════════════════════╪════════════╡
    │ 2001-05-07 10:25:00 ┆ 1999-12-31 │
    │ 2031-12-31 00:30:00 ┆ 2024-08-09 │
    └─────────────────────┴────────────┘
    )r.   r   r�   rP   rO   rJ   rJ   ÷  r?  rP   )rN   r   rÿ   zTypeIs[Selector])r^   z4DataFrame | LazyFrame | Mapping[str, PolarsDataType]r_   r  rR   r»   rÿ   ztuple[str, ...])rd   zDataFrame | LazyFramere   r   rÿ   zbuiltins.list[Any])rp   r   rq   zMapping[Any, Any] | Nonerr   r»   rs   r»   rk   r»   rÿ   zdict[str, Any])re   z[str | Expr | PolarsDataType | Selector | Collection[str | Expr | PolarsDataType | Selector]r‹   z&str | Expr | PolarsDataType | Selectorrÿ   r'   )rG   ústr | Collection[str]r  r»   rÿ   r…   r  )F)r  r»   r  r»   rÿ   r'   )rŽ   zUPolarsDataType | PythonDataType | Iterable[PolarsDataType] | Iterable[PythonDataType]rÿ   r'   )r&  z#int | range | Sequence[int | range]r{   r»   rÿ   r'   )rŒ   rb  r{   r»   rÿ   r'   r•   )r2  zNone | Selectorrÿ   r'   )r2  zSelector | Noner4  z
int | Nonerÿ   r'   )r<  r…   rÿ   r'   )N)r­   N)r®   ú&TimeUnit | Collection[TimeUnit] | Noner¯   zOstr | pydatetime.timezone | Collection[str | pydatetime.timezone | None] | Nonerÿ   r'   )r  r»   rÿ   r'   )r®   rc  rÿ   r'   )rM  r…   rÿ   r'   )rù   z[str | PolarsDataType | Selector | Expr | Collection[str | PolarsDataType | Selector | Expr]rú   z&str | PolarsDataType | Selector | Exprrÿ   r'   )rR   r»   rÿ   r'   )r=  r…   rÿ   r'   )r[  r…   rÿ   r'   )r]  r»   rÿ   r'   )jÚ
__future__r   rº   Ú
contextlibr4   r¿   Úcollections.abcr   r   r   r5   r   rÁ   Ú	functoolsr   Úoperatorr	   Útypingr
   r   r   r   Úpolars.datatypes.classesÚ	datatypesÚclassesr±   Úpolarsr   r¡   Úpolars._utils.parse.exprr   Úpolars._utils.unstabler   Úpolars._utils.variousr   r   Úpolars.datatypesr   r   r   r   r   r   r   Úpolars.exprr   ÚsuppressÚImportErrorÚpolars._plrr   r   Útypesr   Úsysr   r   r    Úpolars._typingr!   r"   r#   Úversion_infor&   Útyping_extensionsÚ__all__r?   r;   rj   rw   r‘   r'   r  r(   r)   r*   r,   r-   r.   r/   r0   r.  r9   rA   r+   rH   rC   r1   r2   r3   r6   r7   r8   r:   r<   r=   r>   rE   rK   r@   rB   rD   r½   rF   rG   rI   rJ   r�   rP   rO   ú<module>r|     s²  ðÝ "ã Û Û ß 9Ñ 9Ý (Ý Ý ÷ó ÷ (Ð 'Ý !Ý >Ý +ß 6÷÷ ñ õ à€Z×Ñ˜Ó%ñ /ß.÷/õ áÛÝ(ç+ßGÑGà
×Ñ˜7Ò"Þ!å,ò(€óV%ð, ñ	L;Ø@ðL;àðL;ð ð	L;ð
 óL;ób ðR ñØðàðð ð	ð
 ðð ðð óð24!ð	=ð4!ð 8ð4!ð ó4!ônB/ˆtô B/ðJ
 AEõ ó/7ðdhW¸Uõ hWðX ð_ð  ñ_Øð_ð ð_ð ó	_óD!óH7ðtS*ð	#ðS*ð óS*ðn HLñeTØ1ðeTØ@DðeTàóeTðP @Dõ ZSóz9ñ, 
ƒò49ó ð49ñn 
ƒóF?ó ðF?ñR 
ƒðVGÀô VGó ðVGñr 
ƒò4;ó ð4;ñn 
ƒò7:ó ð7:ót/?ódCBóL1ðj 9=ð	ð	ZXØ5ðZXð 	XðZXð óZXóz2;ôjXLðx 9=ðiEØ5ðiEàóiEóXCBðL@9ð	=ð@9ð :ð@9ð ó@9ðF !õ /?ód29ój2;ój>BóB@DðF  õ />ód>FóB3;ól5:ópCNðL +0õ 9#óx?<ôD1÷m^/ñ /ús   Â	H#È#H-