
    `Vg              	         U d dl mZ d dlZd dlmZ d dlmZ d dlm	Z	m
Z
  G d de
      Z G d d	e	      Zd
Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Ze G d de             Z e        e        e        e        e        e        e        e       dZded<   y)    )annotationsN)register_extension_dtype)is_integer_dtype)NumericArrayNumericDtypec                      e Zd ZdZ ej
                  ej                        ZeZ	e
dd       Ze
d        Ze
dd       Zy)IntegerDtypea&  
    An ExtensionDtype to hold a single size & kind of integer dtype.

    These specific implementations are subclasses of the non-public
    IntegerDtype. For example we have Int8Dtype to represent signed int 8s.

    The attributes name & type are set when these subclasses are created.
    c                    t         S )zq
        Return the array type associated with this dtype.

        Returns
        -------
        type
        )IntegerArrayclss    [/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/pandas/core/arrays/integer.pyconstruct_array_typez!IntegerDtype.construct_array_type   s
         c                    t         S )N)INT_STR_TO_DTYPEr   s    r   _str_to_dtype_mappingz"IntegerDtype._str_to_dtype_mapping&   s    r   c           	        	 |j                  |d|      S # t        $ ra}|j                  ||      }||k(  j                         r|cY d}~S t        d|j                   dt	        j                  |             |d}~ww xY w)z
        Safely cast the values to the given dtype.

        "safe" in this context means the casting is lossless. e.g. if 'values'
        has a floating dtype, each value must be an integer.
        safe)castingcopy)r   Nz"cannot safely cast non-equivalent z to )astype	TypeErroralldtypenp)r   valuesr   r   errcasteds         r   
_safe_castzIntegerDtype._safe_cast*   s    		==T=BB 	]]5t]4F& %%'4V\\N$rxxPUFWX	s     	B 'A;B /A;;B N)returnztype[IntegerArray])r   
np.ndarrayr   znp.dtyper   boolr!   r"   )__name__
__module____qualname____doc__r   r   int64_default_np_dtyper   _checkerclassmethodr   r   r     r   r   r	   r	      s]     !*H       r   r	   c                       e Zd ZdZeZdZdZdZy)r   a>  
    Array of integer (optional missing) values.

    .. versionchanged:: 1.0.0

       Now uses :attr:`pandas.NA` as the missing value rather
       than :attr:`numpy.nan`.

    .. warning::

       IntegerArray is currently experimental, and its API or internal
       implementation may change without warning.

    We represent an IntegerArray with 2 numpy arrays:

    - data: contains a numpy integer array of the appropriate dtype
    - mask: a boolean array holding a mask on the data, True is missing

    To construct an IntegerArray from generic array-like input, use
    :func:`pandas.array` with one of the integer dtypes (see examples).

    See :ref:`integer_na` for more.

    Parameters
    ----------
    values : numpy.ndarray
        A 1-d integer-dtype array.
    mask : numpy.ndarray
        A 1-d boolean-dtype array indicating missing values.
    copy : bool, default False
        Whether to copy the `values` and `mask`.

    Attributes
    ----------
    None

    Methods
    -------
    None

    Returns
    -------
    IntegerArray

    Examples
    --------
    Create an IntegerArray with :func:`pandas.array`.

    >>> int_array = pd.array([1, None, 3], dtype=pd.Int32Dtype())
    >>> int_array
    <IntegerArray>
    [1, <NA>, 3]
    Length: 3, dtype: Int32

    String aliases for the dtypes are also available. They are capitalized.

    >>> pd.array([1, None, 3], dtype='Int32')
    <IntegerArray>
    [1, <NA>, 3]
    Length: 3, dtype: Int32

    >>> pd.array([1, None, 3], dtype='UInt16')
    <IntegerArray>
    [1, <NA>, 3]
    Length: 3, dtype: UInt16
       r   N)	r$   r%   r&   r'   r	   
_dtype_cls_internal_fill_value_truthy_value_falsey_valuer,   r   r   r   r   >   s"    AF J MMr   r   z
An ExtensionDtype for {dtype} integer data.

.. versionchanged:: 1.0.0

   Now uses :attr:`pandas.NA` as its missing value,
   rather than :attr:`numpy.nan`.

Attributes
----------
None

Methods
-------
None
c                  L    e Zd Zej                  ZdZej                  d      Z	y)	Int8DtypeInt8int8r   N)
r$   r%   r&   r   r6   typename_dtype_docstringformatr'   r,   r   r   r4   r4      s#    77DD%%F%3Gr   r4   c                  L    e Zd Zej                  ZdZej                  d      Z	y)
Int16DtypeInt16int16r7   N)
r$   r%   r&   r   r?   r8   r9   r:   r;   r'   r,   r   r   r=   r=      #    88DD%%G%4Gr   r=   c                  L    e Zd Zej                  ZdZej                  d      Z	y)
Int32DtypeInt32int32r7   N)
r$   r%   r&   r   rD   r8   r9   r:   r;   r'   r,   r   r   rB   rB      r@   r   rB   c                  L    e Zd Zej                  ZdZej                  d      Z	y)
Int64DtypeInt64r(   r7   N)
r$   r%   r&   r   r(   r8   r9   r:   r;   r'   r,   r   r   rF   rF      r@   r   rF   c                  L    e Zd Zej                  ZdZej                  d      Z	y)
UInt8DtypeUInt8uint8r7   N)
r$   r%   r&   r   rK   r8   r9   r:   r;   r'   r,   r   r   rI   rI      r@   r   rI   c                  L    e Zd Zej                  ZdZej                  d      Z	y)UInt16DtypeUInt16uint16r7   N)
r$   r%   r&   r   rO   r8   r9   r:   r;   r'   r,   r   r   rM   rM      #    99DD%%H%5Gr   rM   c                  L    e Zd Zej                  ZdZej                  d      Z	y)UInt32DtypeUInt32uint32r7   N)
r$   r%   r&   r   rT   r8   r9   r:   r;   r'   r,   r   r   rR   rR      rP   r   rR   c                  L    e Zd Zej                  ZdZej                  d      Z	y)UInt64DtypeUInt64uint64r7   N)
r$   r%   r&   r   rX   r8   r9   r:   r;   r'   r,   r   r   rV   rV      rP   r   rV   )r6   r?   rD   r(   rK   rO   rT   rX   zdict[str, IntegerDtype]r   )
__future__r   numpyr   pandas.core.dtypes.baser   pandas.core.dtypes.commonr   pandas.core.arrays.numericr   r   r	   r   r:   r4   r=   rB   rF   rI   rM   rR   rV   r   __annotations__r,   r   r   <module>r_      sL   "  < 6-< -`J< JZ ( 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 6, 6 6 6, 6 6 6, 6 6 K\\\\mmm	- ) 	r   