Ë
    *�£jd’ ã            	      ó4  — d dl mZ d dlmZ d dlmZ d dlZd dlZd dlm	Z	 d dl
mZmZmZmZmZ d dlZd dlZd dlm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" 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/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 d dl6m7Z7m8Z8m9Z9m:Z: d dl;m<Z<m=Z= d dl>m?Z?m@Z@ d dlAmBZBmCZCmDZD d dlEmFZFmGZG d dlHmIZImJZJ d dlKmLZLmMZM d dlNmOZOmPZPmQZQ d dlRmSc mTZU d dlVmWZWmXZX d dlYmZZZ d dl[m\Z\ d dl]m^Z^ d dl_m`Z` er,d dlambZbmcZcmdZdmeZe d dlfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZo d d lpmqZqmrZrmsZs d!„ Ztd5d"„Zu e"d#«       G d$„ d%eLeQe^«      «       Zv eGevd&d'gd(¬)«       eGevg d*¢d+¬)«       G d,„ d-eFeQeP«      «       «       Zw	 	 	 	 	 	 d6d.„Zxd/d0d1œ	 	 	 	 	 	 	 d7d2„Zyd8d3„Zzd9d4„Z{y):é    )Úannotations)ÚQUOTE_NONNUMERIC)ÚpartialN)Úget_terminal_size)ÚTYPE_CHECKINGÚLiteralÚSelfÚcastÚoverload)Ú
get_option)ÚNaTÚalgosÚlib)ÚNDArrayBacked)Úfunction)ÚPandas4Warning)Ú
set_module)Úfind_stack_level)Úvalidate_bool_kwarg)Úcoerce_indexer_dtypeÚfind_common_type)Úensure_int64Úensure_platform_intÚis_any_real_numeric_dtypeÚis_bool_dtypeÚis_dict_likeÚis_hashableÚis_integer_dtypeÚis_list_likeÚ	is_scalarÚneeds_i8_conversionÚpandas_dtype)Ú
ArrowDtypeÚCategoricalDtypeÚCategoricalDtypeTypeÚExtensionDtype)ÚABCIndexÚ	ABCSeries)Úis_valid_na_for_dtypeÚisna)Ú
algorithmsÚ	arraylikeÚops)ÚPandasDelegateÚdelegate_names)Ú	factorizeÚtake_nd)ÚNDArrayBackedExtensionArrayÚravel_compat)ÚExtensionArrayÚNoNewAttributesMixinÚPandasObject)Úextract_arrayÚsanitize_array)Úunpack_zerodim_and_defer)Únargsort)ÚObjectStringArrayMixin)Úconsole)ÚCallableÚHashableÚIteratorÚSequence)	Ú	ArrayLikeÚ	AstypeArgÚAxisIntÚDtypeÚNpDtypeÚOrderedÚShapeÚSortKindÚnpt)Ú	DataFrameÚIndexÚSeriesc                óˆ   ‡ ‡‡— d‰ j                   › d�Š‰ t        j                  u Št        ‰«      ˆˆ ˆfd„«       }‰|_         |S )NÚ__c                ó2  •— t        |«      }t        |«      r$t        |«      t        | «      k7  r|st        d«      ‚| j                  s‰
dv rt        d«      ‚t        |t        «      rÈd}| j                  |«      st        |«      ‚| j                  sS| j                  j                  |j                  «      s.t        |j                  |j                  | j                  d¬«      }n|j                  } ‰	| j                  |«      }| j                  dk(  |dk(  z  }|j                  «       r‰||<   |S |rc|| j                  v r>| j                  |«      } ‰	| j                  |«      }‰
dvr| j                  dk(  }‰||<   |S t!        j"                  | |‰	«      S ‰
d	vrt        d
‰
› dt%        |«      › d�«      ‚t        |t&        «      rt)        |j*                  «      r	 ‰	|| «      S  t-        t/        j0                  | «      ‰
«      t/        j0                  |«      «      S )NzLengths must match.)Ú__lt__Ú__gt__Ú__le__Ú__ge__z7Unordered Categoricals can only compare equality or notz?Categoricals can only be compared if 'categories' are the same.F©Úcopyéÿÿÿÿ>   Ú__eq__rS   rQ   )rW   Ú__ne__z$Cannot compare a Categorical for op z with type zB.
If you want to compare values, use 'np.asarray(cat) <op> other'.)r   r   ÚlenÚ
ValueErrorÚorderedÚ	TypeErrorÚ
isinstanceÚCategoricalÚ#_categories_match_up_to_permutationÚ
categoriesÚequalsÚrecode_for_categoriesÚcodesÚ_codesÚanyÚ_unbox_scalarr-   Úinvalid_comparisonÚtyper4   r!   ÚdtypeÚgetattrÚnpÚarray)ÚselfÚotherÚhashableÚmsgÚother_codesÚretÚmaskÚiÚ
fill_valueÚopÚopnames           €€€ú@C:\FundamentalWorkbench\vendor\pandas\core\arrays\categorical.pyÚfuncz_cat_compare_op.<locals>.func�   sô  ø€ ä˜uÓ%ˆÜ˜Ô¤3 u£:´°T³Ò#:Á8äÐ2Ó3Ð3à�|Š|ØÐAÑAÜØMóð ô �eœ[Ô)ð TˆCØ×;Ñ;¸EÔBÜ “nÐ$à—<’<¨¯©×(>Ñ(>¸u×?OÑ?OÔ(Pä3Ø—K‘K ×!1Ñ!1°4·?±?Èô‘ð $Ÿl™l�á�T—[‘[ +Ó.ˆCØ—K‘K 2Ñ%¨+¸Ñ*;Ñ<ˆDØ�x‰xŒzØ&��D‘	ØˆJáØ˜Ÿ™Ñ'Ø×&Ñ& uÓ-�Ù˜Ÿ™ aÓ(�àÐ!?Ñ?ð  Ÿ;™;¨"Ñ,�DØ *�C˜‘IØ�
ä×-Ñ-¨d°E¸2Ó>Ð>ð Ð1Ñ1ÜØ:¸6¸(ð CÜ  ›K˜=ð )8ð8óð ô ˜%¤Ô0Ô5HÈÏÉÔ5Uñ ˜% “Ð&Ø2”7œ2Ÿ8™8 D›>¨6Ó2´2·8±8¸E³?ÓCÐCó    )Ú__name__ÚoperatorÚner9   )rv   ry   ru   rw   s   ` @@rx   Ú_cat_compare_opr~   }   sK   ú€ Ø�"—+‘+�˜bÐ!€FØ”x—{‘{Ð"€Jä˜fÓ%õ=Dó &ð=Dð~ €D„Mà€Krz   c                óÂ   ‡— t        |«       	 | j                  j                  |«      }t        |«      r|‰v S t        ˆfd„|D «       «      S # t        t        f$ r Y yw xY w)aO  
    Helper for membership check for ``key`` in ``cat``.

    This is a helper method for :method:`__contains__`
    and :class:`CategoricalIndex.__contains__`.

    Returns True if ``key`` is in ``cat.categories`` and the
    location of ``key`` in ``categories`` is in ``container``.

    Parameters
    ----------
    cat : :class:`Categorical`or :class:`categoricalIndex`
    key : a hashable object
        The key to check membership for.
    container : Container (e.g. list-like or mapping)
        The container to check for membership in.

    Returns
    -------
    is_in : bool
        True if ``key`` is in ``self.categories`` and location of
        ``key`` in ``categories`` is in ``container``, else False.

    Notes
    -----
    This method does not check for NaN values. Do that separately
    before calling this method.
    Fc              3  ó&   •K  — | ]  }|‰v –— Œ
 y ­w©N© )Ú.0Úloc_Ú	containers     €rx   Ú	<genexpr>zcontains.<locals>.<genexpr>ö   s   øè ø€ Ð5±¨�4˜9Ô$±ùs   ƒ)Úhashr`   Úget_locÚKeyErrorr\   r    re   )ÚcatÚkeyr…   Úlocs     ` rx   Úcontainsr�   Æ   se   ø€ ô: 	ˆ„Ið
Ø�n‰n×$Ñ$ SÓ)ˆô �„~Ø�iÐÐô Ó5±Ó5Ó5Ð5øô ”iÐ ò Ùðús   ŽA ÁAÁAÚpandasc                  óþ  ‡ — e Zd ZU dZdZej                   edg«      z  ZdZde	d<   e
	 	 	 	 	 	 dcˆ fd„«       Z	 	 	 	 dd	 	 	 	 	 deˆ fd
„Zedfd„«       Zedgd„«       Ze
dddœ	 	 	 	 	 dhd„«       Zdiˆ fd„Zedjdkd„«       Zedjdld„«       Zedjdmd„«       Zdndmˆ fd„Ze
	 do	 dpd„«       Ze
	 	 	 	 dd	 	 	 	 	 dqd„«       Zedrd„«       Zedsd„«       Zedtd„«       Zdudvˆ fd„Zdwd„Zdxd„Zdpd„Zdpd„Z	 dy	 	 	 dzd „Zdpd!„Zdodpd"„Z dpd#„Z!dpd$„Z"dpd%„Z#	 do	 d{d&„Z$ e%e&jN                  «      Z( e%e&jR                  «      Z* e%e&jV                  «      Z, e%e&jZ                  «      Z. e%e&j^                  «      Z0 e%e&jb                  «      Z2d'„ Z3d(„ Z4e
d|d)„«       Z5e6	 d}	 	 	 	 	 d~d*„«       Z7dd+„Z8d€ˆ fd,„Z9edgd-„«       Z:dud�d.„Z;d‚d/„Z<e<Z=d‚d0„Z>e>Z?dndƒd1„Z@e
	 	 	 	 	 	 d„d2„«       ZAdid3„ZBd€d4„ZCd	d5d6œ	 	 	 	 	 d…ˆ fd7„ZDedddd8œ	 	 	 	 	 	 	 d†d9„«       ZEeddd:œ	 	 	 	 	 	 	 d‡d;„«       ZEdd	d<d8œ	 	 	 	 	 	 	 dˆd=„ZEd>d?d@d	ddAœ	 	 	 	 	 	 	 	 	 d‰dB„ZFdtdC„ZG	 	 	 	 	 	 	 	 dŠdD„ZHedtdE„«       ZId‹dF„ZJdgdG„ZKdŒdH„ZLd�dI„ZMdudŽdJ„ZNd�dK„ZOd�dL„ZPd�dM„ZQd�dN„ZRdO„ ZSd‘dP„ZTd	ddQœ	 	 	 	 	 d’ˆ fdR„ZUd	dSœd“dT„ZVd	dSœd“dU„ZWdnd”dV„ZXdpˆ fdW„ZYd•dY„ZZdnd–dZ„Z[e
d—d˜d[„«       Z\d™d\„Z]dšd]„Z^d›d^„Z_dœd_„Z`eajÄ                   ecj                  dX«      d	f	 d�d`„ZddždŸda„Ze	 	 	 	 	 	 	 	 	 	 d db„Zfˆ xZgS )¡r^   aP  
    Represent a categorical variable in classic R / S-plus fashion.

    `Categoricals` can only take on a limited, and usually fixed, number
    of possible values (`categories`). In contrast to statistical categorical
    variables, a `Categorical` might have an order, but numerical operations
    (additions, divisions, ...) are not possible.

    All values of the `Categorical` are either in `categories` or `np.nan`.
    Assigning values outside of `categories` will raise a `ValueError`. Order
    is defined by the order of the `categories`, not lexical order of the
    values.

    Parameters
    ----------
    values : list-like
        The values of the categorical. If categories are given, values not in
        categories will be replaced with NaN.
    categories : Index-like (unique), optional
        The unique categories for this categorical. If not given, the
        categories are assumed to be the unique values of `values` (sorted, if
        possible, otherwise in the order in which they appear).
    ordered : bool, default False
        Whether or not this categorical is treated as an ordered categorical.
        If True, the resulting categorical will be ordered.
        An ordered categorical respects, when sorted, the order of its
        `categories` attribute (which in turn is the `categories` argument, if
        provided).
    dtype : CategoricalDtype
        An instance of ``CategoricalDtype`` to use for this categorical.
    copy : bool, default True
        Whether to copy if the codes are unchanged.

    Attributes
    ----------
    categories : Index
        The categories of this categorical.
    codes : ndarray
        The codes (integer positions, which point to the categories) of this
        categorical, read only.
    ordered : bool
        Whether or not this Categorical is ordered.
    dtype : CategoricalDtype
        The instance of ``CategoricalDtype`` storing the ``categories``
        and ``ordered``.

    Methods
    -------
    from_codes
    as_ordered
    as_unordered
    set_categories
    rename_categories
    reorder_categories
    add_categories
    remove_categories
    remove_unused_categories
    map
    __array__

    Raises
    ------
    ValueError
        If the categories do not validate.
    TypeError
        If an explicit ``ordered=True`` is given but no `categories` and the
        `values` are not sortable.

    See Also
    --------
    CategoricalDtype : Type for categorical data.
    CategoricalIndex : An Index with an underlying ``Categorical``.

    Notes
    -----
    See the `user guide
    <https://pandas.pydata.org/pandas-docs/stable/user_guide/categorical.html>`__
    for more.

    Examples
    --------
    >>> pd.Categorical([1, 2, 3, 1, 2, 3])
    [1, 2, 3, 1, 2, 3]
    Categories (3, int64): [1, 2, 3]

    >>> pd.Categorical(["a", "b", "c", "a", "b", "c"])
    ['a', 'b', 'c', 'a', 'b', 'c']
    Categories (3, str): ['a', 'b', 'c']

    Missing values are not included as a category.

    >>> c = pd.Categorical([1, 2, 3, 1, 2, 3, np.nan])
    >>> c
    [1, 2, 3, 1, 2, 3, NaN]
    Categories (3, int64): [1, 2, 3]

    However, their presence is indicated in the `codes` attribute
    by code `-1`.

    >>> c.codes
    array([ 0,  1,  2,  0,  1,  2, -1], dtype=int8)

    Ordered `Categoricals` can be sorted according to the custom order
    of the categories and can have a min and max value.

    >>> c = pd.Categorical(
    ...     ["a", "b", "c", "a", "b", "c"], ordered=True, categories=["c", "b", "a"]
    ... )
    >>> c
    ['a', 'b', 'c', 'a', 'b', 'c']
    Categories (3, str): ['c' < 'b' < 'a']
    >>> c.min()
    'c'
    iè  ÚtolistÚcategoricalr$   Ú_dtypec                ó†   •— t        ||j                  «      }t        d¬«      j                  |«      }t        ‰| �  ||«      S )NF©r[   )r   r`   r$   Úupdate_dtypeÚsuperÚ_simple_new)Úclsrc   ri   Ú	__class__s      €rx   r—   zCategorical._simple_neww  s>   ø€ ô % U¨E×,<Ñ,<Ó=ˆÜ ¨Ô/×<Ñ<¸UÓCˆÜ‰wÑ" 5¨%Ó0Ð0rz   NTc                óZ	  •— t        j                  ||||«      }t        |«      st        d«      ‚t	        j
                  d«      }t        |dd «      }t        |t         «      r/|j                  �€nt        |j                  |j                  «      }�nLt        |t        «      rddlm}  ||«      }�n,t        |t        t        t        f«      �st!        j"                  |«      }t        |t$        «      r*t'        |«      dk(  rt	        j
                  g t(        ¬«      }nÁt        |t        j*                  «      r'|j,                  dkD  rt/        d«      ‚t1        |d «      }n€t1        |d «      }	t3        |	«      }|j5                  «       rWt	        j6                  | «      d   D �
cg c]  }
||
   ‘Œ	 }}
|s|	j8                  d	k(  rd }n|	j8                  }t1        |d |¬«      }	|	}|j                  �€…t        |j8                  t:        «      rãt=        |j8                  j>                  t@        «      r¿dd
l!m"} t        ||«      r%|jF                  jH                  jK                  «       }	n#tM        |«      jH                  jK                  «       }	|	jN                  jQ                  t:        ¬«      }|	jR                  jU                  «       }t        ||j8                  jV                  j                  «      }nüd}t        |t        t        f«      r|j8                  t(        k(  rd}t        |t        «      st1        |d «      }	 tY        |d¬«      \  }}|rdd
l!m"}  ||t(        d¬«      }t        ||j                  «      }ntt        |j8                  t         «      rDtM        |«      jZ                  }t]        ||j8                  j                  |j                  |d¬«      }nt_        ||j                  «      }|j5                  «       r4t	        j`                  |jb                  |j8                  ¬«       }||| <   |}t        d¬«      je                  |«      }tg        ||j                  «      }	th        ‰| �Õ  |	|«       y c c}
w # t        $ r3}tY        |d¬«      \  }}|j                  rt        d«      |‚Y d }~�Œdd }~ww xY w)Nz#Categorical input must be list-likeFri   r   )Ú
RangeIndex©ri   é   z3> 1 ndim Categorical are not supported at this timeÚobject©rK   )Útypes_mapperT©Úsortzl'values' is not ordered, please explicitly specify the categories order by passing in a categories argument.©ri   rU   ©rU   Úwarnr”   )6r$   Ú_from_values_or_dtyper   r\   rk   rl   rj   r]   r`   r[   ÚrangeÚpandas.core.indexes.ranger›   r'   r(   r4   ÚcomÚconvert_to_list_likeÚlistrY   rž   ÚndarrayÚndimÚNotImplementedErrorr8   r*   re   Úwhereri   r#   Ú
issubclassrh   r%   rŽ   rK   Ú_dataÚ	_pa_arrayÚcombine_chunksr7   Ú
dictionaryÚ	to_pandasÚindicesÚto_numpyÚpyarrow_dtyper0   rd   rb   Ú_get_codes_for_valuesÚonesÚshaper•   r   r–   Ú__init__)rm   Úvaluesr`   r[   ri   rU   Ú	null_maskÚvdtyper›   ÚarrÚidxÚarr_listÚsanitize_dtyperK   rc   Úpreserve_objectÚerrÚ	old_codesÚ
full_codesr™   s                      €rx   r¼   zCategorical.__init__ƒ  sÚ  ø€ ô !×6Ñ6Ø�J ¨ó
ˆô ˜FÔ#äÐAÓBÐBô —H‘H˜U“Oˆ	ô ˜ ¨$Ó/ˆÜ�fÔ.Ô/Ø×ÑÑ'Ü(¨×):Ñ):¸E¿M¹MÓJ’Ü˜¤Ô&Ý<á Ó'ŠFÜ˜F¤X¬y¼.Ð$IÕJÜ×-Ñ-¨fÓ5ˆFÜ˜&¤$Ô'¬C°«K¸1Ò,<äŸ™ "¬FÔ3‘Ü˜F¤B§J¡JÔ/Ø—;‘; ’?ä-ØMóð ô (¨°Ó5‘ô % V¨TÓ2�Ü  ›I�	Ø—=‘=”?ô 8:·x±xÀÀ
Ó7KÈAÒ7NÓOÑ7N°  s£Ð7N�HÐOñ   3§9¡9°Ò#8Ø)-™à),¯©˜ä(¨°4¸~ÔN�CØ�à×ÑÑ#Ü˜&Ÿ,™,¬
Ô3¼
Ø—‘×!Ñ!Ô#7ô9õ )ä˜f eÔ,Ø Ÿ,™,×0Ñ0×?Ñ?ÓA‘Cä'¨Ó/×9Ñ9×HÑHÓJ�CØ Ÿ^™^×5Ñ5Ä:Ð5ÓN�
ØŸ™×,Ñ,Ó.�Ü(¨°V·\±\×5OÑ5O×5WÑ5WÓX‘à"'�Ü˜f¤x´Ð&;Ô<ÀÇÁÔQWÒAWà&*�OÜ! &¬(Ô3ä+¨F°DÓ9�Fð#Ü(1°&¸tÔ(DÑ%�E˜:ñ #õ -á!& z¼ÀeÔ!L�Jô )¨°U·]±]ÓC‘ä˜Ÿ™Ô&6Ô7Ü% fÓ-×4Ñ4ˆIÜ)ØØ—‘×'Ñ'Ø× Ñ ØØô‰Eô *¨&°%×2BÑ2BÓCˆEà�=‰=Œ?äŸ'™' )§/¡/¸¿¹ÔEÐEˆJØ%*ˆJ˜	�zÑ"ØˆEä ¨Ô/×<Ñ<¸UÓCˆÜ" 5¨%×*:Ñ*:Ó;ˆÜ‰Ñ˜˜eÕ$ùòY  PøôD !ò 	#Ü(1°&¸uÔ(EÑ%�E˜:Ø—}’}ô (ðCóð  #ð	#õ %ûð	#ús   ÆQ)Ì1Q. Ñ.	R*Ñ7(R%Ò%R*c                ó   — | j                   S )aö  
        The :class:`~pandas.api.types.CategoricalDtype` for this instance.

        See Also
        --------
        astype : Cast argument to a specified dtype.
        CategoricalDtype : Type for categorical data.

        Examples
        --------
        >>> cat = pd.Categorical(["a", "b"], ordered=True)
        >>> cat
        ['a', 'b']
        Categories (2, str): ['a' < 'b']
        >>> cat.dtype
        CategoricalDtype(categories=['a', 'b'], ordered=True, categories_dtype=str)
        )r’   ©rm   s    rx   ri   zCategorical.dtype  s   € ð& �{‰{Ðrz   c                óP   — | j                   j                  }|j                  d«      S ©NrV   )Ú_ndarrayri   rh   )rm   ri   s     rx   Ú_internal_fill_valuez Categorical._internal_fill_value  s!   € ð —‘×#Ñ#ˆØ�z‰z˜"‹~Ðrz   Fr£   c               ó   —  | |||¬«      S )Nr£   r‚   )r˜   Úscalarsri   rU   s       rx   Ú_from_sequencezCategorical._from_sequence   s   € ñ �7 %¨dÔ3Ð3rz   c                óH  •— t         ‰| �  |«      }t        j                  «       5  t        j                  dd«       t        | «      j                  || j                  ¬«      }d d d «       j                  «       t        |«      k(  j                  «       r|S |S # 1 sw Y   Œ7xY w)NÚignorez=Constructing a Categorical with a dtype and values containingrœ   )
