
    Eg                    f   U d dl mZ 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j        ej                   e             ej        ej                   e            iZded<   dS )    )annotations)ClassVarN)register_extension_dtype)is_float_dtype)NumericArrayNumericDtypec                      e Zd ZdZ ej        ej                  ZeZ	e
dd            Ze
dd            Ze
dd            ZdS )FloatingDtypea  
    An ExtensionDtype to hold a single size of floating dtype.

    These specific implementations are subclasses of the non-public
    FloatingDtype. For example we have Float32Dtype to represent float32.

    The attributes name & type are set when these subclasses are created.
    returntype[FloatingArray]c                    t           S )zq
        Return the array type associated with this dtype.

        Returns
        -------
        type
        )FloatingArrayclss    P/var/www/sysmax/venv/lib/python3.11/site-packages/pandas/core/arrays/floating.pyconstruct_array_typez"FloatingDtype.construct_array_type   s
         dict[np.dtype, FloatingDtype]c                    t           S )N)NUMPY_FLOAT_TO_DTYPEr   s    r   _get_dtype_mappingz FloatingDtype._get_dtype_mapping(   s    ##r   values
np.ndarraydtypenp.dtypecopyboolc                0    |                     ||          S )z{
        Safely cast the values to the given dtype.

        "safe" in this context means the casting is lossless.
        )r   )astype)r   r   r   r   s       r   
_safe_castzFloatingDtype._safe_cast,   s     }}U}...r   N)r   r   )r   r   )r   r   r   r   r   r   r   r   )__name__
__module____qualname____doc__npr   float64_default_np_dtyper   _checkerclassmethodr   r   r     r   r   r
   r
      s          !,,H   [ $ $ $ [$ / / / [/ / /r   r
   c                  ,    e Zd ZdZeZej        ZdZ	dZ
dS )r   a  
    Array of floating (optional missing) values.

    .. warning::

       FloatingArray is currently experimental, and its API or internal
       implementation may change without warning. Especially the behaviour
       regarding NaN (distinct from NA missing values) is subject to change.

    We represent a FloatingArray with 2 numpy arrays:

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

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

    See :ref:`integer_na` for more.

    Parameters
    ----------
    values : numpy.ndarray
        A 1-d float-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
    -------
    FloatingArray

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

    >>> pd.array([0.1, None, 0.3], dtype=pd.Float32Dtype())
    <FloatingArray>
    [0.1, <NA>, 0.3]
    Length: 3, dtype: Float32

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

    >>> pd.array([0.1, None, 0.3], dtype="Float32")
    <FloatingArray>
    [0.1, <NA>, 0.3]
    Length: 3, dtype: Float32
    g      ?g        N)r!   r"   r#   r$   r
   
_dtype_clsr%   nan_internal_fill_value_truthy_value_falsey_valuer*   r   r   r   r   8   s6        7 7r J 6 MMMMr   r   az  
An ExtensionDtype for {dtype} data.

This dtype uses ``pd.NA`` as missing value indicator.

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

Methods
-------
None

Examples
--------
For Float32Dtype:

>>> ser = pd.Series([2.25, pd.NA], dtype=pd.Float32Dtype())
>>> ser.dtype
Float32Dtype()

For Float64Dtype:

>>> ser = pd.Series([2.25, pd.NA], dtype=pd.Float64Dtype())
>>> ser.dtype
Float64Dtype()
c                  X    e Zd ZU ej        ZdZded<   e	                    d          Z
dS )Float32DtypeFloat32ClassVar[str]namefloat32r   N)r!   r"   r#   r%   r6   typer5   __annotations___dtype_docstringformatr$   r*   r   r   r2   r2      >         :D#D####%%I%66GGGr   r2   c                  X    e Zd ZU ej        ZdZded<   e	                    d          Z
dS )Float64DtypeFloat64r4   r5   r&   r7   N)r!   r"   r#   r%   r&   r8   r5   r9   r:   r;   r$   r*   r   r   r>   r>      r<   r   r>   r   r   )
__future__r   typingr   numpyr%   pandas.core.dtypes.baser   pandas.core.dtypes.commonr   pandas.core.arrays.numericr   r   r
   r   r:   r2   r>   r   r6   r&   r   r9   r*   r   r   <module>rF      s   " " " " " " "           < < < < < < 4 4 4 4 4 4       %/ %/ %/ %/ %/L %/ %/ %/PB B B B BL B B BJ > 7 7 7 7 7= 7 7 7 7 7 7 7 7= 7 7 7 BHRZ,,..BHRZ,,..7       r   