r–   Ú_cast_pointwise_resultÚwarningsÚcatch_warningsÚfilterwarningsrh   rÐ   ri   r*   Úall)rm   r½   ÚresrŠ   r™   s       €rx   rÓ   z"Categorical._cast_pointwise_result&  s†   ø€ Ü‰gÑ,¨VÓ4ˆÜ×$Ñ$Õ&Ü×#Ñ#ØØOôô �t“*×+Ñ+¨C°t·z±zÐ+ÓBˆC÷ 'ð �H‰H‹Jœ$˜s›)Ñ#×(Ñ(Ô*àˆJØˆ
÷ 'Ð&ús   ¥=BÂB!.c                 ó   — y r�   r‚   ©rm   ri   rU   s      rx   ÚastypezCategorical.astype3  s   € ØLOrz   c                 ó   — y r�   r‚   rÚ   s      rx   rÛ   zCategorical.astype6  s   € ØQTrz   c                 ó   — y r�   r‚   rÚ   s      rx   rÛ   zCategorical.astype9  s   € ØGJrz   c                ó$  •— t        |«      }| j                  |u r|r| j                  «       }|S | }|S t        |t        «      rš| j                  j                  |«      }|r| j                  «       n| } | j                  |d¬«      }|j                  «       | j                  «        z  }|j                  «       r$t        j                  dt        t        «       ¬«       |S t        |t        «      rt        ‰	| �=  ||¬«      S |j                   dv r)| j                  «       j                  «       rt#        d«      ‚t%        | j&                  «      dk(  st%        | j(                  «      dk(  r4|st+        j,                  | |¬«      }|S t+        j.                  | |¬«      }|S | j(                  j0                  }	 |j                  ||¬	«      }| j(                  j2                  }t5        ||«      sKt7        j8                  t+        j.                  | j(                  j2                  «      j                  |«      «      }t=        |t?        | j@                  «      |¬«      }|S # t:        t"        f$ r-}d
| j(                  j                  › d|› �}t#        |«      |‚d}~ww xY w)aZ  
        Coerce this type to another dtype

        Parameters
        ----------
        dtype : numpy dtype or pandas type
        copy : bool, default True
            By default, astype always returns a newly allocated object.
            If copy is set to False and dtype is categorical, the original
            object is returned.
        FrT   úŸConstructing a Categorical with a dtype and values containing non-null entries not in that dtype's categories is deprecated and will raise in a future version.©Ú
stacklevelÚiuz#Cannot convert float NaN to integerr   rœ   r£   zCannot cast z
 dtype to N©ru   )!r"   ri   rU   r]   r$   r•   Ú
_set_dtyper*   re   rÔ   r¥   r   r   r&   r–   rÛ   ÚkindrZ   rY   rc   r`   rk   Úasarrayrl   Ú_valuesÚ	_na_valuer)   r   Úitem_from_zerodimr\   r1   r   rd   )
rm   ri   rU   ÚresultÚwrongÚnew_catsru   rÅ   rp   r™   s
            €rx   rÛ   zCategorical.astype<  s?  ø€ ô ˜UÓ#ˆà�:‰:˜ÑÙ$(�T—Y‘Y“[ˆFðj ˆðk /3ˆFðj ˆôg ˜Ô/Ô0à—J‘J×+Ñ+¨EÓ2ˆEÙ"&�4—9‘9”;¨DˆDØ—_‘_ U°�_Ó7ˆFØ—K‘K“M T§Y¡Y£[ LÑ0ˆEØ�y‰yŒ{Ü—‘ð:ô #Ü/Ó1õðX ˆôI ˜œ~Ô.Ü‘7‘> %¨d�>Ó3Ð3à�Z‰Z˜4Ñ D§I¡I£K§O¡OÔ$5ÜÐBÓCÐCä�—‘‹_ Ò!¤S¨¯©Ó%9¸QÒ%>ñ ÜŸ™ D°Ô6�ð4 ˆô1 Ÿ™ $¨eÔ4�ð0 ˆð) —‘×.Ñ.ˆHð/Ø#Ÿ?™?°¸T˜?ÓB�Ø!Ÿ_™_×6Ñ6�
Ü,¨Z¸Ô?Ü!$×!6Ñ!6ÜŸ™ §¡×!:Ñ!:Ó;×BÑBÀ5ÓIó"�Jô ØÔ-¨d¯k©kÓ:ÀzôˆFð ˆøô Üðò /ð % T§_¡_×%:Ñ%:Ð$;¸:ÀeÀWÐM�Ü  “o¨3Ð.ûð/ús   Æ0B I ÉJÉ"(J
Ê
Jc                ó  — ddl m}m}m}m}  ||d¬«      }	t        |t        «      xr |j                  du}
|
rÊt        |j                  j                  «      r ||d¬«      }	n t        j                  |j                  j                  d«      r ||d¬«      }	nkt        j                  |j                  j                  d	«      r ||d¬«      }	n6t        |j                  j                  «      r|€g d
¢}|	j                  |«      }	|
r|j                  }t        ||	|dd¬«      }nY|	j                  s>|	j!                  «       }|	j#                  «       }t        |||dd¬«      }t        |d¬«      }nt        |	d¬«      }|}| j%                  ||¬«      S )aA  
        Construct a Categorical from inferred values.

        For inferred categories (`dtype` is None) the categories are sorted.
        For explicit `dtype`, the `inferred_categories` are cast to the
        appropriate type.

        Parameters
        ----------
        inferred_categories : Index
        inferred_codes : Index
        dtype : CategoricalDtype or 'category'
        true_values : list, optional
            If none are provided, the default ones are
            "True", "TRUE", and "true."

        Returns
        -------
        Categorical
        r   )rK   Úto_datetimeÚ
to_numericÚto_timedeltaFrT   NÚcoerce)ÚerrorsÚMÚm)ÚTrueÚTRUEÚtrueTr¤   r”   rœ   )rŽ   rK   rî   rï   rð   r]   r$   r`   r   ri   r   Úis_np_dtyper   Úisinrb   Úis_monotonic_increasingrU   Úsort_valuesr—   )r˜   Úinferred_categoriesÚinferred_codesri   Útrue_valuesrK   rî   rï   rð   ÚcatsÚknown_categoriesr`   rc   Úunsorteds                 rx   Ú_from_inferred_categoriesz%Categorical._from_inferred_categories‚  sl  € ÷0	
ó 	
ñ Ð(¨uÔ5ˆä�uÔ.Ó/ÒP°E×4DÑ4DÈDÐ4Pð 	ñ ä(¨×)9Ñ)9×)?Ñ)?Ô@Ù!Ð"5¸hÔG‘Ü—‘ ×!1Ñ!1×!7Ñ!7¸Ô=Ù"Ð#6¸xÔH‘Ü—‘ ×!1Ñ!1×!7Ñ!7¸Ô=Ù#Ð$7ÀÔI‘Ü˜u×/Ñ/×5Ñ5Ô6ØÐ&Ú":�Kð —y‘y Ó-�áà×)Ñ)ˆJÜ)Ø  j°uÀ4ô‰Eð ×-Ò-à—y‘y“{ˆHØ×)Ñ)Ó+ˆJä)Ø ¨*¸5ÀtôˆEô % Z¸Ô?‰Eä$ T°5Ô9ˆEØ"ˆEà�‰˜u¨EˆÓ2Ð2rz   c                ó´   — t        j                  |||¬«      }|j                  €d}t        |«      ‚|r| j	                  ||¬«      }| j                  ||¬«      S )a¸  
        Make a Categorical type from codes and categories or dtype.

        This constructor is useful if you already have codes and
        categories/dtype and so do not need the (computation intensive)
        factorization step, which is usually done on the constructor.

        If your data does not follow this convention, please use the normal
        constructor.

        Parameters
        ----------
        codes : array-like of int
            An integer array, where each integer points to a category in
            categories or dtype.categories, or else is -1 for NaN.
        categories : index-like, optional
            The categories for the categorical. Items need to be unique.
            If the categories are not given here, then they must be provided
            in `dtype`.
        ordered : bool, optional
            Whether or not this categorical is treated as an ordered
            categorical. If not given here or in `dtype`, the resulting
            categorical will be unordered.
        dtype : CategoricalDtype or "category", optional
            If :class:`CategoricalDtype`, cannot be used together with
            `categories` or `ordered`.
        validate : bool, default True
            If True, validate that the codes are valid for the dtype.
            If False, don't validate that the codes are valid. Be careful about skipping
            validation, as invalid codes can lead to severe problems, such as segfaults.

            .. versionadded:: 2.1.0

        Returns
        -------
        Categorical

        See Also
        --------
        codes : The category codes of the categorical.
        CategoricalIndex : An Index with an underlying ``Categorical``.

        Examples
        --------
        >>> dtype = pd.CategoricalDtype(["a", "b"], ordered=True)
        >>> pd.Categorical.from_codes(codes=[0, 1, 0, 1], dtype=dtype)
        ['a', 'b', 'a', 'b']
        Categories (2, str): ['a' < 'b']
        )r`   r[   ri   zKThe categories must be provided in 'categories' or 'dtype'. Both were None.rœ   )r$   r¦   r`   rZ   Ú_validate_codes_for_dtyper—   )r˜   rc   r`   r[   ri   Úvalidaterp   s          rx   Ú
from_codeszCategorical.from_codesË  sk   € ôt !×6Ñ6Ø!¨7¸%ô
ˆð ×ÑÐ#ð+ð ô ˜S“/Ð!áà×1Ñ1°%¸uÐ1ÓEˆEà�‰˜u¨EˆÓ2Ð2rz   c                ó.   — | j                   j                  S )aP  
        The categories of this categorical.

        Setting assigns new values to each category (effectively a rename of
        each individual category).

        The assigned value has to be a list-like object. All items must be
        unique and the number of items in the new categories must be the same
        as the number of items in the old categories.

        Raises
        ------
        ValueError
            If the new categories do not validate as categories or if the
            number of new categories is unequal the number of old categories

        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.

        Examples
        --------
        For :class:`pandas.Series`:

        >>> ser = pd.Series(["a", "b", "c", "a"], dtype="category")
        >>> ser.cat.categories
        Index(['a', 'b', 'c'], dtype='str')

        >>> raw_cat = pd.Categorical([None, "b", "c", None], categories=["b", "c", "d"])
        >>> ser = pd.Series(raw_cat)
        >>> ser.cat.categories
        Index(['b', 'c', 'd'], dtype='str')

        For :class:`pandas.Categorical`:

        >>> cat = pd.Categorical(["a", "b"], ordered=True)
        >>> cat.categories
        Index(['a', 'b'], dtype='str')

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(["a", "c", "b", "a", "c", "b"])
        >>> ci.categories
        Index(['a', 'b', 'c'], dtype='str')

        >>> ci = pd.CategoricalIndex(["a", "c"], categories=["c", "b", "a"])
        >>> ci.categories
        Index(['c', 'b', 'a'], dtype='str')
        )ri   r`   rÉ   s    rx   r`   zCategorical.categories  s   € ðp �z‰z×$Ñ$Ð$rz   c                ó.   — | j                   j                  S )aC  
        Whether the categories have an ordered relationship.

        See Also
        --------
        set_ordered : Set the ordered attribute.
        as_ordered : Set the Categorical to be ordered.
        as_unordered : Set the Categorical to be unordered.

        Examples
        --------
        For :class:`pandas.Series`:

        >>> ser = pd.Series(["a", "b", "c", "a"], dtype="category")
        >>> ser.cat.ordered
        False

        >>> raw_cat = pd.Categorical(["a", "b", "c", "a"], ordered=True)
        >>> ser = pd.Series(raw_cat)
        >>> ser.cat.ordered
        True

        For :class:`pandas.Categorical`:

        >>> cat = pd.Categorical(["a", "b"], ordered=True)
        >>> cat.ordered
        True

        >>> cat = pd.Categorical(["a", "b"], ordered=False)
        >>> cat.ordered
        False

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(["a", "b"], ordered=True)
        >>> ci.ordered
        True

        >>> ci = pd.CategoricalIndex(["a", "b"], ordered=False)
        >>> ci.ordered
        False
        )ri   r[   rÉ   s    rx   r[   zCategorical.orderedR  s   € ðX �z‰z×!Ñ!Ð!rz   c                ó\   — | j                   j                  «       }d|j                  _        |S )aR  
        The category codes of this categorical index.

        Codes are an array of integers which are the positions of the actual
        values in the categories array.

        There is no setter, use the other categorical methods and the normal item
        setter to change values in the categorical.

        Returns
        -------
        ndarray[int]
            A non-writable view of the ``codes`` array.

        See Also
        --------
        Categorical.from_codes : Make a Categorical from codes.
        CategoricalIndex : An Index with an underlying ``Categorical``.

        Examples
        --------
        For :class:`pandas.Categorical`:

        >>> cat = pd.Categorical(["a", "b"], ordered=True)
        >>> cat.codes
        array([0, 1], dtype=int8)

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(["a", "b", "c", "a", "b", "c"])
        >>> ci.codes
        array([0, 1, 2, 0, 1, 2], dtype=int8)

        >>> ci = pd.CategoricalIndex(["a", "c"], categories=["c", "b", "a"])
        >>> ci.codes
        array([2, 0], dtype=int8)
        F)rd   ÚviewÚflagsÚ	writeable)rm   Úvs     rx   rc   zCategorical.codes€  s(   € ðN �K‰K×ÑÓˆØ!ˆ�‰ÔØˆrz   c                ó^  •— |r!t        j                  || j                  «      }nt        || j                  ¬«      }|sV| j                  j                  �@t        |j                  «      t        | j                  j                  «      k7  rt        d«      ‚t        ‰| �!  | j                  |«       y)aÞ  
        Sets new categories inplace

        Parameters
        ----------
        fastpath : bool, default False
           Don't perform validation of the categories for uniqueness or nulls

        Examples
        --------
        >>> c = pd.Categorical(["a", "b"])
        >>> c
        ['a', 'b']
        Categories (2, str): ['a', 'b']

        >>> c._set_categories(pd.Index(["a", "c"]))
        >>> c
        ['a', 'c']
        Categories (2, str): ['a', 'c']
        r”   NzKnew categories need to have the same number of items as the old categories!)
r$   Ú_from_fastpathr[   ri   r`   rY   rZ   r–   r¼   rÌ   )rm   r`   ÚfastpathÚ	new_dtyper™   s       €rx   Ú_set_categorieszCategorical._set_categories«  sŠ   ø€ ñ* Ü(×7Ñ7¸
ÀDÇLÁLÓQ‰Iä(¨¸T¿\¹\ÔJˆIáØ—
‘
×%Ñ%Ð1Ü�I×(Ñ(Ó)¬S°·±×1FÑ1FÓ-GÒGäð/óð ô
 	‰Ñ˜Ÿ™¨	Õ2rz   c               ó”   — t        | j                  | j                  |j                  |¬«      }t        | «      j	                  ||¬«      S )a+  
        Internal method for directly updating the CategoricalDtype

        Parameters
        ----------
        dtype : CategoricalDtype

        Notes
        -----
        We don't do any validation here. It's assumed that the dtype is
        a (valid) instance of `CategoricalDtype`.
        rT   rœ   )rb   rc   r`   rh   r—   )rm   ri   rU   rc   s       rx   rä   zCategorical._set_dtypeÐ  sA   € ô &Ø�J‰J˜Ÿ™¨×)9Ñ)9Àô
ˆô �D‹z×%Ñ% e°5Ð%Ó9Ð9rz   c                ó–   — t        | j                  |¬«      }| j                  «       }t        j                  ||j
                  |«       |S )zÇ
        Set the ordered attribute to the boolean value.

        Parameters
        ----------
        value : bool
           Set whether this categorical is ordered (True) or not (False).
        r”   )r$   r`   rU   r   r¼   rÌ   )rm   Úvaluer  rŠ   s       rx   Úset_orderedzCategorical.set_orderedâ  s:   € ô % T§_¡_¸eÔDˆ	Ø�i‰i‹kˆÜ×Ñ˜s C§L¡L°)Ô<Øˆ
rz   c                ó$   — | j                  d«      S )aÄ  
        Set the Categorical to be ordered.

        Returns
        -------
        Categorical
            Ordered Categorical.

        See Also
        --------
        as_unordered : Set the Categorical to be unordered.

        Examples
        --------
        For :class:`pandas.Series`:

        >>> ser = pd.Series(["a", "b", "c", "a"], dtype="category")
        >>> ser.cat.ordered
        False
        >>> ser = ser.cat.as_ordered()
        >>> ser.cat.ordered
        True

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(["a", "b", "c", "a"])
        >>> ci.ordered
        False
        >>> ci = ci.as_ordered()
        >>> ci.ordered
        True
        T©r  rÉ   s    rx   Ú
as_orderedzCategorical.as_orderedð  s   € ðB ×Ñ Ó%Ð%rz   c                ó$   — | j                  d«      S )a   
        Set the Categorical to be unordered.

        Returns
        -------
        Categorical
            Unordered Categorical.

        See Also
        --------
        as_ordered : Set the Categorical to be ordered.

        Examples
        --------
        For :class:`pandas.Series`:

        >>> raw_cat = pd.Categorical(["a", "b", "c", "a"], ordered=True)
        >>> ser = pd.Series(raw_cat)
        >>> ser.cat.ordered
        True
        >>> ser = ser.cat.as_unordered()
        >>> ser.cat.ordered
        False

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(["a", "b", "c", "a"], ordered=True)
        >>> ci.ordered
        True
        >>> ci = ci.as_unordered()
        >>> ci.ordered
        False
        Fr  rÉ   s    rx   Úas_unorderedzCategorical.as_unordered  s   € ðD ×Ñ Ó&Ð&rz   c                ó  — |€| j                   j                  }t        ||¬«      }| j                  «       }|r‡|j                   j                  �dt        |j                  «      t        |j                   j                  «      k  r/d|j                  |j                  t        |j                  «      k\  <   |j                  }n.t        |j                  |j                  |j                  dd¬«      }t        j                  |||«       |S )aã  
        Set the categories to the specified new categories.

        ``new_categories`` can include new categories (which will result in
        unused categories) or remove old categories (which results in values
        set to ``NaN``). If ``rename=True``, the categories will simply be renamed
        (less or more items than in old categories will result in values set to
        ``NaN`` or in unused categories respectively).

        This method can be used to perform more than one action of adding,
        removing, and reordering simultaneously and is therefore faster than
        performing the individual steps via the more specialised methods.

        On the other hand this methods does not do checks (e.g., whether the
        old categories are included in the new categories on a reorder), which
        can result in surprising changes, for example when using special string
        dtypes, which do not consider a S1 string equal to a single char
        python string.

        Parameters
        ----------
        new_categories : Index-like
           The categories in new order.
        ordered : bool, default None
           Whether or not the categorical is treated as an ordered categorical.
           If not given, do not change the ordered information.
        rename : bool, default False
           Whether or not the new_categories should be considered as a rename
           of the old categories or as reordered categories.

        Returns
        -------
        Categorical
            New categories to be used, with optional ordering changes.

        Raises
        ------
        ValueError
            If new_categories does not validate as categories

        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.

        Examples
        --------
        For :class:`pandas.Series`:

        >>> raw_cat = pd.Categorical(
        ...     ["a", "b", "c", None], categories=["a", "b", "c"], ordered=True
        ... )
        >>> ser = pd.Series(raw_cat)
        >>> ser
        0   a
        1   b
        2   c
        3   NaN
        dtype: category
        Categories (3, str): ['a' < 'b' < 'c']

        >>> ser.cat.set_categories(["A", "B", "C"], rename=True)
        0   A
        1   B
        2   C
        3   NaN
        dtype: category
        Categories (3, str): ['A' < 'B' < 'C']

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(
        ...     ["a", "b", "c", None], categories=["a", "b", "c"], ordered=True
        ... )
        >>> ci
        CategoricalIndex(['a', 'b', 'c', nan], categories=['a', 'b', 'c'],
                         ordered=True, dtype='category')

        >>> ci.set_categories(["A", "b", "c"])
        CategoricalIndex([nan, 'b', 'c', nan], categories=['A', 'b', 'c'],
                         ordered=True, dtype='category')
        >>> ci.set_categories(["A", "b", "c"], rename=True)
        CategoricalIndex(['A', 'b', 'c', nan], categories=['A', 'b', 'c'],
                         ordered=True, dtype='category')
        r”   rV   Fr¤   )ri   r[   r$   rU   r`   rY   rd   rb   rc   r   r¼   )rm   Únew_categoriesr[   Úrenamer  rŠ   rc   s          rx   Úset_categorieszCategorical.set_categories7  s×   € ðx ˆ?Ø—j‘j×(Ñ(ˆGÜ$ ^¸WÔEˆ	à�i‰i‹kˆÙØ�y‰y×#Ñ#Ð/´C¸	×8LÑ8LÓ4MÔPSØ—	‘	×$Ñ$óQò 5ð GI�—
‘
˜3Ÿ:™:¬¨Y×-AÑ-AÓ)BÑBÑCØ—J‘J‰Eä)Ø—	‘	˜3Ÿ>™>¨9×+?Ñ+?ÀeÐRWôˆEô 	×Ñ˜s E¨9Ô5Øˆ
rz   c                ó  — t        |«      r*| j                  D �cg c]  }|j                  ||«      ‘Œ }}n*t        |«      r| j                  D �cg c]
  } ||«      ‘Œ }}| j	                  «       }|j                  |«       |S c c}w c c}w )aÚ  
        Rename categories.

        This method is commonly used to re-label or adjust the
        category names in categorical data without changing the
        underlying data. It is useful in situations where you want
        to modify the labels used for clarity, consistency,
        or readability.

        Parameters
        ----------
        new_categories : list-like, dict-like or callable

            New categories which will replace old categories.

            * list-like: all items must be unique and the number of items in
              the new categories must match the existing number of categories.

            * dict-like: specifies a mapping from
              old categories to new. Categories not contained in the mapping
              are passed through and extra categories in the mapping are
              ignored.

            * callable : a callable that is called on all items in the old
              categories and whose return values comprise the new categories.

        Returns
        -------
        Categorical
            Categorical with renamed categories.

        Raises
        ------
        ValueError
            If new categories are list-like and do not have the same number of
            items than the current categories or do not validate as categories

        See Also
        --------
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.

        Examples
        --------
        >>> c = pd.Categorical(["a", "a", "b"])
        >>> c.rename_categories([0, 1])
        [0, 0, 1]
        Categories (2, int64): [0, 1]

        For dict-like ``new_categories``, extra keys are ignored and
        categories not in the dictionary are passed through

        >>> c.rename_categories({"a": "A", "c": "C"})
        ['A', 'A', 'b']
        Categories (2, str): ['A', 'b']

        You may also provide a callable to create the new categories

        >>> c.rename_categories(lambda x: x.upper())
        ['A', 'A', 'B']
        Categories (2, str): ['A', 'B']
        )r   r`   ÚgetÚcallablerU   r  )rm   r  ÚitemrŠ   s       rx   Úrename_categorieszCategorical.rename_categories¦  sŠ   € ôF ˜Ô'à;?¿?º?óÙ;J°4�×"Ñ" 4¨Õ.¸?ð ñ ô �nÔ%Ø?C¿ºÓO¹°t™n¨TÕ2¸ˆNÐOà�i‰i‹kˆØ×Ñ˜NÔ+Øˆ
ùòùò Ps   šBÁBc                óÊ   — t        | j                  «      t        |«      k7  s%| j                  j                  |«      j                  st	        d«      ‚| j                  ||¬«      S )aÙ  
        Reorder categories as specified in new_categories.

        ``new_categories`` need to include all old categories and no new category
        items.

        Parameters
        ----------
        new_categories : Index-like
           The categories in new order.
        ordered : bool, optional
           Whether or not the categorical is treated as an ordered categorical.
           If not given, do not change the ordered information.

        Returns
        -------
        Categorical
            Categorical with reordered categories.

        Raises
        ------
        ValueError
            If the new categories do not contain all old category items or any
            new ones

        See Also
        --------
        rename_categories : Rename categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.

        Examples
        --------
        For :class:`pandas.Series`:

        >>> ser = pd.Series(["a", "b", "c", "a"], dtype="category")
        >>> ser = ser.cat.reorder_categories(["c", "b", "a"], ordered=True)
        >>> ser
        0   a
        1   b
        2   c
        3   a
        dtype: category
        Categories (3, str): ['c' < 'b' < 'a']

        >>> ser.sort_values()
        2   c
        1   b
        0   a
        3   a
        dtype: category
        Categories (3, str): ['c' < 'b' < 'a']

        For :class:`pandas.CategoricalIndex`:

        >>> ci = pd.CategoricalIndex(["a", "b", "c", "a"])
        >>> ci
        CategoricalIndex(['a', 'b', 'c', 'a'], categories=['a', 'b', 'c'],
                         ordered=False, dtype='category')
        >>> ci.reorder_categories(["c", "b", "a"], ordered=True)
        CategoricalIndex(['a', 'b', 'c', 'a'], categories=['c', 'b', 'a'],
                         ordered=True, dtype='category')
        z=items in new_categories are not the same as in old categoriesr”   )rY   r`   Ú
differenceÚemptyrZ   r  )rm   r  r[   s      rx   Úreorder_categorieszCategorical.reorder_categoriesô  s[   € ôF �—‘Ó ¤C¨Ó$7Ò7Ø—?‘?×-Ñ-¨nÓ=×CÒCäØOóð ð ×"Ñ" >¸7Ð"ÓCÐCrz   c                ó¶  — t        |«      s|g}t        |«      t        | j                  j                  «      z  }t	        |«      dk7  rt        d|› �«      ‚t        |d«      roddlm} t        | j                  j                  j                  |j                  g«      } |t        | j                  j                  «      t        |«      z   |¬«      }n+t        | j                  j                  «      t        |«      z   }t        || j                  «      }| j                  «       }t        |j                  |j                  «      }t!        j"                  |||«       |S )a£  
        Add new categories.

        `new_categories` will be included at the last/highest place in the
        categories and will be unused directly after this call.

        Parameters
        ----------
        new_categories : category or list-like of category
            The new categories to be included.

        Returns
        -------
        Categorical
            Categorical with new categories added.

        Raises
        ------
        ValueError
            If the new categories include old categories or do not validate as
            categories

        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.

        Examples
        --------
        >>> c = pd.Categorical(["c", "b", "c"])
        >>> c
        ['c', 'b', 'c']
        Categories (2, str): ['b', 'c']

        >>> c.add_categories(["d", "a"])
        ['c', 'b', 'c']
        Categories (4, str): ['b', 'c', 'd', 'a']
        r   z0new categories must not include old categories: ri   ©rL   rœ   )r   Úsetri   r`   rY   rZ   ÚhasattrrŽ   rL   r   r«   r$   r[   rU   r   rÌ   r   r¼   )rm   r  Úalready_includedrL   ri   r  rŠ   rc   s           rx   Úadd_categorieszCategorical.add_categories?  s$  € ôV ˜NÔ+Ø,Ð-ˆNÜ˜~Ó.´°T·Z±Z×5JÑ5JÓ1KÑKÐÜÐÓ  AÒ%ÜØBÐCSÐBTÐUóð ô �> 7Ô+Ý%ä$Ø—‘×&Ñ&×,Ñ,¨n×.BÑ.BÐCóˆEñ $Ü�T—Z‘Z×*Ñ*Ó+¬d°>Ó.BÑBÈ%ô‰Nô " $§*¡*×"7Ñ"7Ó8¼4ÀÓ;OÑOˆNä$ ^°T·\±\ÓBˆ	Ø�i‰i‹kˆÜ$ S§\¡\°9×3GÑ3GÓHˆÜ×Ñ˜s E¨9Ô5Øˆ
rz   c                ó  — ddl m} t        |«      s|g} ||«      j                  «       j	                  «       }| j
                  j                  du r'| j
                  j                  j                  |d¬«      n$| j
                  j                  j                  |«      }|j                  | j
                  j                  «      }t        |«      dk7  rt        |«      }t        d|› �«      ‚| j                  || j                  d¬«      S )a§  
        Remove the specified categories.

        The ``removals`` argument must be a subset of the current categories.
        Any values that were part of the removed categories will be set to NaN.

        Parameters
        ----------
        removals : category or list of categories
           The categories which should be removed.

        Returns
        -------
        Categorical
            Categorical with removed categories.

        Raises
        ------
        ValueError
            If the removals are not contained in the categories

        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.

        Examples
        --------
        >>> c = pd.Categorical(["a", "c", "b", "c", "d"])
        >>> c
        ['a', 'c', 'b', 'c', 'd']
        Categories (4, str): ['a', 'b', 'c', 'd']

        >>> c.remove_categories(["d", "a"])
        [NaN, 'c', 'b', 'c', NaN]
        Categories (2, str): ['b', 'c']
        r   rŸ   TFr¡   z(removals must all be in old categories: )r[   r  )rŽ   rK   r   ÚuniqueÚdropnari   r[   r`   r&  rY   r+  rZ   r  )rm   ÚremovalsrK   r  Únot_includeds        rx   Úremove_categorieszCategorical.remove_categories„  så   € õR 	!ä˜HÔ%Ø �zˆHá˜“?×)Ñ)Ó+×2Ñ2Ó4ˆð �z‰z×!Ñ! TÑ)ð �J‰J×!Ñ!×,Ñ,¨X¸EÐ,ÔBà—‘×&Ñ&×1Ñ1°(Ó;ð 	ð
  ×*Ñ*¨4¯:©:×+@Ñ+@ÓAˆäˆ|Ó Ò!Ü˜|Ó,ˆLÜÐGÈÀ~ÐVÓWÐWà×"Ñ" >¸4¿<¹<ÐPUÐ"ÓVÐVrz   c                ó–  — t        j                  | j                  d¬«      \  }}|j                  dk7  r|d   dk(  r
|dd |dz
  }}| j                  j
                  j                  |«      }t        j                  || j                  ¬«      }t        ||j
                  «      }| j                  «       }t        j                  |||«       |S )ac  
        Remove categories which are not used.

        This method is useful when working with datasets
        that undergo dynamic changes where categories may no longer be
        relevant, allowing to maintain a clean, efficient data structure.

        Returns
        -------
        Categorical
            Categorical with unused categories dropped.

        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        set_categories : Set the categories to the specified ones.

        Examples
        --------
        >>> c = pd.Categorical(["a", "c", "b", "c", "d"])
        >>> c
        ['a', 'c', 'b', 'c', 'd']
        Categories (4, str): ['a', 'b', 'c', 'd']

        >>> c[2] = "a"
        >>> c[4] = "c"
        >>> c
        ['a', 'c', 'a', 'c', 'c']
        Categories (4, str): ['a', 'b', 'c', 'd']

        >>> c.remove_unused_categories()
        ['a', 'c', 'a', 'c', 'c']
        Categories (2, str): ['a', 'c']
        T)Úreturn_inverser   rV   r�   Nr”   )rk   r0  rd   Úsizeri   r`   Útaker$   r  r[   r   rU   r   r¼   )rm   rÁ   Úinvr  r  Ú	new_codesrŠ   s          rx   Úremove_unused_categoriesz$Categorical.remove_unused_categoriesÀ  s®   € ôL —9‘9˜TŸ[™[¸Ô>‰ˆˆSà�8‰8�qŠ=˜S ™V rš\Ø˜1˜2�w  a¡�ˆCàŸ™×.Ñ.×3Ñ3°CÓ8ˆÜ$×3Ñ3Ø D§L¡Lô
ˆ	ô )¨¨i×.BÑ.BÓCˆ	à�i‰i‹kˆÜ×Ñ˜s I¨yÔ9Øˆ
rz   c                óÆ  — t        |«      st        |«      sJ ‚| j                  j                  |«      }t	        j
                  | j                  dk(  «      }t        j                  }|€Q|rOt        |«      r |t        j                  «      n-|j                  t        j                  t        j                  «      }|j                  ra|j                  sU|t        j                  u rCt        || j                  ¬«      }| j                  | j                  j                  «       |d¬«      S |r|j                  t!        |«      |«      }t	        j"                  || j                  «      S )a\  
        Map categories using an input mapping or function.

        Maps the categories to new categories. If the mapping correspondence is
        one-to-one the result is a :class:`~pandas.Categorical` which has the
        same order property as the original, otherwise a :class:`~pandas.Index`
        is returned. NaN values are unaffected.

        If a `dict` or :class:`~pandas.Series` is used any unmapped category is
        mapped to `NaN`. Note that if this happens an :class:`~pandas.Index`
        will be returned.

        Parameters
        ----------
        mapper : function, dict, or Series
            Mapping correspondence.
        na_action : {None, 'ignore'}, default None
            If 'ignore', propagate NaN values, without passing them to the
            mapping correspondence.

        Returns
        -------
        pandas.Categorical or pandas.Index
            Mapped categorical.

        See Also
        --------
        CategoricalIndex.map : Apply a mapping correspondence on a
            :class:`~pandas.CategoricalIndex`.
        Index.map : Apply a mapping correspondence on an
            :class:`~pandas.Index`.
        Series.map : Apply a mapping correspondence on a
            :class:`~pandas.Series`.
        Series.apply : Apply more complex functions on a
            :class:`~pandas.Series`.

        Examples
        --------
        >>> cat = pd.Categorical(["a", "b", "c"])
        >>> cat
        ['a', 'b', 'c']
        Categories (3, str): ['a', 'b', 'c']
        >>> cat.map(lambda x: x.upper(), na_action=None)
        ['A', 'B', 'C']
        Categories (3, str): ['A', 'B', 'C']
        >>> cat.map({"a": "first", "b": "second", "c": "third"}, na_action=None)
        ['first', 'second', 'third']
        Categories (3, str): ['first', 'second', 'third']

        If the mapping is one-to-one the ordering of the categories is
        preserved:

        >>> cat = pd.Categorical(["a", "b", "c"], ordered=True)
        >>> cat
        ['a', 'b', 'c']
        Categories (3, str): ['a' < 'b' < 'c']
        >>> cat.map({"a": 3, "b": 2, "c": 1}, na_action=None)
        [3, 2, 1]
        Categories (3, int64): [3 < 2 < 1]

        If the mapping is not one-to-one an :class:`~pandas.Index` is returned:

        >>> cat.map({"a": "first", "b": "second", "c": "first"}, na_action=None)
        Index(['first', 'second', 'first'], dtype='str')

        If a `dict` is used, all unmapped categories are mapped to `NaN` and
        the result is an :class:`~pandas.Index`:

        >>> cat.map({"a": "first", "b": "second"}, na_action=None)
        Index(['first', 'second', nan], dtype='str')

        The mapping function is applied to categories, not to each value. It is
        therefore only called once per unique category, and the result reused for
        all occurrences:

        >>> cat = pd.Categorical(["a", "a", "b"])
        >>> calls = []
        >>> def f(x):
        ...     calls.append(x)
        ...     return x.upper()
        >>> result = cat.map(f)
        >>> result
        ['A', 'A', 'B']
        Categories (2, str): ['A', 'B']
        >>> calls
        ['a', 'b']
        rV   r”   F©ri   r  )r"  r   r`   Úmaprk   re   rd   Únanr!  Ú	is_uniqueÚhasnansr$   r[   r  rU   ÚinsertrY   r8  )rm   ÚmapperÚ	na_actionr  Úhas_nansÚna_valr  s          rx   r>  zCategorical.map÷  s  € ôx ˜Ô¤<°Ô#7Ð7Ð7àŸ™×,Ñ,¨VÓ4ˆä—6‘6˜$Ÿ+™+¨Ñ+Ó,ˆä—‘ˆØÐ¡Ü'/°Ô'7‘VœBŸF™F”^¸V¿Z¹ZÌÏÉÔPR×PVÑPVÓ=WˆFà×#Ò#¨N×,BÒ,BÀvÔQS×QWÑQWÑGWÜ(¨ÀÇÁÔNˆIØ—?‘? 4§;¡;×#3Ñ#3Ó#5¸YÐQV�?ÓWÐWáØ+×2Ñ2´3°~Ó3FÈÓOˆNä�w‰w�~ t§{¡{Ó3Ð3rz   c                ó\   — t        |«      s| j                  |«      S | j                  |«      S r�   )r   Ú_validate_listlikeÚ_validate_scalar)rm   r  s     rx   Ú_validate_setitem_valuez#Categorical._validate_setitem_valuep  s,   € Ü˜5Ô!à×*Ñ*¨5Ó1Ð1à×(Ñ(¨Ó/Ð/rz   c                ó¬   — t        || j                  j                  «      rd}|S || j                  v r| j                  |«      }|S t	        d|› d�«      d‚)aK  
        Convert a user-facing fill_value to a representation to use with our
        underlying ndarray, raising TypeError if this is not possible.

        Parameters
        ----------
        fill_value : object

        Returns
        -------
        fill_value : int

        Raises
        ------
        TypeError
        rV   z5Cannot setitem on a Categorical with a new category (z), set the categories firstN)r)   r`   ri   rf   r\   )rm   ru   s     rx   rI  zCategorical._validate_scalarw  sr   € ô$ ! ¨T¯_©_×-BÑ-BÔCØˆJð Ðð ˜4Ÿ?™?Ñ*Ø×+Ñ+¨JÓ7ˆJð Ðô	 ðØ'˜LÐ(CðEóð ðrz   c               óþ  — t        |t        «      rZt        |j                  «      rEt	        |«      j                  «       rt        d«      ‚|j                  t        j                  ¬«      }nt        j                  |«      }t        |«      r#|j                  j                  dvrt        d«      ‚t        |«      rD|j                  «       t        |j                  «      k\  s|j                  «       dk  rt        d«      ‚|S )Nzcodes cannot contain NA valuesrœ   râ   z$codes need to be array-like integersrV   z1codes need to be between -1 and len(categories)-1)r]   r4   r   ri   r*   re   rZ   r·   rk   Úint64ræ   rY   rå   Úmaxr`   Úmin)r˜   rc   ri   s      rx   r  z%Categorical._validate_codes_for_dtype”  s¶   € ä�eœ^Ô,Ô1AÀ%Ç+Á+Ô1Nä�E‹{�‰Ô Ü Ð!AÓBÐBØ—N‘N¬¯©�NÓ2‰Eä—J‘J˜uÓ%ˆEÜˆuŒ:˜%Ÿ+™+×*Ñ*°$Ñ6ÜÐCÓDÐDäˆuŒ:˜5Ÿ9™9›;¬#¨e×.>Ñ.>Ó*?Ò?À5Ç9Á9Ã;ÐQSÒCSÜÐPÓQÐQØˆrz   c                ó¢   — |du rt        d«      ‚t        | j                  j                  | j                  «      }t        j                  ||¬«      S )ap  
        The numpy array interface.

        Users should not call this directly. Rather, it is invoked by
        :func:`numpy.array` and :func:`numpy.asarray`.

        Parameters
        ----------
        dtype : np.dtype or None
            Specifies the dtype for the array.

        copy : bool or None, optional
            See :func:`numpy.asarray`.

        Returns
        -------
        numpy.array
            A numpy array of either the specified dtype or,
            if dtype==None (default), the same dtype as
            categorical.categories.dtype.

        See Also
        --------
        numpy.asarray : Convert input to numpy.ndarray.

        Examples
        --------

        >>> cat = pd.Categorical(["a", "b"], ordered=True)

        The following calls ``cat.__array__``

        >>> np.asarray(cat)
        array(['a', 'b'], dtype=object)
        Fz:Unable to avoid copy while creating an array as requested.rœ   )rZ   r1   r`   rç   rd   rk   ræ   )rm   ri   rU   rr   s       rx   Ú	__array__zCategorical.__array__¦  sK   € ðN �5‰=ÜØLóð ô �d—o‘o×-Ñ-¨t¯{©{Ó;ˆô �z‰z˜# UÔ+Ð+rz   c                ó(  — t        j                  | ||g|¢­i |¤Ž}|t        ur|S d|v rt        j                  | ||g|¢­i |¤ŽS |dk(  r%t        j                  | ||g|¢­i |¤Ž}|t        ur|S t        d| j                  › d|j                  › �«      ‚)NÚoutÚreducezObject with dtype z cannot perform the numpy op )r,   Ú!maybe_dispatch_ufunc_to_dunder_opÚNotImplementedÚdispatch_ufunc_with_outÚdispatch_reduction_ufuncr\   ri   r{   )rm   ÚufuncÚmethodÚinputsÚkwargsrê   s         rx   Ú__array_ufunc__zCategorical.__array_ufunc__Ú  s×   € ä×<Ñ<Ø�%˜ð
Ø"(ò
Ø,2ñ
ˆð œÑ'ØˆMà�F‰?ä×4Ñ4Ø�e˜VðØ&,òØ06ñð ð �XÒä×7Ñ7Ø�e˜VðØ&,òØ06ñˆFð œ^Ñ+Ø�ô Ø  §¡ ð -Ø!ŸN™NÐ+ð-ó
ð 	
rz   c                óÌ   •— t        |t        «      st        ‰| �  |«      S d|vrt	        |d   |d   «      |d<   d|v rd|vr|j                  d«      |d<   t        ‰| �  |«       y)z*Necessary for making this object picklabler’   Ú_categoriesÚ_orderedrd   rÌ   N)r]   Údictr–   Ú__setstate__r$   Úpop)rm   Ústater™   s     €rx   rb  zCategorical.__setstate__÷  sn   ø€ ä˜%¤Ô&Ü‘7Ñ'¨Ó.Ð.à˜5Ñ Ü.¨u°]Ñ/CÀUÈ:ÑEVÓWˆE�(‰Oà�uÑ °5Ñ!8à %§	¡	¨(Ó 3ˆE�*Ñä‰Ñ˜UÕ#rz   c                ó„   — | j                   j                  | j                  j                  j                  j                  z   S r�   )rd   Únbytesri   r`   r½   rÉ   s    rx   rf  zCategorical.nbytes  s-   € à�{‰{×!Ñ! D§J¡J×$9Ñ$9×$@Ñ$@×$GÑ$GÑGÐGrz   c                ó|   — | j                   j                  | j                  j                  j	                  |¬«      z   S )aè  
        Memory usage of my values

        Parameters
        ----------
        deep : bool
            Introspect the data deeply, interrogate
            `object` dtypes for system-level memory consumption

        Returns
        -------
        bytes used

        Notes
        -----
        Memory usage does not include memory consumed by elements that
        are not components of the array if deep=False

        See Also
        --------
        numpy.ndarray.nbytes
        )Údeep)rd   rf  ri   r`   Úmemory_usage)rm   rh  s     rx   ri  zCategorical.memory_usage	  s1   € ð. �{‰{×!Ñ! D§J¡J×$9Ñ$9×$FÑ$FÈDÐ$FÓ$QÑQÐQrz   c                ó    — | j                   dk(  S )aX  
        Detect missing values

        Missing values (-1 in .codes) are detected.

        Returns
        -------
        np.ndarray[bool] of whether my values are null

        See Also
        --------
        isna : Top-level isna.
        isnull : Alias of isna.
        Categorical.notna : Boolean inverse of Categorical.isna.

        rV   )rd   rÉ   s    rx   r*   zCategorical.isna"  s   € ð" �{‰{˜bÑ Ð rz   c                ó$   — | j                  «        S )a„  
        Inverse of isna

        Both missing values (-1 in .codes) and NA as a category are detected as
        null.

        Returns
        -------
        np.ndarray[bool] of whether my values are not null

        See Also
        --------
        notna : Top-level notna.
        notnull : Alias of notna.
        Categorical.isna : Boolean inverse of Categorical.notna.

        )r*   rÉ   s    rx   ÚnotnazCategorical.notna7  s   € ð$ —	‘	“ˆ|Ðrz   c                ó  — ddl m}m} | j                  | j                  }}t        |«      |dk\  }}t        j                  |«      |j                  «       }	}|s|	r%|	r|n||   }
t        j                  |
|xs d¬«      }n@t        j                  t        j                  |||«      «      }t        j                  |d«      }t        || j                  j                  «      }| j                  |«      } || ||«      ddd¬«      S )	a{  
        Return a Series containing counts of each category.

        Every category will have an entry, even those with a count of 0.

        Parameters
        ----------
        dropna : bool, default True
            Don't include counts of NaN.

        Returns
        -------
        counts : Series

        See Also
        --------
        Series.value_counts
        r   )ÚCategoricalIndexrL   )Ú	minlengthrV   rM  ÚcountF)Úindexri   ÚnamerU   )rŽ   rn  rL   rd   r`   rY   rk   Úaranger×   Úbincountr¯   Úappendr   ri   Ú_from_backing_data)rm   r1  rn  rL   ÚcoderŠ   Úncatrs   ÚixÚcleanÚobsrp  Úix_categoricals                rx   Úvalue_countszCategorical.value_countsM  sÚ   € ÷&	
ð
 —K‘K §¡ˆcˆÜ˜#“h ¨¡	ˆdˆÜ—I‘I˜d“O T§X¡X£ZˆEˆá‘UÙ‘$ T¨$¡ZˆCÜ—K‘K ¨tªy°qÔ9‰Eä—K‘K¤§¡¨¨t°TÓ :Ó;ˆEÜ—‘˜2˜rÓ"ˆBä! " d§j¡j×&;Ñ&;Ó<ˆØ×0Ñ0°Ó4ˆáØÙ" >Ó2ØØØô
ð 	
rz   c                ó    — | j                  g |¬«      }t        j                  ||j                  j                  ¬«      }|j                  |«      S )zž
        Analogous to np.empty(shape, dtype=dtype)

        Parameters
        ----------
        shape : tuple[int]
        dtype : CategoricalDtype
        rœ   )rÐ   rk   ÚzerosrÌ   ri   rv  )r˜   r»   ri   rÀ   Úbackings        rx   Ú_emptyzCategorical._empty~  sF   € ð × Ñ  ¨5Ð Ó1ˆô
 —(‘(˜5¨¯©×(:Ñ(:Ô;ˆà×%Ñ% gÓ.Ð.rz   c                óÊ  — t        | j                  j                  «      r5| j                  j                  | j                  t
        ¬«      j                  S t        | j                  j                  «      r\d| j                  v rN| j                  j                  d«      j                  | j                  t        j                  ¬«      j                  S t        j                  | «      S )a  
        Return the values.

        For internal compatibility with pandas formatting.

        Returns
        -------
        np.ndarray or ExtensionArray
            A numpy array or ExtensionArray of the same dtype as
            categorical.categories.dtype.
        rã   rV   rž   )r!   r`   ri   r8  rd   r   rç   r   rÛ   rk   r?  rl   rÉ   s    rx   Ú_internal_get_valuesz Categorical._internal_get_values“  s™   € ô ˜tŸ™×4Ñ4Ô5Ø—?‘?×'Ñ'¨¯©ÄÐ'ÓD×LÑLÐLÜ˜dŸo™o×3Ñ3Ô4¸¸t¿{¹{Ñ9Jà—‘×&Ñ& xÓ0ß‘�d—k‘k¬b¯f©f�Ó5ß‘ðô
 �x‰x˜‹~Ðrz   c                ó:   — | j                   st        d|› d�«      ‚y)zassert that we are orderedz)Categorical is not ordered for operation zG
you can use .as_ordered() to change the Categorical to an ordered one
N)r[   r\   )rm   rv   s     rx   Úcheck_for_orderedzCategorical.check_for_orderedª  s-   € à�|Š|ÜØ;¸B¸4ð @2ð 2óð ð rz   Ú	quicksort©Ú	ascendingrå   c               ó(   •— t        ‰| �  d||dœ|¤ŽS )a}  
        Return the indices that would sort the Categorical.

        Missing values are sorted at the end.

        Parameters
        ----------
        ascending : bool, default True
            Whether the indices should result in an ascending
            or descending sort.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
            Sorting algorithm.
        **kwargs:
            passed through to :func:`numpy.argsort`.

        Returns
        -------
        np.ndarray[np.intp]

        See Also
        --------
        numpy.ndarray.argsort

        Notes
        -----
        While an ordering is applied to the category values, arg-sorting
        in this context refers more to organizing and grouping together
        based on matching category values. Thus, this function can be
        called on an unordered Categorical instance unlike the functions
        'Categorical.min' and 'Categorical.max'.

        Examples
        --------
        >>> pd.Categorical(["b", "b", "a", "c"]).argsort()
        array([2, 0, 1, 3])

        >>> cat = pd.Categorical(
        ...     ["b", "b", "a", "c"], categories=["c", "b", "a"], ordered=True
        ... )
        >>> cat.argsort()
        array([3, 0, 1, 2])

        Missing values are placed at the end

        >>> cat = pd.Categorical([2, None, 1])
        >>> cat.argsort()
        array([2, 0, 1])
        r‡  r‚   )r–   Úargsort)rm   rˆ  rå   r\  r™   s       €rx   rŠ  zCategorical.argsort³  s   ø€ ôf ‰w‰ÐH¨¸ÑHÀÑHÐHrz   )Úinplacerˆ  Úna_positionc                ó   — y r�   r‚   ©rm   r‹  rˆ  rŒ  s       rx   rû   zCategorical.sort_valuesè  s   € ð rz   ©rˆ  rŒ  c                ó   — y r�   r‚   rŽ  s       rx   rû   zCategorical.sort_valuesñ  s   € ð rz   Úlastc               óØ   — t        |d«      }|dvrt        d|›�«      ‚t        | ||¬«      }|s | j                  |   }| j	                  |«      S | j                  |   | j                  dd y)a†  
        Sort the Categorical by category value returning a new
        Categorical by default.

        While an ordering is applied to the category values, sorting in this
        context refers more to organizing and grouping together based on
        matching category values. Thus, this function can be called on an
        unordered Categorical instance unlike the functions 'Categorical.min'
        and 'Categorical.max'.

        Parameters
        ----------
        inplace : bool, default False
            Do operation in place.
        ascending : bool, default True
            Order ascending. Passing False orders descending. The
            ordering parameter provides the method by which the
            category values are organized.
        na_position : {'first', 'last'} (optional, default='last')
            'first' puts NaNs at the beginning
            'last' puts NaNs at the end

        Returns
        -------
        Categorical or None

        See Also
        --------
        Categorical.sort
        Series.sort_values

        Examples
        --------
        >>> c = pd.Categorical([1, 2, 2, 1, 5])
        >>> c
        [1, 2, 2, 1, 5]
        Categories (3, int64): [1, 2, 5]
        >>> c.sort_values()
        [1, 1, 2, 2, 5]
        Categories (3, int64): [1, 2, 5]
        >>> c.sort_values(ascending=False)
        [5, 2, 2, 1, 1]
        Categories (3, int64): [1, 2, 5]

        >>> c = pd.Categorical([1, 2, 2, 1, 5])

        'sort_values' behaviour with NaNs. Note that 'na_position'
        is independent of the 'ascending' parameter:

        >>> c = pd.Categorical([np.nan, 2, 2, np.nan, 5])
        >>> c
        [NaN, 2, 2, NaN, 5]
        Categories (2, int64): [2, 5]
        >>> c.sort_values()
        [2, 2, 5, NaN, NaN]
        Categories (2, int64): [2, 5]
        >>> c.sort_values(ascending=False)
        [5, 2, 2, NaN, NaN]
        Categories (2, int64): [2, 5]
        >>> c.sort_values(na_position="first")
        [NaN, NaN, 2, 2, 5]
        Categories (2, int64): [2, 5]
        >>> c.sort_values(ascending=False, na_position="first")
        [NaN, NaN, 5, 2, 2]
        Categories (2, int64): [2, 5]
        r‹  )r‘  Úfirstzinvalid na_position: r�  N)r   rZ   r:   rd   rv  )rm   r‹  rˆ  rŒ  Ú
sorted_idxrc   s         rx   rû   zCategorical.sort_valuesö  sv   € ôR & g¨yÓ9ˆØÐ/Ñ/ÜÐ4°[°OÐDÓEÐEä˜d¨iÀ[ÔQˆ
áØ—K‘K 
Ñ+ˆEØ×*Ñ*¨5Ó1Ð1ØŸ™ ZÑ0ˆ�‰‘AˆØrz   r   ÚaverageÚkeep©ÚaxisrZ  Ú	na_optionrˆ  Úpctc               ón   — |dk7  rt         ‚| j                  «       }t        j                  ||||||¬«      S )z*
        See Series.rank.__doc__.
        r   r—  )r®   Ú_values_for_rankr+   Úrank)rm   r˜  rZ  r™  rˆ  rš  Úvffs          rx   Ú_rankzCategorical._rankK  sB   € ð �1Š9Ü%Ð%Ø×#Ñ#Ó%ˆÜ�‰ØØØØØØô
ð 	
rz   c                óÀ  — ddl m} | j                  rG| j                  }|dk(  }|j	                  «       r$|j                  d«      }t        j                  ||<   |S t        | j                  j                  «      rt        j                  | «      }|S t        j                  | j                   || j                  d¬«      j                  «       j                  «      «      }|S )zð
        For correctly ranking ordered categorical data. See GH#15420

        Ordered categorical data should be ranked on the basis of
        codes with -1 translated to NaN.

        Returns
        -------
        numpy.array

        r   r*  rV   Úfloat64FrT   )rŽ   rL   r[   rc   re   rÛ   rk   r?  r   r`   ri   rl   r$  r�  r½   )rm   rL   r½   rs   s       rx   rœ  zCategorical._values_for_rankc  sµ   € õ 	"à�<Š<Ø—Z‘ZˆFØ˜R‘<ˆDØ�x‰xŒzØŸ™ yÓ1�Ü!Ÿv™v��t‘ð ˆô ' t§¡×'<Ñ'<Ô=Ü—X‘X˜d“^ˆFð ˆô —X‘XØ×&Ñ&Ù˜4Ÿ?™?°Ô7×<Ñ<Ó>×EÑEóóˆFð
 ˆrz   c               óp  — ddl m} t        j                  | j                  j
                  «      } ||||d¬«      }| j                  «       }t        |«      r|j                  | j                  «      }n t        j                  t        |«      d¬«      }|j                  «       rt        j                  ||<   |S )aA  
        Hash a Categorical by hashing its categories, and then mapping the codes
        to the hashes.

        Parameters
        ----------
        encoding : str
        hash_key : str
        categorize : bool
            Ignored for Categorical.

        Returns
        -------
        np.ndarray[uint64]
        r   )Ú
hash_arrayF)Ú
categorizeÚuint64rœ   )Úpandas.core.util.hashingr£  rk   ræ   r`   rç   r*   rY   r8  rd   r  re   r   Úu8max)	rm   ÚencodingÚhash_keyr¤  r£  r½   Úhashedrs   rê   s	            rx   Ú_hash_pandas_objectzCategorical._hash_pandas_objectƒ  s†   € õ& 	8ô —‘˜DŸO™O×3Ñ3Ó4ˆÙ˜F H¨hÀ5ÔIˆð �y‰y‹{ˆÜˆvŒ;Ø—[‘[ §¡Ó-‰Fä—X‘Xœc $›i¨xÔ8ˆFà�8‰8Œ:ÜŸ9™9ˆF�4‰Làˆrz   c                ó   — | j                   S r�   )rÌ   rÉ   s    rx   rd   zCategorical._codes±  s   € à�}‰}Ðrz   c                óJ   — |dk(  rt         j                  S | j                  |   S rË   )rk   r?  r`   )rm   rt   s     rx   Ú	_box_funczCategorical._box_funcµ  s!   € Ø�Š7Ü—6‘6ˆMØ�‰˜qÑ!Ð!rz   c                ó†   — | j                   j                  |«      }| j                  j                  j	                  |«      }|S r�   )r`   rˆ   rÌ   ri   rh   )rm   r‹   rw  s      rx   rf   zCategorical._unbox_scalarº  s7   € ð �‰×&Ñ& sÓ+ˆØ�}‰}×"Ñ"×'Ñ'¨Ó-ˆØˆrz   c                óª   ‡ — ‰ j                   dk(  r't        ‰ j                  «       j                  «       «      S ˆ fd„t	        t        ‰ «      «      D «       S )zJ
        Returns an Iterator over the values of this Categorical.
        r�   c              3  ó(   •K  — | ]	  }‰|   –— Œ y ­wr�   r‚   )rƒ   Únrm   s     €rx   r†   z'Categorical.__iter__.<locals>.<genexpr>Ê  s   øè ø€ Ð6Ñ%5 �D˜•GÑ%5ùs   ƒ)r­   Úiterrƒ  r�   r§   rY   rÉ   s   `rx   Ú__iter__zCategorical.__iter__Ã  sA   ø€ ð �9‰9˜Š>Ü˜×1Ñ1Ó3×:Ñ:Ó<Ó=Ð=ã6¤U¬3¨t«9Ô%5Ó6Ð6rz   c                óÀ   — t        || j                  j                  «      r't        | j	                  «       j                  «       «      S t        | || j                  ¬«      S )z?
        Returns True if `key` is in this Categorical.
        )r…   )r)   r`   ri   Úboolr*   re   r�   rd   )rm   r‹   s     rx   Ú__contains__zCategorical.__contains__Ì  sC   € ô
 !  d§o¡o×&;Ñ&;Ô<Ü˜Ÿ	™	›Ÿ™Ó)Ó*Ð*ä˜˜c¨T¯[©[Ô9Ð9rz   c                 ó   — y r�   r‚   )rm   Úboxeds     rx   Ú
_formatterzCategorical._formatterÛ  s   € àrz   c                ó–  — t        d«      dk(  rdn
t        d«      }ddlm} d}| j                  j                  dk(  s| j                  j                  dk(  r4t        t        | j                  j                  «      j                  d¬	«      }t        |j                  |t        ¬
«      }t        | j                  «      |kD  rM|dz  } || j                  d| j                  «      } || j                  | d j                  «      }g |¢d‘|¢}n || j                  j                  «      }|D �	cg c]  }	|	j                  «       ‘Œ }}	|S c c}	w )z9
        return the base repr for the categories
        zdisplay.max_categoriesr   é
   ©ÚformatNÚstrÚstringF)r¹  )Ú	formatterÚquotingé   z...)r   Úpandas.io.formatsr¾  r`   ri   r
   r4   rç   rº  r   Úformat_arrayr   rY   Ústrip)
rm   Úmax_categoriesÚfmtrÁ  rÅ  ÚnumÚheadÚtailÚcategory_strsÚxs
             rx   Ú_repr_categorieszCategorical._repr_categoriesß  s<  € ô Ð2Ó3°qÒ8ñ äÐ4Ó5ð 	õ
 	4àˆ	Ø�?‰?× Ñ  EÒ)¨T¯_©_×-BÑ-BÀhÒ-Nô œ^¨T¯_©_×-DÑ-DÓE×PÑPØð Qó ˆIô Ø×Ñ¨	Ô;Kô
ˆô ˆt�‰Ó .Ò0Ø  AÑ%ˆCÙ §¡°°Ð 5× =Ñ =Ó>ˆDÙ §¡°°°Ð 6× >Ñ >Ó?ˆDØ1˜dÐ1 EÐ1¨DÐ1‰Má(¨¯©×)@Ñ)@ÓAˆMñ -:Ó:©M q˜Ÿ™�¨MˆÐ:ØÐùò ;s   Ä+Ec                óZ  — | j                  «       }t        | j                  j                  «      }dt	        | j                  «      › d|› d�}t        «       \  }}t        d«      xs |}t        j                  «       rd}d}d}t	        |«      }	| j                  rdnd	\  }
}|j                  «       › d
�}|D ]]  }|dk7  r:|	|
z   t	        |«      z   |kD  r&||dt	        |«      dz   z  z   z  }t	        |«      dz   }	n|s||z  }|	t	        |«      z  }	||z  }d}Œ_ |› d|j                  dd«      › d�S )z@
        Returns a string representation of the footer.
        zCategories (ú, z): zdisplay.widthr   Ú T)é   z < )rÃ  rÐ  Ú
Ú r�   FÚ[z	 < ... < z ... Ú])rÎ  r¿  r`   ri   rY   r   r   r<   Úin_ipython_frontendr[   ÚrstripÚreplace)rm   rÌ  ri   Ú	levheaderÚwidthÚ_Ú	max_widthÚ	levstringÚstartÚcur_col_lenÚsep_lenÚsepÚlinesepÚvals                 rx   Ú_get_repr_footerzCategorical._get_repr_footer	  sD  € ð ×-Ñ-Ó/ˆÜ�D—O‘O×)Ñ)Ó*ˆØ"¤3 t§¡Ó#7Ð"8¸¸5¸'ÀÐEˆ	Ü$Ó&‰ˆˆqÜ˜Ó/Ò8°5ˆ	Ü×&Ñ&Ô(àˆIØˆ	ØˆÜ˜)“nˆØ%)§\¢\‘z°y‰ˆ�Ø—Z‘Z“\�N "Ð%ˆÛ ˆCØ˜AŠ~ +°Ñ"7¼#¸c»(Ñ"BÀYÒ"NØ˜W¨¬s°9«~ÀÑ/AÑ(BÑCÑC�	Ü! )›n¨qÑ0‘ÙØ˜SÑ �	Øœs 3›xÑ'�Ø˜ÑˆIØ‰Eð !ð �˜A˜i×/Ñ/°¸WÓEÐFÀaÐHÐHrz   c                óü   — ddl m} t        | «      dkD  sJ ‚| j                  «       }|j	                  |d d dt
        ¬«      }|D �cg c]  }|j                  «       ‘Œ }}dj                  |«      }d|z   dz   }|S c c}w )Nr   r½  ÚNaN)Úfloat_formatÚna_reprÂ  rÐ  rÕ  rÖ  )rÄ  r¾  rY   rƒ  rÅ  r   rÆ  Újoin)rm   rÈ  ÚvalsÚ
fmt_valuesrt   Újoinedrê   s          rx   Ú_get_values_reprzCategorical._get_values_repr	  s‰   € Ý3ä�4‹y˜1Š}Ðˆ}à×(Ñ(Ó*ˆØ×%Ñ%ØØØØÜ$ð &ó 
ˆ
ñ *4Ó4© A�a—g‘g•i¨ˆ
Ð4Ø—‘˜:Ó&ˆØ�v‘ Ñ#ˆØˆùò 5s   ÁA9c                óD  — | j                  «       }t        | «      }d}||kD  rV|dz  }| d| j                  «       }| ||z
   d j                  «       }|dd › d|dd › �}dt        | «      › �}|› d|› d|› �}	|	S |d	kD  r| j                  «       }|› d|› �}	|	S d
}|› d|› �}	|	S )z(
        String representation.
        r¼  rÃ  NrV   z, ..., r�   zLength: rÓ  r   z[]rÐ  )rå  rY   rî  )
rm   ÚfooterÚlengthÚmax_lenrÉ  rÊ  rË  ÚbodyÚlength_inforê   s
             rx   Ú__repr__zCategorical.__repr__1	  s÷   € ð ×&Ñ&Ó(ˆÜ�T“ˆØˆØ�GÒð ˜Q‘,ˆCØ˜˜�:×.Ñ.Ó0ˆDØ˜' C™-Ð(Ð*Ð+×<Ñ<Ó>ˆDØ˜3˜B�i�[ ¨¨Q¨R¨ zÐ2ˆDØ$¤S¨£Y KÐ0ˆKØ�v˜R ˜}¨B¨v¨hÐ7ˆFð ˆð �aŠZØ×(Ñ(Ó*ˆDØ�v˜R ˜xÐ(ˆFð ˆð ˆDØ�v˜R ˜xÐ(ˆFàˆrz   c                ó  — t        |d¬«      }t        |t        «      rA| j                  |j                  k7  rt	        d«      ‚| j                  |«      }|j                  S ddlm}  |j                  |dd¬«      j                  | j                  «      }t        |«      r$t        |«      j                  «       st	        d«      ‚| j                  j                  |«      }|j!                  | j"                  j                  d¬	«      S )
NT)Úextract_numpyzCCannot set a Categorical with another, without identical categoriesr   rŸ   F)Útupleize_colsrU   zMCannot setitem on a Categorical with a new category, set the categories firstrT   )r7   r]   r^   ri   r\   Ú_encode_with_my_categoriesrd   rŽ   rK   Ú_with_inferr&  r`   rY   r*   r×   Úget_indexerrÛ   rÌ   )rm   r  rK   Úto_addrc   s        rx   rH  zCategorical._validate_listlikeN	  sâ   € ä˜e°4Ô8ˆô �eœ[Ô)Ø�z‰z˜UŸ[™[Ò(Üð3óð ð
 ×3Ñ3°EÓ:ˆEØ—<‘<Ðå ð #�×"Ñ" 5¸ÀEÔJ×UÑUØ�O‰Oó
ˆô ˆvŒ;œt F›|×/Ñ/Ô1Üð5óð ð
 —‘×+Ñ+¨EÓ2ˆØ�|‰|˜DŸM™M×/Ñ/°eˆ|Ó<Ð<rz   c                ó$  ‡— | j                   }t        j                  t        | j                  «      |j
                  «      \  Š}t        |«      j                  «       }ˆfd„t        j                  |«      D «       }t        t        ||d¬«      «      S )a¡  
        Compute the inverse of a categorical, returning
        a dict of categories -> indexers.

        *This is an internal function*

        Returns
        -------
        Dict[Hashable, np.ndarray[np.intp]]
            dict of categories -> indexers

        Examples
        --------
        >>> c = pd.Categorical(list("aabca"))
        >>> c
        ['a', 'a', 'b', 'c', 'a']
        Categories (3, str): ['a', 'b', 'c']
        >>> c.categories
        Index(['a', 'b', 'c'], dtype='str')
        >>> c.codes
        array([0, 0, 1, 2, 0], dtype=int8)
        >>> c._reverse_indexer()
        {'a': array([0, 1, 4]), 'b': array([2]), 'c': array([3])}

        c              3  ó.   •K  — | ]  \  }}‰|| –— Œ y ­wr�   r‚   )rƒ   rß  ÚendÚrs      €rx   r†   z/Categorical._reverse_indexer.<locals>.<genexpr>Ž	  s   øè ø€ ÐMÑ2L¡J E¨3�1�U˜3”<Ñ2Lùs   ƒT)Ústrict)r`   ÚlibalgosÚgroupsort_indexerr   rc   r7  r   ÚcumsumÚ	itertoolsÚpairwisera  Úzip)rm   r`   ÚcountsÚ_resultr   s       @rx   Ú_reverse_indexerzCategorical._reverse_indexero	  sr   ø€ ð4 —_‘_ˆ
Ü×.Ñ.Ü §
¡
Ó+¨Z¯_©_ó
‰	ˆˆ6ô ˜fÓ%×,Ñ,Ó.ˆÛM´)×2DÑ2DÀVÔ2LÓMˆÜ”C˜
 G°DÔ9Ó:Ð:rz   ©ÚskipnaÚkeepdimsc               óx   •— t        ‰| �  |f||dœ|¤Ž}|dv r|S |r t        | «      || j                  ¬«      S |S )Nr  )ÚargmaxÚargminrœ   )r–   Ú_reducerh   ri   )rm   rr  r  r  r\  rê   r™   s         €rx   r  zCategorical._reduce”	  sL   ø€ ô ‘‘ ÐR¨f¸xÑRÈ6ÑRˆØÐ'Ñ'àˆMÙØ”4˜“:˜f¨D¯J©JÔ7Ð7àˆMrz   )r  c               ó  — t        j                  |j                  dd«      «       t        j                  d|«       | j	                  d«       t        | j                  «      s| j                  j                  S | j                  dk7  }|j                  «       s@|r.|j                  «       r| j                  |   j                  «       }n*t        j                  S | j                  j                  «       }| j                  d|«      S )a/  
        The minimum value of the object.

        Only ordered `Categoricals` have a minimum!

        Raises
        ------
        TypeError
            If the `Categorical` is not `ordered`.

        Returns
        -------
        min : the minimum of this `Categorical`, NA value if empty
        r˜  r   r‚   rO  rV   N)ÚnvÚvalidate_minmax_axisr!  Úvalidate_minr…  rY   rd   ri   Úna_valuer×   re   rO  rk   r?  Ú_wrap_reduction_result©rm   r  r\  ÚgoodÚpointers        rx   rO  zCategorical.min 	  óº   € ô 	×Ñ §
¡
¨6°1Ó 5Ô6Ü
�‰˜˜FÔ#Ø×Ñ˜uÔ%ä�4—;‘;ÔØ—:‘:×&Ñ&Ð&à�{‰{˜bÑ ˆØ�x‰xŒzÙ˜$Ÿ(™(œ*ØŸ+™+ dÑ+×/Ñ/Ó1‘ä—v‘v�à—k‘k—o‘oÓ'ˆGØ×*Ñ*¨4°Ó9Ð9rz   c               ó  — t        j                  |j                  dd«      «       t        j                  d|«       | j	                  d«       t        | j                  «      s| j                  j                  S | j                  dk7  }|j                  «       s@|r.|j                  «       r| j                  |   j                  «       }n*t        j                  S | j                  j                  «       }| j                  d|«      S )a2  
        The maximum value of the object.

        Only ordered `Categoricals` have a maximum!

        Raises
        ------
        TypeError
            If the `Categorical` is not `ordered`.

        Returns
        -------
        max : the maximum of this `Categorical`, NA if array is empty
        r˜  r   r‚   rN  rV   N)r  r  r!  Úvalidate_maxr…  rY   rd   ri   r  r×   re   rN  rk   r?  r  r  s        rx   rN  zCategorical.maxÀ	  r  rz   c                ó  — | j                   }d }|r| j                  «       }t        j                  ||¬«      \  }}t	        t
        j                  |«      }|j                  |j                  k(  sJ ‚| j                  |«      }|S )N)rs   )	rd   r*   r+   Úmoder
   rk   r¬   ri   rv  )rm   r1  rc   rs   Ú	res_codesrÜ  rØ   s          rx   Ú_modezCategorical._modeà	  sm   € Ø—‘ˆØˆÙØ—9‘9“;ˆDä!—‘ u°4Ô8‰ˆ	�1ÜœŸ™ YÓ/ˆ	Ø�‰ %§+¡+Ò-Ð-Ð-Ø×%Ñ% iÓ0ˆØˆ
rz   c                ó    •— t         ‰| �  «       S )ae  
        Return the ``Categorical`` which ``categories`` and ``codes`` are
        unique.

        Returns
        -------
        Categorical

        See Also
        --------
        pandas.unique
        CategoricalIndex.unique
        Series.unique : Return unique values of Series object.

        Examples
        --------
        >>> pd.Categorical(list("baabc")).unique()
        ['b', 'a', 'c']
        Categories (3, str): ['a', 'b', 'c']
        >>> pd.Categorical(list("baab"), categories=list("abc"), ordered=True).unique()
        ['b', 'a']
        Categories (3, str): ['a' < 'b' < 'c']
        )r–   r0  )rm   r™   s    €rx   r0  zCategorical.uniqueï	  s   ø€ ô0 ‰w‰~ÓÐrz   rž   c                ó¾   — t        |t        «      sy| j                  |«      r;| j                  |«      }t	        j
                  | j                  |j                  «      S y)z²
        Returns True if categorical arrays are equal.

        Parameters
        ----------
        other : `Categorical`

        Returns
        -------
        bool
        F)r]   r^   r_   rù  rk   Úarray_equalrd   ©rm   rn   s     rx   ra   zCategorical.equals	
  sK   € ô ˜%¤Ô-ØØ×5Ñ5°eÔ<Ø×3Ñ3°EÓ:ˆEÜ—>‘> $§+¡+¨u¯|©|Ó<Ð<Ørz   c                óh  — |dk(  rt         j                  j                  }n:|dk(  rt         j                  j                  }nt	        d|› dt        | «      › �«      ‚| j                  |«       | j                  j                  «       }| j                  «       }|t         j                  j                  k(  r6t        j                  |j                  j
                  «      j                  ||<   |st         j                  j                  |«      } ||«      }d||<   | j                  || j                  ¬«      S )NÚcumminÚcummaxzAccumulation z not supported for rV   rœ   )rk   ÚminimumÚ
accumulateÚmaximumr\   rh   r…  rc   rU   r*   Úiinfori   rN  r—   r’   )rm   rr  r  r\  ry   rc   rs   s          rx   Ú_accumulatezCategorical._accumulate
  sí   € à�8ÒÜ—:‘:×(Ñ(‰DØ�XÒÜ—:‘:×(Ñ(‰Dä˜m¨D¨6Ð1DÄTÈ$ÃZÀLÐQÓRÐRØ×Ñ˜tÔ$à—
‘
—‘Ó!ˆØ�y‰y‹{ˆØ”2—:‘:×(Ñ(Ò(ÜŸ(™( 5§;¡;×#3Ñ#3Ó4×8Ñ8ˆE�$‰KáÜ—:‘:×(Ñ(¨Ó.ˆDá�U“ˆØˆˆd‰Ø×Ñ ¨T¯[©[ÐÓ9Ð9rz   c           	     ó²  — ddl m} |d   }||j                  k\  rt        d|› d|j                  › �«      ‚|dk(  r�t	        d„ |D «       «      st        ‚g }|D ]>  }|j                  t        |j                  d   «      D �cg c]  }|d d …|f   ‘Œ c}«       Œ@ | j                  |d¬«      }|j                  t        |«      dd	¬
«      }	|	S  ||«      }	|	S c c}w )Nr   )Úunion_categoricalszaxis z) is out of bounds for array of dimension r�   c              3  ó:   K  — | ]  }|j                   d k(  –— Œ y­w)rÃ  N)r­   )rƒ   rÍ  s     rx   r†   z0Categorical._concat_same_type.<locals>.<genexpr>>
  s   è ø€ Ð6©I q�q—v‘v •{©Iùs   ‚)r˜  rV   ÚF)Úorder)Úpandas.core.dtypes.concatr/  r­   rZ   r×   Úextendr§   r»   Ú_concat_same_typeÚreshaperY   )
r˜   Ú	to_concatr˜  r/  r“  Útc_flatÚobjrt   Úres_flatrê   s
             rx   r5  zCategorical._concat_same_type2
  sê   € å@à˜!‘ˆØ�5—:‘:ÒÜØ˜�vÐFÀuÇzÁzÀlÐSóð ð �1Š9äÑ6©IÓ6Ô6Ü Ð ð ˆGÛ �Ø—‘´5¸¿¹À1¹Ô3FÓGÑ3F¨a ¢A q D£	Ð3FÑGÕHð !ð ×,Ñ,¨W¸1Ð,Ó=ˆHà×%Ñ%¤c¨%£j°"¸CÐ%Ó@ˆFØˆMñ $ IÓ.ˆØˆùò  Hs   Á?C
c                ó~   — t        |j                  |j                  | j                  d¬«      }| j                  |«      S )z×
        Re-encode another categorical using this Categorical's categories.

        Notes
        -----
        This assumes we have already checked
        self._categories_match_up_to_permutation(other).
        FrT   )rb   rc   r`   rv  )rm   rn   rc   s      rx   rù  z&Categorical._encode_with_my_categoriesR
  s8   € ô &Ø�K‰K˜×)Ñ)¨4¯?©?Àô
ˆð ×&Ñ& uÓ-Ð-rz   c                óX   — t        | j                  «      t        |j                  «      k(  S )zÞ
        Returns True if categoricals are the same dtype
          same categories, and same ordered

        Parameters
        ----------
        other : Categorical

        Returns
        -------
        bool
        )r‡   ri   r%  s     rx   r_   z/Categorical._categories_match_up_to_permutationc
  s!   € ô �D—J‘JÓ¤4¨¯©Ó#4Ñ4Ð4rz   c                óÂ   — | j                  d¬«      }||j                  «       z  }ddlm} ddlm}  |||gdd¬«      } |d	d
g«      |_        d|j                  _        |S )z­
        Describes this Categorical

        Returns
        -------
        description: `DataFrame`
            A dataframe with frequency and counts by category.
        F)r1  r   rŸ   )ÚconcatTr�   )Úignore_indexr˜  r  Úfreqsr`   )	r}  ÚsumrŽ   rK   Úpandas.core.reshape.concatr>  Úcolumnsrq  rr  )rm   r  r@  rK   r>  rê   s         rx   ÚdescribezCategorical.describer
  sa   € ð ×"Ñ"¨%Ð"Ó0ˆØ˜Ÿ™›Ñ%ˆå Ý5á˜ ˜°dÀÔCˆÙ ¨'Ð2Ó3ˆŒØ(ˆ�‰Ôàˆrz   c                óÊ   — t        j                  t        |«      «      }| j                  j	                  |«      }|||dk\  z     }t        j                  | j                  |«      S )a˜  
        Check whether `values` are contained in Categorical.

        Return a boolean NumPy Array showing whether each element in
        the Categorical matches an element in the passed sequence of
        `values` exactly.

        Parameters
        ----------
        values : np.ndarray or ExtensionArray
            The sequence of values to test. Passing in a single string will
            raise a ``TypeError``. Instead, turn a single string into a
            list of one element.

        Returns
        -------
        np.ndarray[bool]

        Raises
        ------
        TypeError
          * If `values` is not a set or list-like

        See Also
        --------
        pandas.Series.isin : Equivalent method on Series.

        Examples
        --------
        >>> s = pd.Categorical(["llama", "cow", "llama", "beetle", "llama", "hippo"])
        >>> s.isin(["cow", "llama"])
        array([ True,  True,  True, False,  True, False])

        Passing a single string as ``s.isin('llama')`` will raise an error. Use
        a list of one element instead:

        >>> s.isin(["llama"])
        array([ True, False,  True, False,  True, False])
        r   )rk   ræ   r*   r`   Úget_indexer_forr+   rù   rc   )rm   r½   r¾   Úcode_valuess       rx   rù   zCategorical.isin‡
  sT   € ôP —J‘Jœt F›|Ó,ˆ	Ø—o‘o×5Ñ5°fÓ=ˆØ! )¨{¸aÑ/?Ñ"@ÑAˆÜ�‰˜tŸz™z¨;Ó7Ð7rz   c                ó¢  — | j                   }| j                  }|j                  dk(  rn|j                  j	                  |||«      }|j                  j
                  t        j                  u rXt        |«      rM|t        j                  u st        |«      r0d}n-ddlm}  ||j                  «       «      j	                  |||«      }t        |||¬«      S )NrÀ  Fr   ©ÚNumpyExtensionArrayrã   )r`   rc   ri   rl   Ú_str_mapr  rk   r?  r   r   Ú
no_defaultr*   Úpandas.core.arraysrJ  r·   r1   )	rm   Úfr  ri   Úconvertr`   rc   rê   rJ  s	            rx   rK  zCategorical._str_map¶
  s°   € ð —_‘_ˆ
Ø—
‘
ˆØ×Ñ˜xÒ'Ø×%Ñ%×.Ñ.¨q°(¸EÓBˆFà× Ñ ×)Ñ)¬R¯V©VÑ3Ü! %Ô(Ø¤§¡Ñ/´4¸´>ð !‘å>á(¨×)<Ñ)<Ó)>Ó?×HÑHØ�8˜UóˆFô �v˜u°Ô:Ð:rz   c                óh   — ddl m}  || j                  t        d¬«      «      j	                  ||«      S )Nr   rI  rç  )r  )rM  rJ  r·   r¿  Ú_str_get_dummies)rm   râ  ri   rJ  s       rx   rQ  zCategorical._str_get_dummiesÏ
  s/   € å:á" 4§=¡=´¸u =Ó#EÓF×WÑWØ�ó
ð 	
rz   c          	     óŽ  — ddl m} |j                  |«      } ||||¬«      }	| j                  }
|dv rt	        |
› d|› d�«      ‚|dv r|
j
                  st	        d|› d	�«      ‚|d
vr'|dk(  rt	        |
› d|› d�«      ‚t	        |
› d|› d�«      ‚d }| j                  «       }|dk(  r| j
                  sJ ‚| j                  }nA|dv r(| j                  }t        j                  |t        ¬«      }n| j                  t        «      } |	j                  |f|||||dœ|¤Ž}||	j                  v r|S |dv rd||dk(  <   | j                  |«      S )Nr   )ÚWrappedCythonOp)Úhowrå   Úhas_dropped_na)rA  Úprodr  ÚcumprodÚskewÚkurtz type does not support z operations)rO  rN  r�  ÚidxminÚidxmaxzCannot perform z with non-ordered Categorical)	r�  re   r×   r“  r‘  rO  rN  rZ  r[  Ú	transformz% dtype does not support aggregation 'Ú'r�  )r“  r‘  rO  rN  rZ  r[  rœ   )Ú	min_countÚngroupsÚcomp_idsrs   Úresult_mask)r“  r‘  rO  rN  rV   r�   )Úpandas.core.groupby.opsrS  Úget_kind_from_howri   r\   r[   r*   rÌ   rk   r  r¶  rÛ   Ú_cython_op_ndim_compatÚcast_blocklistrv  )rm   rT  rU  r^  r_  Úidsr\  rS  rå   rv   ri   ra  rs   ÚnpvaluesÚ
res_valuess                  rx   Ú_groupby_opzCategorical._groupby_opÚ
  s�  € õ 	<à×0Ñ0°Ó5ˆÙ ¨4ÀÔOˆà—
‘
ˆØÐFÑFÜ˜u˜gÐ%<¸S¸EÀÐMÓNÐNØÐ<Ñ<ÀUÇ]Â]ô ˜o¨c¨UÐ2OÐPÓQÐQØð 

ñ 

ð �{Ò"Ü 5 'Ð)@ÀÀÀ[Ð QÓRÐRÜ˜u˜gÐ%JÈ3È%ÈqÐQÓRÐRàˆØ�y‰y‹{ˆØ�&Š=Ø—<’<Ð�<Ø—}‘}‰HØÐGÑGØ—}‘}ˆHÜŸ(™( 7´$Ô7‰Kð —{‘{¤4Ó(ˆHà.�R×.Ñ.Øð
àØØØØ#ñ
ð ñ
ˆ
ð �"×#Ñ#Ñ#ØÐØÐ3Ñ3Ø+-ˆJ�{ aÑ'Ñ(Ø×&Ñ& zÓ2Ð2rz   )rc   ú
np.ndarrayri   r$   Úreturnr	   )NNNT)ri   úDtype | NonerU   r¶  rk  ÚNone)rk  r$   )rk  Úint)ri   rl  rU   r¶  rk  r	   )rk  rA   ).)ri   znpt.DTypeLikerU   r¶  rk  rj  )ri   r&   rU   r¶  rk  r4   )ri   rB   rU   r¶  rk  rA   )Tr�   )rk  r	   )ri   rl  r  r¶  rk  r	   )rk  rK   )rk  rF   )rk  rj  )F)r  r¶  rk  rm  )ri   r$   rU   r¶  rk  r	   )r  r¶  rk  r	   )NF)r  r¶  rk  r	   )rD  zLiteral['ignore'] | None)ri   r$   rk  rj  )NN)ri   úNpDtype | NonerU   zbool | Nonerk  rj  )rY  znp.ufuncrZ  r¿  ©rk  rm  )rh  r¶  rk  rn  )rk  únpt.NDArray[np.bool_])r1  r¶  rk  rL   )r»   rG   ri   r$   rk  r	   )rˆ  r¶  rå   rH   rk  únpt.NDArray[np.intp])r‹  zLiteral[False]rˆ  r¶  rŒ  r¿  rk  r	   )r‹  zLiteral[True]rˆ  r¶  rŒ  r¿  rk  rm  )r‹  r¶  rˆ  r¶  rŒ  r¿  rk  zSelf | None)
r˜  rC   rZ  r¿  r™  r¿  rˆ  r¶  rš  r¶  )r¨  r¿  r©  r¿  r¤  r¶  rk  znpt.NDArray[np.uint64])rt   rn  )rk  r?   ©rk  r¶  )r¹  r¶  rk  rm  )rk  z	list[str])rk  r¿  )rk  z$dict[Hashable, npt.NDArray[np.intp]])rr  r¿  r  r¶  r  r¶  )r  r¶  )r1  r¶  rk  r^   )rn   rž   rk  r¶  )rr  r¿  r  r¶  rk  r	   )r   )r7  zSequence[Self]r˜  rC   rk  r	   )rn   r^   rk  r^   )rn   r^   rk  r¶  )rk  rJ   )r½   rA   rk  rq  )rO  r¶  )Ú|N)râ  r¿  ri   ro  )
rT  r¿  rU  r¶  r^  rn  r_  rn  rf  rr  )hr{   Ú
__module__Ú__qualname__Ú__doc__Ú__array_priority__r6   Ú_hidden_attrsÚ	frozensetÚ_typÚ__annotations__Úclassmethodr—   r¼   Úpropertyri   rÍ   rÐ   rÓ   r   rÛ   r  r  r`   r[   rc   r  rä   r  r  r  r  r$  r(  r.  r4  r;  r>  r~   r|   ÚeqrW   r}   rX   ÚltrP   ÚgtrQ   ÚlerR   ÚgerS   rJ  rI  r  r3   rQ  r]  rb  rf  ri  r*   Úisnullrl  Únotnullr}  r�  rƒ  r…  rŠ  rû   rŸ  rœ  r«  rd   r®  rf   r´  r·  rº  rÎ  rå  rî  rõ  rH  r
  r  rO  rN  r!  r0  ra   r-  r5  rù  r_   rD  rù   r   rL  rk   rK  rQ  ri  Ú__classcell__)r™   s   @rx   r^   r^   ù   sê  ø… ñqðj Ðà ×.Ñ.±¸H¸:Ó1FÑF€MØ€DàÓàð1Øð1Ø'7ð1à	ô1ó	 ð1ð ØØ"Øð%ð
 ð%ð ð%ð 
õ%ðB òó ðð( òó ðð à/3À%ñ4Ø ,ð4Ø;?ð4à	ò4ó ð4õ
ð ÛOó ØOàÛTó ØTàÛJó ØJöDðL àEIðF3à	òF3ó ðF3ðP ð ØØ"ØðG3ð
 ðG3ð ðG3ð 
òG3ó ðG3ðX ò7%ó ð7%ðr ò+"ó ð+"ðZ ò(ó ð(öT#3óJ:ó$ó!&óF"'ðJ <AðmØ48ðmà	ómó^Lô\IDóVCóJ:Wóx3ðt /3ðm4ð ,óm4ñ^ ˜XŸ[™[Ó)€FÙ˜XŸ[™[Ó)€FÙ˜XŸ[™[Ó)€FÙ˜XŸ[™[Ó)€FÙ˜XŸ[™[Ó)€FÙ˜XŸ[™[Ó)€Fò
0òð: òó ðð" à@Dð1,Ø#ð1,Ø2=ð1,à	ò1,ó ð1,óf
õ:$ð òHó ðHôRó2!ð& €Fóð( €Gô,
ðb ð/Øð/Ø"2ð/à	ò/ó ð/ó(ó.ð $(¸+ñ3IØ ð3IØ/7ð3Ià	õ3Iðj ð #&ØØñð  ðð ð	ð
 ðð 
òó ðð à;>ÐSVñØ'ðØ48ðØMPðà	òó ðð ØØ!ñSð ðSð ð	Sð
 ðSð 
óSðp ØØØØñ
ð ð
ð ð	
ð
 ð
ð ð
ð ó
ó0ð@)Øð)Ø*-ð)Ø;?ð)à	ó)ð\ òó ðó"ó
ó7ó:ôó óDIó:ó&ò:=óB ;ðL ,0À%ñ
Øð
Ø$(ð
Ø;?õ
ð %)õ :ð@ %)õ :ô@
õ ó4ô&:ð, óó ðó>.ó"5óó*+8ð` Ÿ.™.°°·±¸Ó0BÐTXð;ØMQó;ô2
ð@3ð ð@3ð ð	@3ð
 ð@3ð ð@3ð "÷@3rz   r^   r`   r[   r~  )ÚdelegateÚ	accessorsÚtyp)r$  r(  r.  r4  r;  r  r  r  rZ  c                  óT   — e Zd ZdZd	d„Zed	d„«       Zd
d„Zdd„Ze	dd„«       Z
d
d„Zy)ÚCategoricalAccessora  
    Accessor object for categorical properties of the Series values.

    Parameters
    ----------
    data : Series or CategoricalIndex
        The object to which the categorical accessor is attached.

    See Also
    --------
    Series.dt : Accessor object for datetimelike properties of the Series values.
    Series.sparse : Accessor for sparse matrix data types.

    Examples
    --------
    >>> s = pd.Series(list("abbccc")).astype("category")
    >>> s
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, str): ['a', 'b', 'c']

    >>> s.cat.categories
    Index(['a', 'b', 'c'], dtype='str')

    >>> s.cat.rename_categories(list("cba"))
    0    c
    1    b
    2    b
    3    a
    4    a
    5    a
    dtype: category
    Categories (3, str): ['c', 'b', 'a']

    >>> s.cat.reorder_categories(list("cba"))
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, str): ['c', 'b', 'a']

    >>> s.cat.add_categories(["d", "e"])
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (5, str): ['a', 'b', 'c', 'd', 'e']

    >>> s.cat.remove_categories(["a", "c"])
    0    NaN
    1      b
    2      b
    3    NaN
    4    NaN
    5    NaN
    dtype: category
    Categories (1, str): ['b']

    >>> s1 = s.cat.add_categories(["d", "e"])
    >>> s1.cat.remove_unused_categories()
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, str): ['a', 'b', 'c']

    >>> s.cat.set_categories(list("abcde"))
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (5, str): ['a', 'b', 'c', 'd', 'e']

    >>> s.cat.as_ordered()
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, str): ['a' < 'b' < 'c']

    >>> s.cat.as_unordered()
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, str): ['a', 'b', 'c']
    c                ó¬   — | j                  |«       |j                  | _        |j                  | _        |j
                  | _        | j                  «        y r�   )Ú	_validater½   Ú_parentrq  Ú_indexrr  Ú_nameÚ_freeze)rm   Údatas     rx   r¼   zCategoricalAccessor.__init__¡  s8   € Ø�‰�tÔØ—{‘{ˆŒØ—j‘jˆŒØ—Y‘YˆŒ
Ø�‰�rz   c                óN   — t        | j                  t        «      st        d«      ‚y )Nz2Can only use .cat accessor with a 'category' dtype)r]   ri   r$   ÚAttributeError)r’  s    rx   r�  zCategoricalAccessor._validate¨  s"   € ä˜$Ÿ*™*Ô&6Ô7Ü Ð!UÓVÐVð 8rz   c                ó.   — t        | j                  |«      S r�   )rj   rŽ  )rm   rr  s     rx   Ú_delegate_property_getz*CategoricalAccessor._delegate_property_get­  s   € Ü�t—|‘| TÓ*Ð*rz   c                ó2   — t        | j                  ||«       y r�   )ÚsetattrrŽ  )rm   rr  Ú
new_valuess      rx   Ú_delegate_property_setz*CategoricalAccessor._delegate_property_set°  s   € Ü�—‘˜d JÕ/rz   c                ó^   — ddl m}  || j                  j                  | j                  ¬«      S )a9  
        Return Series of codes as well as the index.

        See Also
        --------
        Series.cat.categories : Return the categories of this categorical.
        Series.cat.as_ordered : Set the Categorical to be ordered.
        Series.cat.as_unordered : Set the Categorical to be unordered.

        Examples
        --------
        >>> raw_cate = pd.Categorical(["a", "b", None, "a"], categories=["a", "b"])
        >>> ser = pd.Series(raw_cate)
        >>> ser.cat.codes
        0   0
        1   1
        2  -1
        3   0
        dtype: int8
        r   r*  )rq  )rŽ   rL   rŽ  rc   r�  )rm   rL   s     rx   rc   zCategoricalAccessor.codes³  s"   € õ, 	"á�d—l‘l×(Ñ(°·±Ô<Ð<rz   c                óŽ   — ddl m} t        | j                  |«      } ||i |¤Ž}|� ||| j                  | j
                  ¬«      S y )Nr   r*  )rq  rr  )rŽ   rL   rj   rŽ  r�  r�  )rm   rr  Úargsr\  rL   rZ  rØ   s          rx   Ú_delegate_methodz$CategoricalAccessor._delegate_methodÍ  sE   € Ý!ä˜Ÿ™ tÓ,ˆÙ�dÐ%˜fÑ%ˆØˆ?Ù˜# T§[¡[°t·z±zÔBÐBð rz   Nrp  )rr  r¿  )rr  r¿  rk  rm  )rk  rL   )r{   ru  rv  rw  r¼   Ústaticmethodr�  r–  rš  r~  rc   rž  r‚   rz   rx   r‹  r‹     sH   „ ñ$mó^ð òWó ðWó+ó0ð ò=ó ð=ô2Crz   r‹  c                óÈ   — |j                  | «      }|dk(  t        | «       z  }|j                  «       r$t        j                  dt
        t        «       ¬«       t        ||«      S )z¤
    utility routine to turn values into codes given the specified categories

    If `values` is known to be a Categorical, use recode_for_categories instead.
    rV   rß   rà   )rF  r*   re   rÔ   r¥   r   r   r   )r½   r`   rc   rë   s       rx   r¹   r¹   Ù  s\   € ð ×&Ñ& vÓ.€EØ�b‰[œT &›\˜MÑ)€EØ‡y�y„{Ü�‰ð2ô Ü'Ó)õ	
ô    zÓ2Ð2rz   TFr¤   c               ó`  — t        |«      dk(  r|r| j                  «       S | S |j                  |«      r|r| j                  «       S | S |j                  |«      }|r9|dk(  }|j	                  «       r$t        j                  dt        t        «       ¬«       t        ||«      }t        || d¬«      }|S )a{  
    Convert a set of codes for to a new set of categories

    Parameters
    ----------
    codes : np.ndarray
    old_categories, new_categories : Index
    copy: bool, default True
        Whether to copy if the codes are unchanged.
    warn : bool, default False
        Whether to warn on silent-NA mapping.

    Returns
    -------
    new_codes : np.ndarray[np.int64]

    Examples
    --------
    >>> old_cat = pd.Index(["b", "a", "c"])
    >>> new_cat = pd.Index(["a", "b"])
    >>> codes = np.array([0, 1, 1, 2])
    >>> recode_for_categories(codes, old_cat, new_cat, copy=True)
    array([ 1,  0,  0, -1], dtype=int8)
    r   rV   rß   rà   rã   )rY   rU   ra   rF  re   rÔ   r¥   r   r   r   r1   )	rc   Úold_categoriesr  rU   r¥   Úcodes_in_old_catsrë   Úindexerr:  s	            rx   rb   rb   ï  s®   € ô@ ˆ>Ó˜aÒáØ—:‘:“<ÐØˆØ	×	Ñ	˜~Ô	.áØ—:‘:“<ÐØˆà&×6Ñ6°~ÓFÐÙØ! RÑ'ˆØ�9‰9Œ;Ü�M‰Mð6ô Ü+Ó-õô #Ð#4°nÓE€GÜ˜ °2Ô6€IØÐrz   c                óÌ  — ddl m} t        | «      st        d«      ‚t	        | dd«      }t        |t        «      rƒt        | «      } t        j                  t        | j                  «      | j                  j                  ¬«      }t        j                  || j                  d¬«      } ||«      }| j                  }||fS t        | d¬	«      }|j                  }|j                  }||fS )
az  
    Factorize an input `values` into `categories` and `codes`. Preserves
    categorical dtype in `categories`.

    Parameters
    ----------
    values : list-like

    Returns
    -------
    codes : ndarray
    categories : Index
        If `values` has a categorical dtype, then `categories` is
        a CategoricalIndex keeping the categories and order of `values`.
    r   )rn  zInput must be list-likeri   Nrœ   Fr=  r”   )rŽ   rn  r   r\   rj   r]   r$   r7   rk   rs  rY   r`   rc   ri   r^   r  )r½   rn  r¿   Ú	cat_codesrŠ   r`   rc   s          rx   Úfactorize_from_iterabler§  *  sÍ   € õ  (ä˜ÔÜÐ1Ó2Ð2ô �V˜W dÓ+€FÜ�&Ô*Ô+Ü˜vÓ&ˆô —I‘Iœc &×"3Ñ"3Ó4¸F¿L¹L×<NÑ<NÔOˆ	Ü×$Ñ$ Y°f·l±lÈUÐ$ÓSˆá% cÓ*ˆ
Ø—‘ˆð �*ÐÐô ˜&¨%Ô0ˆØ—^‘^ˆ
Ø—	‘	ˆØ�*ÐÐrz   c                ó|   — t        | «      dk(  rg g fS t        d„ | D «       ddiŽ\  }}t        |«      t        |«      fS )a$  
    A higher-level wrapper over `factorize_from_iterable`.

    Parameters
    ----------
    iterables : list-like of list-likes

    Returns
    -------
    codes : list of ndarrays
    categories : list of Indexes

    Notes
    -----
    See `factorize_from_iterable` for more info.
    r   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr�   )r§  )rƒ   Úits     rx   r†   z+factorize_from_iterables.<locals>.<genexpr>k  s   è ø€ Ð	:±	¨"Ô
! "×
%±	ùs   ‚r  T)rY   r  r«   )Ú	iterablesrc   r`   s      rx   Úfactorize_from_iterablesr¬  U  sN   € ô" ˆ9ƒ~˜Òà�2ˆvˆäÙ	:±	Ó	:ðàñÑ€Eˆ:ô �‹;œ˜ZÓ(Ð(Ð(rz   rs  )r½   z,Index | Series | ExtensionArray | np.ndarrayr`   rK   rk  rj  )rc   rj  rU   r¶  r¥   r¶  rk  rj  )rk  ztuple[np.ndarray, Index])rk  z$tuple[list[np.ndarray], list[Index]])|Ú
__future__r   Úcsvr   Ú	functoolsr   r  r|   Úshutilr   Útypingr   r   r	   r
   r   rÔ   Únumpyrk   Úpandas._configr   Úpandas._libsr   r   r  r   Úpandas._libs.arraysr   Úpandas.compat.numpyr   r  Úpandas.errorsr   Úpandas.util._decoratorsr   Úpandas.util._exceptionsr   Úpandas.util._validatorsr   Úpandas.core.dtypes.castr   r   Úpandas.core.dtypes.commonr   r   r   r   r   r   r   r   r    r!   r"   Úpandas.core.dtypes.dtypesr#   r$   r%   r&   Úpandas.core.dtypes.genericr'   r(   Úpandas.core.dtypes.missingr)   r*   Úpandas.corer+   r,   r-   Úpandas.core.accessorr.   r/   Úpandas.core.algorithmsr0   r1   Úpandas.core.arrays._mixinsr2   r3   Úpandas.core.baser4   r5   r6   Úpandas.core.commonÚcoreÚcommonr©   Úpandas.core.constructionr7   r8   Úpandas.core.ops.commonr9   Úpandas.core.sortingr:   Ú pandas.core.strings.object_arrayr;   rÄ  r<   Úcollections.abcr=   r>   r?   r@   Úpandas._typingrA   rB   rC   rD   rE   rF   rG   rH   rI   rŽ   rJ   rK   rL   r~   r�   r^   r‹  r¹   rb   r§  r¬  r‚   rz   rx   Ú<module>rÎ     sÅ  ðÝ "å  Ý Û Û Ý $÷õ ó ã å %÷ñ õ
 .Ý .Ý (Ý .Ý 4Ý 7÷÷÷ ÷ ñ ÷ó ÷÷÷
ñ ÷
÷÷÷ñ ÷
 !Ð  ÷õ <Ý (Ý Cå %á÷ó ÷
÷ 
õ 
÷ñ òFóR06ñf ˆHÓô`(3Ð-¨|Ð=Só `(3ó ð`(3ñLQ Ø \°9Ð$=À:ôñ Øò	ð 	ôôbC˜.¨,Ð8Ló bCóóð"bCðP3Ø8ð3àð3ð ó3ð6 Øñ8Øð8ð
 ð8ð ð8ð ó8óv(ôV)rz   