+
    Ŝi                     a  0 t $ R t^ RIHt ^ RIt^ RIHtHtHtH	t	H
t
HtHt ^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ R	IHt ^ R
I H!t!H"t" ^ RI#H$t$ ^ RI%H&t&H't'H(t(H)t) ^ RI*H+t+ ^ RI,H-t-H.t.H/t/ ^ RI0H1t1 ^ RI2H3t3H4t4H5t5 ^ RI6H7t7H8t8H9t9H:t:H;t;H<t<H=t= ^ RI>H?t? ^ RI@HAtA ^ RIBHCtCHDtD ]'       d=   ^ RIEHFtFHGtGHHtH ^ RIIHJtJ ^ RIKHLtLHMtMHNtNHOtOHPtPHQtQHRtRHStSHTtTHUtUHVtVHWtWHXtXHYtYHZtZH[t[ ^ RI\H]t]H^t^ / t_R]`R&   ]! R4       ! R R4      4       ta ! R R]a4      tb ! R  R!4      tc]! R4       ! R" R#]c4      4       tdR# )$z
An interface for extending pandas with custom arrays.

.. warning::

   This is an experimental API and subject to breaking changes
   without warning.
)annotationsN)TYPE_CHECKINGAnyClassVarLiteralSelfcastoverload)algoslib)set_function_name)functionAbstractMethodError)cache_readonly
set_module)find_stack_level)validate_bool_kwargvalidate_insert_loc)astype_is_view)
is_integeris_list_like	is_scalarpandas_dtype)ExtensionDtype)ABCDataFrameABCIndex	ABCSeriesisna)	arraylikemissing	roperator)
duplicatedfactorize_arrayisin	map_arraymoderankunique)quantile_with_mask)_fill_limit_area_1d)
nargminmaxnargsort)CallableIteratorSequence)NAType)	ArrayLike	AstypeArgAxisIntDtypeDtypeObjFillnaOptionsInterpolateOptionsNumpySorterNumpyValueArrayLikePositionalIndexerScalarIndexerSequenceIndexerShapeSortKindTakeIndexernpt)IndexSerieszdict[str, str]_extension_array_shared_docszpandas.api.extensionsc            
      r   ] tR t^rt$ RtRtRtRt]RRRR/R R	 ll4       t	]RR/R
 R ll4       t
]R 4       t]R R l4       tR R lt]R R l4       t]R R l4       tR R ltR R ltR R ltR R ltR R ltR R  ltR! R" ltRR# R$ lltRR]P0                  3R% R& llt]R' R( l4       t]R) R* l4       t]R+ R, l4       t]R- R. l4       t]R/ R0 l4       t]RR1 R2 ll4       t ]RR3 R4 ll4       t ]RR5 R6 ll4       t RR8 R9 llt R: R; lt!]R< R= l4       t"R> R? lt#R@R7RARBRCRD/RE RF llt$RRG RH llt%RRI RJ llt&RK RL lt'RMRRNRRR7/RO RP llt(RRQ RR llt)RS RT lt*RRU RV llt+RRW RX llt,RY RZ lt-RR[ R\ llt.R] R^ lt/R_ R` lt0Ra Rb lt1RRc Rd llt2Re]3Rf&   RRg Rh llt4RRi Rj llt5RkRRlR/Rm Rn llt6Ro Rp lt7]Rq Rr l4       t8]RRs Rt ll4       t8RRu Rv llt8Rw Rx lt9Ry Rz lt:R{ R| lt;RR} R~ llt<R R lt=]R R l4       t>RR R llt?]R R l4       t@]AR R l4       tBRR7/R R lltCRR7RR/R R lltDR]ER&   R R ltFR R ltGR R ltHR R ltIR R ltJR R ltKR R ltLR R ltMR^ RRRRR@R7RR/R R lltN]R R l4       tOR R ltPRR R lltQR R ltRRR R lltSR R ltTRtUR# )ExtensionArrayaT  
Abstract base class for custom 1-D array types.

pandas will recognize instances of this class as proper arrays
with a custom type and will not attempt to coerce them to objects. They
may be stored directly inside a :class:`DataFrame` or :class:`Series`.

Attributes
----------
dtype
nbytes
ndim
shape

Methods
-------
argsort
astype
copy
dropna
duplicated
factorize
fillna
equals
insert
interpolate
isin
isna
item
ravel
repeat
searchsorted
shift
take
tolist
unique
view
_accumulate
_concat_same_type
_explode
_formatter
_from_factorized
_from_sequence
_from_sequence_of_strings
_hash_pandas_object
_pad_or_backfill
_reduce
_values_for_argsort
_values_for_factorize

See Also
--------
api.extensions.ExtensionDtype : A custom data type, to be paired with an
    ExtensionArray.
api.extensions.ExtensionArray.dtype : An instance of ExtensionDtype.

Notes
-----
The interface includes the following abstract methods that must be
implemented by subclasses:

* _from_sequence
* _from_factorized
* __getitem__
* __len__
* __eq__
* dtype
* nbytes
* isna
* take
* copy
* _concat_same_type
* interpolate

A default repr displaying the type, (truncated) data, length,
and dtype is provided. It can be customized or replaced by
by overriding:

* __repr__ : A default repr for the ExtensionArray.
* _formatter : Print scalars inside a Series or DataFrame.

Some methods require casting the ExtensionArray to an ndarray of Python
objects with ``self.astype(object)``, which may be expensive. When
performance is a concern, we highly recommend overriding the following
methods:

* fillna
* _pad_or_backfill
* dropna
* unique
* factorize / _values_for_factorize
* argsort, argmax, argmin / _values_for_argsort
* searchsorted
* map

The remaining methods implemented on this class should be performant,
as they only compose abstract methods. Still, a more efficient
implementation may be available, and these methods can be overridden.

One can implement methods to handle array accumulations or reductions.

* _accumulate
* _reduce

One can implement methods to handle parsing from strings that will be used
in methods such as ``pandas.io.parsers.read_csv``.

* _from_sequence_of_strings

This class does not inherit from 'abc.ABCMeta' for performance reasons.
Methods and properties required by the interface raise
``pandas.errors.AbstractMethodError`` and no ``register`` method is
provided for registering virtual subclasses.

ExtensionArrays are limited to 1 dimension.

They may be backed by none, one, or many NumPy arrays. For example,
``pandas.Categorical`` is an extension array backed by two arrays,
one for codes and one for categories. An array of IPv6 address may
be backed by a NumPy structured array with two fields, one for the
lower 64 bits and one for the upper 64 bits. Or they may be backed
by some other storage type, like Python lists. Pandas makes no
assumptions on how the data are stored, just that it can be converted
to a NumPy array.
The ExtensionArray interface does not impose any rules on how this data
is stored. However, currently, the backing data cannot be stored in
attributes called ``.values`` or ``._values`` to ensure full compatibility
with pandas internals. But other names as ``.data``, ``._data``,
``._items``, ... can be freely used.

If implementing NumPy's ``__array_ufunc__`` interface, pandas expects
that

1. You defer by returning ``NotImplemented`` when any Series are present
   in `inputs`. Pandas will extract the arrays and call the ufunc again.
2. You define a ``_HANDLED_TYPES`` tuple as an attribute on the class.
   Pandas inspect this to determine whether the ufunc is valid for the
   types present.

See :ref:`extending.extension.ufunc` for more.

By default, ExtensionArrays are not hashable.  Immutable subclasses may
override this behavior.

Examples
--------
Please see the following:

https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/list/array.py
	extensioni  FdtypeNcopyc               $    V ^8  d   QhRRRRRR/# )   rH   Dtype | NonerI   boolreturnr    )formats   "`/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/pandas/core/arrays/base.py__annotate__ExtensionArray.__annotate__  s$     #' #' ,#';?#'	#'    c                   \        V 4      h)a*  
Construct a new ExtensionArray from a sequence of scalars.

Parameters
----------
scalars : Sequence
    Each element will be an instance of the scalar type for this
    array, ``cls.dtype.type`` or be converted into this type in this method.
dtype : dtype, optional
    Construct for this particular dtype. This should be a Dtype
    compatible with the ExtensionArray.
copy : bool, default False
    If True, copy the underlying data.

Returns
-------
ExtensionArray

See Also
--------
api.extensions.ExtensionArray._from_sequence_of_strings : Construct a new
    ExtensionArray from a sequence of strings.
api.extensions.ExtensionArray._hash_pandas_object : Hook for
    hash_pandas_object.

Examples
--------
>>> pd.arrays.IntegerArray._from_sequence([4, 5])
<IntegerArray>
[4, 5]
Length: 2, dtype: Int64
r   )clsscalarsrH   rI   s   &&$$rQ   _from_sequenceExtensionArray._from_sequence  s    H "#&&rT   c               $    V ^8  d   QhRRRRRR/# )rK   rH   r   rI   rM   rN   r   rO   )rP   s   "rQ   rR   rS   B  s$     %' %' .%'6:%'	%'rT   c                   \        V 4      h)a?  
Construct a new ExtensionArray from a sequence of strings.

Parameters
----------
strings : Sequence
    Each element will be an instance of the scalar type for this
    array, ``cls.dtype.type``.
dtype : ExtensionDtype
    Construct for this particular dtype. This should be a Dtype
    compatible with the ExtensionArray.
copy : bool, default False
    If True, copy the underlying data.

Returns
-------
ExtensionArray

See Also
--------
api.extensions.ExtensionArray._from_sequence : Construct a new ExtensionArray
    from a sequence of scalars.
api.extensions.ExtensionArray._from_factorized : Reconstruct an ExtensionArray
    after factorization.

Examples
--------
>>> pd.arrays.IntegerArray._from_sequence_of_strings(
...     ["1", "2", "3"], dtype=pd.Int64Dtype()
... )
<IntegerArray>
[1, 2, 3]
Length: 3, dtype: Int64
r   )rV   stringsrH   rI   s   &&$$rQ   _from_sequence_of_strings(ExtensionArray._from_sequence_of_stringsA  s    L "#&&rT   c                    \        V 4      h)a  
Reconstruct an ExtensionArray after factorization.

Parameters
----------
values : ndarray
    An integer ndarray with the factorized values.
original : ExtensionArray
    The original ExtensionArray that factorize was called on.

See Also
--------
factorize : Top-level factorize method that dispatches here.
ExtensionArray.factorize : Encode the extension array as an enumerated type.

Examples
--------
>>> interv_arr = pd.arrays.IntervalArray(
...     [pd.Interval(0, 1), pd.Interval(1, 5), pd.Interval(1, 5)]
... )
>>> codes, uniques = pd.factorize(interv_arr)
>>> pd.arrays.IntervalArray._from_factorized(uniques, interv_arr)
<IntervalArray>
[(0, 1], (1, 5]]
Length: 2, dtype: interval[int64, right]
r   )rV   valuesoriginals   &&&rQ   _from_factorizedExtensionArray._from_factorizedi  s    8 "#&&rT   c                    V ^8  d   QhRRRR/# )rK   rH   r6   rN   r   rO   )rP   s   "rQ   rR   rS     s      h 4 rT   c                    V P                  WRR7      #   \        \        3 d    h \         d#    \        P
                  ! R\        4       R7       h i ; i)au  
Strict analogue to _from_sequence, allowing only sequences of scalars
that should be specifically inferred to the given dtype.

Parameters
----------
scalars : sequence
dtype : ExtensionDtype

Raises
------
TypeError or ValueError

Notes
-----
This is called in a try/except block when casting the result of a
pointwise operation in ExtensionArray._cast_pointwise_result.
FrH   rI   zm_from_scalars should only raise ValueError or TypeError. Consider overriding _from_scalars where appropriate.)
stacklevel)rX   
ValueError	TypeError	Exceptionwarningswarnr   )rV   rW   rH   s   &&$rQ   _from_scalarsExtensionArray._from_scalars  sY    (
	%%g%GGI& 	 	MMG+-
 	s    A#Ac                   V ^8  d   QhRR/# )rK   rN   r2   rO   )rP   s   "rQ   rR   rS     s     O O	 OrT   c                     \        V 4      P                  WP                  R7      #   \        \        3 d8    \
        P                  ! T\        R7      p\        P                  ! TRR7      u # i ; i)a  
Construct an ExtensionArray after a pointwise operation.

Cast the result of a pointwise operation (e.g. Series.map) to an
array. This is not required to return an ExtensionArray of the same
type as self or of the same dtype. It can also return another
ExtensionArray of the same "family" if you implement multiple
ExtensionArrays/Dtypes that are interoperable (e.g. if you have float
array with units, this method can return an int array with units).

If converting to your own ExtensionArray is not possible, this method
falls back to returning an array with the default type inference.
If you only need to cast to `self.dtype`, it is recommended to override
`_from_scalars` instead of this method.

Parameters
----------
values : sequence

Returns
-------
ExtensionArray or ndarray
rH   T)convert_non_numeric)
typerm   rH   rh   ri   npasarrayobjectr   maybe_convert_objectsselfr`   s   &&rQ   _cast_pointwise_result%ExtensionArray._cast_pointwise_result  s]    0	O:++F**+EEI& 	OZZf5F,,VNN	Os   $' AA/.A/c                    V ^8  d   QhRRRR/# )rK   itemr<   rN   r   rO   )rP   s   "rQ   rR   rS     s    :::#:rT   c                	    R # NrO   ry   r}   s   &&rQ   __getitem__ExtensionArray.__getitem__  s    7:rT   c                    V ^8  d   QhRRRR/# )rK   r}   r=   rN   r   rO   )rP   s   "rQ   rR   rS     s    ===D=rT   c                	    R # r   rO   r   s   &&rQ   r   r     s    :=rT   c                    V ^8  d   QhRRRR/# )rK   r}   r;   rN   z
Self | AnyrO   )rP   s   "rQ   rR   rS     s     ( ( 1 (j (rT   c                    \        V 4      h)a  
Select a subset of self.

Parameters
----------
item : int, slice, or ndarray
    * int: The position in 'self' to get.

    * slice: A slice object, where 'start', 'stop', and 'step' are
      integers or None

    * ndarray: A 1-d boolean NumPy ndarray the same length as 'self'

    * list[int]:  A list of int

Returns
-------
item : scalar or ExtensionArray

Notes
-----
For scalar ``item``, return a scalar value suitable for the array's
type. This should be an instance of ``self.dtype.type``.

For slice ``key``, return an instance of ``ExtensionArray``, even
if the slice is length 0 or 1.

For a boolean mask, return an instance of ``ExtensionArray``, filtered
to the values where ``item`` is True.
r   r   s   &&rQ   r   r     s    > "$''rT   c                   V ^8  d   QhRR/# rK   rN   NonerO   )rP   s   "rQ   rR   rS     s     4S 4S 4SrT   c                j    V P                   '       d   \        R4      h\        \        V 4       R24      h)a$  
Set one or more values inplace.

This method is not required to satisfy the pandas extension array
interface.

Parameters
----------
key : int, ndarray, or slice
    When called from, e.g. ``Series.__setitem__``, ``key`` will be
    one of

    * scalar int
    * ndarray of integers.
    * boolean ndarray
    * slice object

value : ExtensionDtype.type, Sequence[ExtensionDtype.type], or object
    value or values to be set of ``key``.

Returns
-------
None

Raises
------
ValueError
    If the array is readonly and modification is attempted.
zCannot modify read-only arrayz  does not implement __setitem__.)	_readonlyrh   NotImplementedErrorrs   )ry   keyvalues   &&&rQ   __setitem__ExtensionArray.__setitem__  s1    b >>><==!T$ZL0P"QRRrT   c                   V ^8  d   QhRR/# rK   rN   intrO   )rP   s   "rQ   rR   rS   %  s     ( ( (rT   c                    \        V 4      h)z4
Length of this array

Returns
-------
length : int
r   ry   s   &rQ   __len__ExtensionArray.__len__%  s     "$''rT   c                   V ^8  d   QhRR/# )rK   rN   zIterator[Any]rO   )rP   s   "rQ   rR   rS   /  s      - rT   c              #  X   "   \        \        V 4      4       F  pW,          x  K  	  R# 5i)z%
Iterate over elements of the array.
N)rangelen)ry   is   & rQ   __iter__ExtensionArray.__iter__/  s!      s4y!A'M "   (*c                    V ^8  d   QhRRRR/# )rK   r}   rv   rN   zbool | np.bool_rO   )rP   s   "rQ   rR   rS   9  s     ( ( (O (rT   c                *   \        V4      '       dr   \        V4      '       da   V P                  '       g   R# WP                  P                  J g&   \        WP                  P                  4      '       d   V P                  # R# W8H  P                  4       # )z
Return for `item in self`.
F)	r   r   _can_hold_narH   na_value
isinstancers   _hasnaanyr   s   &&rQ   __contains__ExtensionArray.__contains__9  sf     T??tDzz$$$,,,
40Q0Q{{" L%%''rT   c                    V ^8  d   QhRRRR/# rK   otherrv   rN   r2   rO   )rP   s   "rQ   rR   rS   M  s     
( 
(F 
(y 
(rT   c                    \        V 4      h)z5
Return for `self == other` (element-wise equality).
r   ry   r   s   &&rQ   __eq__ExtensionArray.__eq__M  s     "$''rT   c                    V ^8  d   QhRRRR/# r   rO   )rP   s   "rQ   rR   rS   Z  s        F  y  rT   c                    W8H  ( # )z8
Return for `self != other` (element-wise in-equality).
rO   r   s   &&rQ   __ne__ExtensionArray.__ne__Z  s    
 rT   c                   V ^8  d   QhRR/# )rK   index
int | NonerO   )rP   s   "rQ   rR   rS   a  s     0 0* 0rT   c                    Vf%   \        V 4      ^8w  d   \        R4      hV ^ ,          # \        V4      '       g   \        R\	        V4       24      hW,          # )a  
Return the array element at the specified position as a Python scalar.

Parameters
----------
index : int, optional
    Position of the element. If not provided, the array must contain
    exactly one element.

Returns
-------
scalar
    The element at the specified position.

Raises
------
ValueError
    If no index is provided and the array does not have exactly
    one element.
IndexError
    If the specified position is out of bounds.

See Also
--------
numpy.ndarray.item : Return the item of an array as a scalar.

Examples
--------
>>> arr = pd.array([1], dtype="Int64")
>>> arr.item()
np.int64(1)

>>> arr = pd.array([1, 2, 3], dtype="Int64")
>>> arr.item(0)
np.int64(1)
>>> arr.item(2)
np.int64(3)
z6can only convert an array of size 1 to a Python scalarzindex must be an integer, got )r   rh   r   ri   rs   )ry   r   s   &&rQ   r}   ExtensionArray.itema  sZ    N =4yA~ L  7Ne$$"@e NOO;rT   c               (    V ^8  d   QhRRRRRRRR/# )	rK   rH   znpt.DTypeLike | NonerI   rM   r   rv   rN   
np.ndarrayrO   )rP   s   "rQ   rR   rS     s2     ( (#( ( 	(
 
(rT   c                   \         P                  ! WR7      pV'       g   V\        P                  Jd   VP	                  4       pMYV P
                  '       dH   \        V P                  VP                  4      '       d"   VP                  4       pRVP                  n
        V\        P                  Jd   W4V P                  4       &   V# )a  
Convert to a NumPy ndarray.

This is similar to :meth:`numpy.asarray`, but may provide additional control
over how the conversion is done.

Parameters
----------
dtype : str or numpy.dtype, optional
    The dtype to pass to :meth:`numpy.asarray`.
copy : bool, default False
    Whether to ensure that the returned value is a not a view on
    another array. Note that ``copy=False`` does not *ensure* that
    ``to_numpy()`` is no-copy. Rather, ``copy=True`` ensure that
    a copy is made, even if not strictly necessary.
na_value : Any, optional
    The value to use for missing values. The default value depends
    on `dtype` and the type of the array.

Returns
-------
numpy.ndarray
rq   F)rt   ru   r   
no_defaultrI   r   r   rH   viewflags	writeabler   )ry   rH   rI   r   results   &&&& rQ   to_numpyExtensionArray.to_numpy  s~    : D.83>>1[[]F^^^tzz6<< H H[[]F%*FLL"3>>)"*499;rT   c                   V ^8  d   QhRR/# )rK   rN   r   rO   )rP   s   "rQ   rR   rS     s     ( (~ (rT   c                    \        V 4      h)a  
An instance of ExtensionDtype.

See Also
--------
api.extensions.ExtensionDtype : Base class for extension dtypes.
api.extensions.ExtensionArray : Base class for extension array types.
api.extensions.ExtensionArray.dtype : The dtype of an ExtensionArray.
Series.dtype : The dtype of a Series.
DataFrame.dtype : The dtype of a DataFrame.

Examples
--------
>>> pd.array([1, 2, 3]).dtype
Int64Dtype()
r   r   s   &rQ   rH   ExtensionArray.dtype  s    $ "$''rT   c                   V ^8  d   QhRR/# )rK   rN   r>   rO   )rP   s   "rQ   rR   rS     s      u rT   c                    \        V 4      3# )aq  
Return a tuple of the array dimensions.

See Also
--------
numpy.ndarray.shape : Similar attribute which returns the shape of an array.
DataFrame.shape : Return a tuple representing the dimensionality of the
    DataFrame.
Series.shape : Return a tuple representing the dimensionality of the Series.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr.shape
(3,)
)r   r   s   &rQ   shapeExtensionArray.shape  s    $ D	|rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   rS     s     # #c #rT   c                B    \         P                  ! V P                  4      # )z&
The number of elements in the array.
)rt   prodr   r   s   &rQ   sizeExtensionArray.size  s     wwtzz""rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   rS     s      c rT   c                    ^# )a  
Extension Arrays are only allowed to be 1-dimensional.

See Also
--------
ExtensionArray.shape: Return a tuple of the array dimensions.
ExtensionArray.size: The number of elements in the array.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr.ndim
1
rO   r   s   &rQ   ndimExtensionArray.ndim  s      rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   rS     s     ( ( (rT   c                    \        V 4      h)z
The number of bytes needed to store this object in memory.

See Also
--------
ExtensionArray.shape: Return a tuple of the array dimensions.
ExtensionArray.size: The number of elements in the array.

Examples
--------
>>> pd.array([1, 2, 3]).nbytes
27
r   r   s   &rQ   nbytesExtensionArray.nbytes  s    " "$''rT   c               $    V ^8  d   QhRRRRRR/# )rK   rH   znpt.DTypeLikerI   rM   rN   r   rO   )rP   s   "rQ   rR   rS     s    OOMOO
OrT   c                	    R # r   rO   ry   rH   rI   s   &&&rQ   astypeExtensionArray.astype  s    LOrT   c               $    V ^8  d   QhRRRRRR/# )rK   rH   r   rI   rM   rN   rF   rO   )rP   s   "rQ   rR   rS     s    TTNT$TTrT   c                	    R # r   rO   r   s   &&&rQ   r   r     s    QTrT   c               $    V ^8  d   QhRRRRRR/# rK   rH   r3   rI   rM   rN   r2   rO   )rP   s   "rQ   rR   rS   "  s    JJIJTJIJrT   c                	    R # r   rO   r   s   &&&rQ   r   r   !  s    GJrT   Tc               $    V ^8  d   QhRRRRRR/# r   rO   )rP   s   "rQ   rR   rS   $  s&     O: O:I O:T O:Y O:rT   c                $   \        V4      pWP                  8X  d   V'       g   V # V P                  4       # \        V\        4      '       d$   VP                  4       pVP                  WVR7      # \        P                  ! VR4      '       d   ^ RI	H
p VP                  WVR7      # \        P                  ! VR4      '       d   ^ RI	Hp VP                  WVR7      # V'       g   \        P                  ! WR7      # \        P                  ! WVR7      # )a.  
Cast to a NumPy array or ExtensionArray with 'dtype'.

Parameters
----------
dtype : str or dtype
    Typecode or data-type to which the array is cast.
copy : bool, default True
    Whether to copy the data, even if not necessary. If False,
    a copy is made only if the old dtype does not match the
    new dtype.

Returns
-------
np.ndarray or pandas.api.extensions.ExtensionArray
    An ``ExtensionArray`` if ``dtype`` is ``ExtensionDtype``,
    otherwise a Numpy ndarray with ``dtype`` for its dtype.

See Also
--------
Series.astype : Cast a Series to a different dtype.
DataFrame.astype : Cast a DataFrame to a different dtype.
api.extensions.ExtensionArray : Base class for ExtensionArray objects.
core.arrays.DatetimeArray._from_sequence : Create a DatetimeArray from a
    sequence.
core.arrays.TimedeltaArray._from_sequence : Create a TimedeltaArray from
    a sequence.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr
<IntegerArray>
[1, 2, 3]
Length: 3, dtype: Int64

Casting to another ``ExtensionDtype`` returns an ``ExtensionArray``:

>>> arr1 = arr.astype("Float64")
>>> arr1
<FloatingArray>
[1.0, 2.0, 3.0]
Length: 3, dtype: Float64
>>> arr1.dtype
Float64Dtype()

Otherwise, we will get a Numpy ndarray:

>>> arr2 = arr.astype("float64")
>>> arr2
array([1., 2., 3.])
>>> arr2.dtype
dtype('float64')
rf   M)DatetimeArraym)TimedeltaArrayrq   )r   rH   rI   r   r   construct_array_typerX   r   is_np_dtypepandas.core.arraysr   r   rt   ru   array)ry   rH   rI   rV   r   r   s   &&&   rQ   r   r   $  s    n U#JJyy{"e^,,,,.C%%dd%CC__UC((8 ///MM__UC((9!000NN::d0088DD99rT   c                   V ^8  d   QhRR/# )rK   rN   z)np.ndarray | ExtensionArraySupportsAnyAllrO   )rP   s   "rQ   rR   rS   u  s      (  (?  (rT   c                    \        V 4      h)af  
A 1-D array indicating if each value is missing.

Returns
-------
numpy.ndarray or pandas.api.extensions.ExtensionArray
    In most cases, this should return a NumPy ndarray. For
    exceptional cases like ``SparseArray``, where returning
    an ndarray would be expensive, an ExtensionArray may be
    returned.

See Also
--------
ExtensionArray.dropna: Return ExtensionArray without NA values.
ExtensionArray.fillna: Fill NA/NaN values using the specified method.

Notes
-----
If returning an ExtensionArray, then

* ``na_values._is_boolean`` should be True
* ``na_values`` should implement :func:`ExtensionArray._reduce`
* ``na_values`` should implement :func:`ExtensionArray._accumulate`
* ``na_values.any`` and ``na_values.all`` should be implemented

Examples
--------
>>> arr = pd.array([1, 2, np.nan, np.nan])
>>> arr.isna()
array([False, False,  True,  True])
r   r   s   &rQ   r   ExtensionArray.isnau  s    @ "$''rT   c                   V ^8  d   QhRR/# rK   rN   rM   rO   )rP   s   "rQ   rR   rS     s     ' ' 'rT   c                P    \        V P                  4       P                  4       4      # )zh
Equivalent to `self.isna().any()`.

Some ExtensionArray subclasses may be able to optimize this check.
)rM   r   r   r   s   &rQ   r   ExtensionArray._hasna  s     DIIKOO%&&rT   c                   V ^8  d   QhRR/# rK   rN   r   rO   )rP   s   "rQ   rR   rS     s     ! !Z !rT   c                .    \         P                  ! V 4      # )a/  
Return values for sorting.

Returns
-------
ndarray
    The transformed values should maintain the ordering between values
    within the array.

See Also
--------
ExtensionArray.argsort : Return the indices that would sort this array.

Notes
-----
The caller is responsible for *not* modifying these values in-place, so
it is safe for implementers to give views on ``self``.

Functions that use this (e.g. ``ExtensionArray.argsort``) should ignore
entries with missing values in the original array (according to
``self.isna()``). This means that the corresponding entries in the returned
array don't need to be modified to sort correctly.

Examples
--------
In most cases, this is the underlying Numpy array of the ``ExtensionArray``:

>>> arr = pd.array([1, 2, 3])
>>> arr._values_for_argsort()
array([1, 2, 3])
)rt   r   r   s   &rQ   _values_for_argsort"ExtensionArray._values_for_argsort  s    B xx~rT   	ascendingkind	quicksortna_positionlastc               (    V ^8  d   QhRRRRRRRR/# )	rK   r   rM   r   r?   r   strrN   r   rO   )rP   s   "rQ   rR   rS     s4     6
 6
 6
 	6

 6
 
6
rT   c          
         \         P                  ! VRV4      pV P                  4       p\        VVVV\        P
                  ! V P                  4       4      R7      # )a  
Return the indices that would sort this array.

Parameters
----------
ascending : bool, default True
    Whether the indices should result in an ascending
    or descending sort.
kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
    Sorting algorithm.
na_position : {'first', 'last'}, default 'last'
    If ``'first'``, put ``NaN`` values at the beginning.
    If ``'last'``, put ``NaN`` values at the end.
**kwargs
    Passed through to :func:`numpy.argsort`.

Returns
-------
np.ndarray[np.intp]
    Array of indices that sort ``self``. If NaN values are contained,
    NaN values are placed at the end.

See Also
--------
numpy.argsort : Sorting implementation used internally.

Examples
--------
>>> arr = pd.array([3, 1, 2, 5, 4])
>>> arr.argsort()
array([1, 2, 0, 4, 3])
)r   r   r   maskrO   )nvvalidate_argsort_with_ascendingr   r-   rt   ru   r   )ry   r   r   r   kwargsr`   s   &$$$, rQ   argsortExtensionArray.argsort  sR    Z 66y"fM	))+#DIIK(
 	
rT   c                    V ^8  d   QhRRRR/# rK   skipnarM   rN   r   rO   )rP   s   "rQ   rR   rS           *  *T  *S  *rT   c                |    \        VR4       V'       g   V P                  '       d   \        R4      h\        V R4      # )a  
Return the index of minimum value.

In case of multiple occurrences of the minimum value, the index
corresponding to the first occurrence is returned.

Parameters
----------
skipna : bool, default True

Returns
-------
int

See Also
--------
ExtensionArray.argmax : Return the index of the maximum value.

Examples
--------
>>> arr = pd.array([3, 1, 2, 5, 4])
>>> arr.argmin()
np.int64(1)
r  )Encountered an NA value with skipna=Falseargminr   r   rh   r,   ry   r  s   &&rQ   r  ExtensionArray.argmin  2    : 	FH-$+++HII$))rT   c                    V ^8  d   QhRRRR/# r  rO   )rP   s   "rQ   rR   rS     r  rT   c                |    \        VR4       V'       g   V P                  '       d   \        R4      h\        V R4      # )a  
Return the index of maximum value.

In case of multiple occurrences of the maximum value, the index
corresponding to the first occurrence is returned.

Parameters
----------
skipna : bool, default True

Returns
-------
int

See Also
--------
ExtensionArray.argmin : Return the index of the minimum value.

Examples
--------
>>> arr = pd.array([3, 1, 2, 5, 4])
>>> arr.argmax()
np.int64(3)
r  r
  argmaxr  r  s   &&rQ   r  ExtensionArray.argmax  r  rT   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rK   methodr8   axisr   r   rB   rI   rM   rN   r   rO   )rP   s   "rQ   rR   rS   @  sE     l
 l
 #l
 	l

 l
 l
 
l
rT   c               D    \        \        V 4      P                   R24      h)ar  
Fill NaN values using an interpolation method.

Parameters
----------
method : str, default 'linear'
    Interpolation technique to use. One of:
    * 'linear': Ignore the index and treat the values as equally spaced.
    This is the only method supported on MultiIndexes.
    * 'time': Works on daily and higher resolution data to interpolate
    given length of interval.
    * 'index', 'values': use the actual numerical values of the index.
    * 'nearest', 'zero', 'slinear', 'quadratic', 'cubic', 'barycentric',
    'polynomial': Passed to scipy.interpolate.interp1d, whereas 'spline'
    is passed to scipy.interpolate.UnivariateSpline. These methods use
    the numerical values of the index.
    Both 'polynomial' and 'spline' require that you also specify an
    order (int), e.g. arr.interpolate(method='polynomial', order=5).
    * 'krogh', 'piecewise_polynomial', 'spline', 'pchip', 'akima',
    'cubicspline': Wrappers around the SciPy interpolation methods
    of similar names. See Notes.
    * 'from_derivatives': Refers to scipy.interpolate.BPoly.from_derivatives.
axis : int
    Axis to interpolate along. For 1-dimensional data, use 0.
index : Index
    Index to use for interpolation.
limit : int or None
    Maximum number of consecutive NaNs to fill. Must be greater than 0.
limit_direction : {'forward', 'backward', 'both'}
    Consecutive NaNs will be filled in this direction.
limit_area : {'inside', 'outside'} or None
    If limit is specified, consecutive NaNs will be filled with this
    restriction.
    * None: No fill restriction.
    * 'inside': Only fill NaNs surrounded by valid values (interpolate).
    * 'outside': Only fill NaNs outside valid values (extrapolate).
copy : bool
    If True, a copy of the object is returned with interpolated values.
**kwargs : optional
    Keyword arguments to pass on to the interpolating function.

Returns
-------
ExtensionArray
    An ExtensionArray with interpolated values.

See Also
--------
Series.interpolate : Interpolate values in a Series.
DataFrame.interpolate : Interpolate values in a DataFrame.

Notes
-----
- All parameters must be specified as keyword arguments.
- The 'krogh', 'piecewise_polynomial', 'spline', 'pchip' and 'akima'
  methods are wrappers around the respective SciPy implementations of
  similar names. These use the actual numerical values of the index.

Examples
--------
Interpolating values in a NumPy array:

>>> arr = pd.arrays.NumpyExtensionArray(np.array([0, 1, np.nan, 3]))
>>> arr.interpolate(
...     method="linear",
...     limit=3,
...     limit_direction="forward",
...     index=pd.Index(range(len(arr))),
...     fill_value=1,
...     copy=False,
...     axis=0,
...     limit_area="inside",
... )
<NumpyExtensionArray>
[0.0, 1.0, 2.0, 3.0]
Length: 4, dtype: float64

Interpolating values in a FloatingArray:

>>> arr = pd.array([1.0, pd.NA, 3.0, 4.0, pd.NA, 6.0], dtype="Float64")
>>> arr.interpolate(
...     method="linear",
...     axis=0,
...     index=pd.Index(range(len(arr))),
...     limit=None,
...     limit_direction="both",
...     limit_area=None,
...     copy=True,
... )
<FloatingArray>
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
Length: 6, dtype: Float64
z does not implement interpolate)r   rs   __name__)	ry   r  r  r   limitlimit_direction
limit_arearI   r  s	   &$$$$$$$,rQ   interpolateExtensionArray.interpolate@  s(    T "Dz""##BC
 	
rT   r  r  c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rK   r  r7   r  r   r  z#Literal['inside', 'outside'] | NonerI   rM   rN   r   rO   )rP   s   "rQ   rR   rS     sE     T T T 	T
 8T T 
TrT   c                  V P                  4       pVP                  4       '       d   \        P                  ! V4      p\        P
                  ! V4      pVe"   VP                  4       '       g   \        Ws4       VR8X  d+   \        P                  ! WrR7      pV P                  VRR7      # \        P                  ! VRRR1,          VR7      RRR1,          pV RRR1,          P                  VRR7      # V'       g   V # V P                  4       p	V	# )a  
Pad or backfill values, used by Series/DataFrame ffill and bfill.

Parameters
----------
method : {'backfill', 'bfill', 'pad', 'ffill'}
    Method to use for filling holes in reindexed Series:

    * pad / ffill: propagate last valid observation forward to next valid.
    * backfill / bfill: use NEXT valid observation to fill gap.

limit : int, default None
    This is the maximum number of consecutive
    NaN values to forward/backward fill. In other words, if there is
    a gap with more than this number of consecutive NaNs, it will only
    be partially filled. If method is not specified, this is the
    maximum number of entries along the entire axis where NaNs will be
    filled.

limit_area : {'inside', 'outside'} or None, default None
    Specifies which area to limit filling.
    - 'inside': Limit the filling to the area within the gaps.
    - 'outside': Limit the filling to the area outside the gaps.
    If `None`, no limitation is applied.

copy : bool, default True
    Whether to make a copy of the data before filling. If False, then
    the original should be modified and no new memory should be allocated.
    For ExtensionArray subclasses that cannot do this, it is at the
    author's discretion whether to ignore "copy=False" or to raise.
    The base class implementation ignores the keyword if any NAs are
    present.

Returns
-------
Same type as self
    The filled array with the same type as the original.

See Also
--------
Series.ffill : Forward fill missing values.
Series.bfill : Backward fill missing values.
DataFrame.ffill : Forward fill missing values in DataFrame.
DataFrame.bfill : Backward fill missing values in DataFrame.
api.types.isna : Check for missing values.
api.types.isnull : Check for missing values.

Examples
--------
>>> arr = pd.array([np.nan, np.nan, 2, 3, np.nan, np.nan])
>>> arr._pad_or_backfill(method="backfill", limit=1)
<IntegerArray>
[<NA>, 2, 2, 3, <NA>, <NA>]
Length: 6, dtype: Int64
Npad)r  T
allow_fill)r   r   r!   clean_fill_methodrt   ru   allr+   libalgosget_fill_indexertakerI   )
ry   r  r  r  rI   r   methnpmaskindexer
new_valuess
   &$$$$     rQ   _pad_or_backfillExtensionArray._pad_or_backfill  s    ~ yy{88::,,V4DZZ%F%fjjll#F7u}"33FHyyTy:: #33F4R4LNtQStTDbDzw4@@ JrT   c               (    V ^8  d   QhRRRRRRRR/# )	rK   r   zobject | ArrayLiker  r   rI   rM   rN   r   rO   )rP   s   "rQ   rR   rS     s8     H H!H H 	H
 
HrT   c                   V P                  4       pVeN   V\        V 4      8  d>   VP                  4       V8  pVP                  4       '       d   VP	                  4       pRWE&   \
        P                  ! VV\        V 4      4      pVP                  4       '       d)   V'       g   V R,          pMV P	                  4       pWV&   V# V'       g   V R,          pV# V P	                  4       pV# )aH  
Fill NA/NaN values using the specified method.

Parameters
----------
value : scalar, array-like
    If a scalar value is passed it is used to fill all missing values.
    Alternatively, an array-like "value" can be given. It's expected
    that the array-like have the same length as 'self'.
limit : int, default None
    The maximum number of entries where NA values will be filled.
copy : bool, default True
    Whether to make a copy of the data before filling. If False, then
    the original should be modified and no new memory should be allocated.
    For ExtensionArray subclasses that cannot do this, it is at the
    author's discretion whether to ignore "copy=False" or to raise.

Returns
-------
ExtensionArray
    With NA/NaN filled.

See Also
--------
api.extensions.ExtensionArray.dropna : Return ExtensionArray without
    NA values.
api.extensions.ExtensionArray.isna : A 1-D array indicating if
    each value is missing.

Examples
--------
>>> arr = pd.array([np.nan, np.nan, 2, 3, np.nan, np.nan])
>>> arr.fillna(0)
<IntegerArray>
[0, 0, 2, 3, 0, 0]
Length: 6, dtype: Int64
FNNN)r   r   cumsumr   rI   r!   check_value_size)ry   r   r  rI   r   modifyr,  s   &&&&   rQ   fillnaExtensionArray.fillna  s    V yy{T!2 [[]U*Fzz||yy{$ ((I
 88::!!W
!YY[
$t
 	 aJ  JrT   c                   V ^8  d   QhRR/# rK   rN   r   rO   )rP   s   "rQ   rR   rS   N  s     " " "rT   c                0    W P                  4       ( ,          # )a  
Return ExtensionArray without NA values.

Returns
-------
Self
    An ExtensionArray of the same type as the original but with all
    NA values removed.

See Also
--------
Series.dropna : Remove missing values from a Series.
DataFrame.dropna : Remove missing values from a DataFrame.
api.extensions.ExtensionArray.isna : Check for missing values in
    an ExtensionArray.

Examples
--------
>>> pd.array([1, 2, np.nan]).dropna()
<IntegerArray>
[1, 2]
Length: 2, dtype: Int64
r   r   s   &rQ   dropnaExtensionArray.dropnaN  s    2 YY[L!!rT   c                    V ^8  d   QhRRRR/# )rK   keepzLiteral['first', 'last', False]rN   npt.NDArray[np.bool_]rO   )rP   s   "rQ   rR   rS   i  s      =  =3 =	 =rT   c                z    V P                  4       P                  \        P                  RR7      p\	        WVR7      # )a  
Return boolean ndarray denoting duplicate values.

Parameters
----------
keep : {'first', 'last', False}, default 'first'
    - ``first`` : Mark duplicates as ``True`` except for the first occurrence.
    - ``last`` : Mark duplicates as ``True`` except for the last occurrence.
    - False : Mark all duplicates as ``True``.

Returns
-------
ndarray[bool]
    With true in indices where elements are duplicated and false otherwise.

See Also
--------
DataFrame.duplicated : Return boolean Series denoting
    duplicate rows.
Series.duplicated : Indicate duplicate Series values.
api.extensions.ExtensionArray.unique : Compute the ExtensionArray
    of unique values.

Examples
--------
>>> pd.array([1, 1, 2, 3, 3], dtype="Int64").duplicated()
array([False,  True, False, False,  True])
FrI   )r`   r=  r   )r   r   rt   bool_r#   )ry   r=  r   s   && rQ   r#   ExtensionArray.duplicatedi  s0    > yy{!!"((!7t<<rT   c               $    V ^8  d   QhRRRRRR/# )rK   periodsr   
fill_valuerv   rN   rF   rO   )rP   s   "rQ   rR   rS     s&     A. A.S A.& A.N A.rT   c           	        \        V 4      '       d   V^ 8X  d   V P                  4       # \        V4      '       d   V P                  P                  pV P                  V.\        \        V4      \        V 4      4      ,          V P                  R7      pV^ 8  d
   TpV RV)  pMV \        V4      R pTpV P                  WE.4      # )a  
Shift values by desired number.

Newly introduced missing values are filled with
``self.dtype.na_value``.

Parameters
----------
periods : int, default 1
    The number of periods to shift. Negative values are allowed
    for shifting backwards.

fill_value : object, optional
    The scalar value to use for newly introduced missing values.
    The default is ``self.dtype.na_value``.

Returns
-------
ExtensionArray
    Shifted.

See Also
--------
api.extensions.ExtensionArray.transpose : Return a transposed view on
    this array.
api.extensions.ExtensionArray.factorize : Encode the extension array as an
    enumerated type.

Notes
-----
If ``self`` is empty or ``periods`` is 0, a copy of ``self`` is
returned.

If ``periods > len(self)``, then an array of size
len(self) is returned, with all values filled with
``self.dtype.na_value``.

For 2-dimensional ExtensionArrays, we are always shifting along axis=0.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr.shift(2)
<IntegerArray>
[<NA>, <NA>, 1]
Length: 3, dtype: Int64
rq   N)	r   rI   r   rH   r   rX   minabs_concat_same_type)ry   rD  rE  emptyabs   &&&   rQ   shiftExtensionArray.shift  s    d 4yyGqL99;
,,J##L3s7|SY77tzz $ 
 Q;AYwhAS\^$AA%%qf--rT   c                   V ^8  d   QhRR/# r8  rO   )rP   s   "rQ   rR   rS     s     > > >rT   c                v    \        V P                  \        4      4      pV P                  WP                  R7      # )a  
Compute the ExtensionArray of unique values.

Returns
-------
pandas.api.extensions.ExtensionArray
    With unique values from the input array.

See Also
--------
Index.unique: Return unique values in the index.
Series.unique: Return unique values of Series object.
unique: Return unique values based on a hash table.

Examples
--------
>>> arr = pd.array([1, 2, 3, 1, 2, 3])
>>> arr.unique()
<IntegerArray>
[1, 2, 3]
Length: 3, dtype: Int64
rq   )r)   r   rv   rX   rH   )ry   uniquess   & rQ   r)   ExtensionArray.unique  s/    . V,-""7**"==rT   c               (    V ^8  d   QhRRRRRRRR/# )	rK   r   z$NumpyValueArrayLike | ExtensionArraysidezLiteral['left', 'right']sorterzNumpySorter | NonerN   znpt.NDArray[np.intp] | np.intprO   )rP   s   "rQ   rR   rS     s8     :A :A3:A ':A #	:A
 
(:ArT   c                    V P                  \        4      p\        V\        4      '       d   VP                  \        4      pVP	                  WVR7      # )a  
Find indices where elements should be inserted to maintain order.

Find the indices into a sorted array `self` (a) such that, if the
corresponding elements in `value` were inserted before the indices,
the order of `self` would be preserved.

Assuming that `self` is sorted:

======  ================================
`side`  returned index `i` satisfies
======  ================================
left    ``self[i-1] < value <= self[i]``
right   ``self[i-1] <= value < self[i]``
======  ================================

Parameters
----------
value : array-like, list or scalar
    Value(s) to insert into `self`.
side : {'left', 'right'}, optional
    If 'left', the index of the first suitable location found is given.
    If 'right', return the last such index.  If there is no suitable
    index, return either 0 or N (where N is the length of `self`).
sorter : 1-D array-like, optional
    Optional array of integer indices that sort array a into ascending
    order. They are typically the result of argsort.

Returns
-------
array of ints or int
    If value is array-like, array of insertion points.
    If value is scalar, a single integer.

See Also
--------
numpy.searchsorted : Similar method from NumPy.

Examples
--------
>>> arr = pd.array([1, 2, 3, 5])
>>> arr.searchsorted([4])
array([3])
)rT  rU  )r   rv   r   rF   searchsorted)ry   r   rT  rU  arrs   &&&& rQ   rW  ExtensionArray.searchsorted  sD    n kk&!e^,,LL(E@@rT   c                    V ^8  d   QhRRRR/# )rK   r   rv   rN   rM   rO   )rP   s   "rQ   rR   rS   $  s     29 29F 29t 29rT   c                   \        V 4      \        V4      8w  d   R# \        \        V4      pV P                  VP                  8w  d   R# \	        V 4      \	        V4      8w  d   R# W8H  p\        V\        4      '       d   VP                  R4      pV P                  4       VP                  4       ,          p\        W#,          P                  4       4      # )a  
Return if another array is equivalent to this array.

Equivalent means that both arrays have the same shape and dtype, and
all values compare equal. Missing values in the same location are
considered equal (in contrast with normal equality).

Parameters
----------
other : ExtensionArray
    Array to compare to this Array.

Returns
-------
boolean
    Whether the arrays are equivalent.

See Also
--------
numpy.array_equal : Equivalent method for numpy array.
Series.equals : Equivalent method for Series.
DataFrame.equals : Equivalent method for DataFrame.

Examples
--------
>>> arr1 = pd.array([1, 2, np.nan])
>>> arr2 = pd.array([1, 2, np.nan])
>>> arr1.equals(arr2)
True

>>> arr1 = pd.array([1, 3, np.nan])
>>> arr2 = pd.array([1, 2, np.nan])
>>> arr1.equals(arr2)
False
F)
rs   r   rF   rH   r   r   r5  r   rM   r%  )ry   r   equal_valuesequal_nas   &&  rQ   equalsExtensionArray.equals$  s    H :e$^U+::$Y#e*$=L,77+2259yy{UZZ\1H055788rT   c                    V ^8  d   QhRRRR/# )rK   r`   r2   rN   r>  rO   )rP   s   "rQ   rR   rS   X  s     . .9 .)> .rT   c                B    \        \        P                  ! V 4      V4      # )a  
Pointwise comparison for set containment in the given values.

Roughly equivalent to `np.array([x in values for x in self])`

Parameters
----------
values : np.ndarray or ExtensionArray
    Values to compare every element in the array against.

Returns
-------
np.ndarray[bool]
    With true at indices where value is in `values`.

See Also
--------
DataFrame.isin: Whether each element in the DataFrame is contained in values.
Index.isin: Return a boolean array where the index values are in values.
Series.isin: Whether elements in Series are contained in values.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr.isin([1])
<BooleanArray>
[True, False, False]
Length: 3, dtype: boolean
)r%   rt   ru   rx   s   &&rQ   r%   ExtensionArray.isinX  s    < BJJt$f--rT   c                   V ^8  d   QhRR/# )rK   rN   ztuple[np.ndarray, Any]rO   )rP   s   "rQ   rR   rS   x  s     + +'= +rT   c                L    V P                  \        4      \        P                  3# )ar  
Return an array and missing value suitable for factorization.

Returns
-------
values : ndarray
    An array suitable for factorization. This should maintain order
    and be a supported dtype (Float64, Int64, UInt64, String, Object).
    By default, the extension array is cast to object dtype.
na_value : object
    The value in `values` to consider missing. This will be treated
    as NA in the factorization routines, so it will be coded as
    `-1` and not included in `uniques`. By default,
    ``np.nan`` is used.

See Also
--------
util.hash_pandas_object : Hash the pandas object.

Notes
-----
The values returned by this method are also used in
:func:`pandas.util.hash_pandas_object`. If needed, this can be
overridden in the ``self._hash_pandas_object()`` method.

Examples
--------
>>> pd.array([1, 2, 3])._values_for_factorize()
(array([1, 2, 3], dtype=object), nan)
)r   rv   rt   nanr   s   &rQ   _values_for_factorize$ExtensionArray._values_for_factorizex  s    > {{6"BFF**rT   c                    V ^8  d   QhRRRR/# )rK   use_na_sentinelrM   rN   z!tuple[np.ndarray, ExtensionArray]rO   )rP   s   "rQ   rR   rS     s     ?! ?!?! 
+?!rT   c                l    V P                  4       w  r#\        W!VR7      w  rEV P                  WP4      pWF3# )aL  
Encode the extension array as an enumerated type.

Parameters
----------
use_na_sentinel : bool, default True
    If True, the sentinel -1 will be used for NaN values. If False,
    NaN values will be encoded as non-negative integers and will not drop the
    NaN from the uniques of the values.

Returns
-------
codes : ndarray
    An integer NumPy array that's an indexer into the original
    ExtensionArray.
uniques : ExtensionArray
    An ExtensionArray containing the unique values of `self`.

    .. note::

       uniques will *not* contain an entry for the NA value of
       the ExtensionArray if there are any missing values present
       in `self`.

See Also
--------
factorize : Top-level factorize method that dispatches here.

Notes
-----
:meth:`pandas.factorize` offers a `sort` keyword as well.

Examples
--------
>>> idx1 = pd.PeriodIndex(
...     ["2014-01", "2014-01", "2014-02", "2014-02", "2014-03", "2014-03"],
...     freq="M",
... )
>>> arr, idx = idx1.factorize()
>>> arr
array([0, 0, 1, 1, 2, 2])
>>> idx
PeriodIndex(['2014-01', '2014-02', '2014-03'], dtype='period[M]')
)ri  r   )rf  r$   rb   )ry   ri  rX  r   codesrQ  
uniques_eas   &&     rQ   	factorizeExtensionArray.factorize  sA    p 224(8
 **79
  rT   a2  
        Repeat elements of a %(klass)s.

        Returns a new %(klass)s where each element of the current %(klass)s
        is repeated consecutively a given number of times.

        Parameters
        ----------
        repeats : int or array of ints
            The number of repetitions for each element. This should be a
            non-negative integer. Repeating 0 times will return an empty
            %(klass)s.
        axis : None
            Must be ``None``. Has no effect but is accepted for compatibility
            with numpy.

        Returns
        -------
        %(klass)s
            Newly created %(klass)s with repeated elements.

        See Also
        --------
        Series.repeat : Equivalent function for Series.
        Index.repeat : Equivalent function for Index.
        numpy.repeat : Similar method for :class:`numpy.ndarray`.
        ExtensionArray.take : Take arbitrary positions.

        Examples
        --------
        >>> cat = pd.Categorical(['a', 'b', 'c'])
        >>> cat
        ['a', 'b', 'c']
        Categories (3, str): ['a', 'b', 'c']
        >>> cat.repeat(2)
        ['a', 'a', 'b', 'b', 'c', 'c']
        Categories (3, str): ['a', 'b', 'c']
        >>> cat.repeat([1, 2, 3])
        ['a', 'b', 'b', 'c', 'c', 'c']
        Categories (3, str): ['a', 'b', 'c']
        repeatc               $    V ^8  d   QhRRRRRR/# )rK   repeatszint | Sequence[int]r  zAxisInt | NonerN   r   rO   )rP   s   "rQ   rR   rS     s#     , ,1 , ,SW ,rT   c                    \         P                  ! RRV/4       \        P                  ! \	        V 4      4      P                  V4      pV P                  V4      # )a9  
Repeat elements of an ExtensionArray.

Returns a new ExtensionArray where each element of the current ExtensionArray
is repeated consecutively a given number of times.

Parameters
----------
repeats : int or array of ints
    The number of repetitions for each element. This should be a
    non-negative integer. Repeating 0 times will return an empty
    ExtensionArray.
axis : None
    Must be ``None``. Has no effect but is accepted for compatibility
    with numpy.

Returns
-------
ExtensionArray
    Newly created ExtensionArray with repeated elements.

See Also
--------
Series.repeat : Equivalent function for Series.
Index.repeat : Equivalent function for Index.
numpy.repeat : Similar method for :class:`numpy.ndarray`.
ExtensionArray.take : Take arbitrary positions.

Examples
--------
>>> cat = pd.Categorical(["a", "b", "c"])
>>> cat
['a', 'b', 'c']
Categories (3, str): ['a', 'b', 'c']
>>> cat.repeat(2)
['a', 'a', 'b', 'b', 'c', 'c']
Categories (3, str): ['a', 'b', 'c']
>>> cat.repeat([1, 2, 3])
['a', 'b', 'b', 'c', 'c', 'c']
Categories (3, str): ['a', 'b', 'c']
r  rO   )r   validate_repeatrt   aranger   ro  r(  )ry   rq  r  inds   &&& rQ   ro  ExtensionArray.repeat  sD    T 	2~.iiD	"))'2yy~rT   c                    V ^8  d   QhRRRR/# )rK   r:  rM   rN   rC   rO   )rP   s   "rQ   rR   rS   2  s     % %4 %6 %rT   c                    ^ RI Hp V! V P                  RR7      RVR7      pVP                  P	                  V P
                  4      Vn        V# )a  
Return a Series containing counts of unique values.

This method returns a Series with unique values as the index and their
counts as the values.

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

Returns
-------
Series
    A Series with unique values as index and counts as values.

See Also
--------
Series.value_counts : Equivalent method on Series.
DataFrame.value_counts : Equivalent method on DataFrame.
Index.value_counts : Equivalent method on Index.

Examples
--------
>>> from pandas.core.arrays import IntegerArray
>>> arr = IntegerArray._from_sequence([3, 3, 3, 1, 2, 2])
>>> arr.value_counts()
3    3
1    1
2    2
Name: count, dtype: Int64
)value_counts_internalFr@  )sortr:  )pandas.core.algorithmsry  r   r   r   rH   )ry   r:  value_countsr   s   &&  rQ   r|  ExtensionArray.value_counts2  sA    B 	Qdmmm7eFS||**4::6rT   r"  rE  c               (    V ^8  d   QhRRRRRRRR/# )	rK   indicesr@   r"  rM   rE  r   rN   r   rO   )rP   s   "rQ   rR   rS   ]  s8     _( _(_( 	_(
 _( 
_(rT   c                   \        V 4      h)a-
  
Take elements from an array.

Parameters
----------
indices : sequence of int or one-dimensional np.ndarray of int
    Indices to be taken.
allow_fill : bool, default False
    How to handle negative values in `indices`.

    * False: negative values in `indices` indicate positional indices
      from the right (the default). This is similar to
      :func:`numpy.take`.

    * True: negative values in `indices` indicate
      missing values. These values are set to `fill_value`. Any other
      other negative values raise a ``ValueError``.

fill_value : any, optional
    Fill value to use for NA-indices when `allow_fill` is True.
    This may be ``None``, in which case the default NA value for
    the type, ``self.dtype.na_value``, is used.

    For many ExtensionArrays, there will be two representations of
    `fill_value`: a user-facing "boxed" scalar, and a low-level
    physical NA value. `fill_value` should be the user-facing version,
    and the implementation should handle translating that to the
    physical version for processing the take if necessary.

Returns
-------
ExtensionArray
    An array formed with selected `indices`.

Raises
------
IndexError
    When the indices are out of bounds for the array.
ValueError
    When `indices` contains negative values other than ``-1``
    and `allow_fill` is True.

See Also
--------
numpy.take : Take elements from an array along an axis.
api.extensions.take : Take elements from an array.

Notes
-----
ExtensionArray.take is called by ``Series.__getitem__``, ``.loc``,
``iloc``, when `indices` is a sequence of values. Additionally,
it's called by :meth:`Series.reindex`, or any other method
that causes realignment, with a `fill_value`.

Examples
--------
Here's an example implementation, which relies on casting the
extension array to object dtype. This uses the helper method
:func:`pandas.api.extensions.take`.

.. code-block:: python

   def take(self, indices, allow_fill=False, fill_value=None):
       from pandas.api.extensions import take

       # If the ExtensionArray is backed by an ndarray, then
       # just pass that here instead of coercing to object.
       data = self.astype(object)

       if allow_fill and fill_value is None:
           fill_value = self.dtype.na_value

       # fill value should always be translated from the scalar
       # type for the array, to the physical storage type for
       # the data, before passing to take.

       result = take(
           data, indices, fill_value=fill_value, allow_fill=allow_fill
       )
       return self._from_sequence(result, dtype=self.dtype)
r   )ry   r  r"  rE  s   &&$$rQ   r(  ExtensionArray.take]  s    ~ "$''rT   c                   V ^8  d   QhRR/# r8  rO   )rP   s   "rQ   rR   rS     s     ( (d (rT   c                    \        V 4      h)aZ  
Return a copy of the array.

This method creates a copy of the `ExtensionArray` where modifying the
data in the copy will not affect the original array. This is useful when
you want to manipulate data without altering the original dataset.

Returns
-------
ExtensionArray
    A new `ExtensionArray` object that is a copy of the current instance.

See Also
--------
DataFrame.copy : Return a copy of the DataFrame.
Series.copy : Return a copy of the Series.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr2 = arr.copy()
>>> arr[0] = 2
>>> arr2
<IntegerArray>
[1, 2, 3]
Length: 3, dtype: Int64
r   r   s   &rQ   rI   ExtensionArray.copy  s    8 "$''rT   c                   V ^8  d   QhRR/# r8  rO   )rP   s   "rQ   rR   rS     s    drT   c                	    R # r   rO   r   s   &rQ   r   ExtensionArray.view  s    rT   c                    V ^8  d   QhRRRR/# rK   rH   rL   rN   r2   rO   )rP   s   "rQ   rR   rS     s    ??,??rT   c                	    R # r   rO   ry   rH   s   &&rQ   r   r    s    <?rT   c                    V ^8  d   QhRRRR/# r  rO   )rP   s   "rQ   rR   rS     s     ( (, () (rT   c                2    Ve   \        V4      hV R,          # )a  
Return a view on the array.

Parameters
----------
dtype : str, np.dtype, or ExtensionDtype, optional
    Default None.

Returns
-------
ExtensionArray or np.ndarray
    A view on the :class:`ExtensionArray`'s data.

See Also
--------
api.extensions.ExtensionArray.ravel: Return a flattened view on input array.
Index.view: Equivalent function for Index.
ndarray.view: New view of array with the same data.

Examples
--------
This gives view on the underlying data of an ``ExtensionArray`` and is not a
copy. Modifications on either the view or the original ``ExtensionArray``
will be reflected on the underlying data:

>>> arr = pd.array([1, 2, 3])
>>> arr2 = arr.view()
>>> arr[0] = 2
>>> arr2
<IntegerArray>
[2, 2, 3]
Length: 3, dtype: Int64
r1  )r   r  s   &&rQ   r   r    s    L %e,,AwrT   c                   V ^8  d   QhRR/# rK   rN   r   rO   )rP   s   "rQ   rR   rS     s     / /# /rT   c                	   V P                   ^8  d   V P                  4       # ^ RIHp V! W P	                  4       RR7      P                  R4      pR\        V 4      P                   R2pV P                  4       pV V RV 2# )   format_object_summaryFindent_for_name, 
<z>

)	r   _repr_2dpandas.io.formats.printingr  
_formatterrstriprs   r  _get_repr_footer)ry   r  data
class_namefooters   &    rQ   __repr__ExtensionArray.__repr__  s~    99q===?"D
 %//#U

&. 	 d,,-S1
&&(dV2fX..rT   c                   V ^8  d   QhRR/# r  rO   )rP   s   "rQ   rR   rS      s     ; ;# ;rT   c                	    V P                   ^8  d   RV P                   RV P                   2# R\        V 4       RV P                   2# )r  zShape: z	, dtype: zLength: )r   r   rH   r   r   s   &rQ   r  ExtensionArray._get_repr_footer   sC    99q=TZZL	$**>>#d)Idjj\::rT   c                   V ^8  d   QhRR/# r  rO   )rP   s   "rQ   rR   rS   &  s     7 7# 7rT   c           	     	   ^ RI Hp V  Uu. uF*  pV! W P                  4       RR7      P                  R4      NK,  	  ppRP	                  V4      pR\        V 4      P                   R2pV P                  4       pV RV R	V 2# u upi )
    r  Fr  r  z,
r  >z
[
z
]
)r  r  r  r  joinrs   r  r  )ry   r  xlinesr  r  r  s   &      rQ   r  ExtensionArray._repr_2d&  s    D 	
  "!__%6NUU 	 	 
 zz% d,,-Q/
&&(U4&fX66
s   0Bc                    V ^8  d   QhRRRR/# )rK   boxedrM   rN   zCallable[[Any], str | None]rO   )rP   s   "rQ   rR   rS   7  s     / / /1L /rT   c                *    V'       d   \         # \        # )a{  
Formatting function for scalar values.

This is used in the default '__repr__'. The returned formatting
function receives instances of your scalar type.

Parameters
----------
boxed : bool, default False
    An indicated for whether or not your array is being printed
    within a Series, DataFrame, or Index (True), or just by
    itself (False). This may be useful if you want scalar values
    to appear differently within a Series versus on its own (e.g.
    quoted or not).

Returns
-------
Callable[[Any], str]
    A callable that gets instances of the scalar type and
    returns a string. By default, :func:`repr` is used
    when ``boxed=False`` and :func:`str` is used when
    ``boxed=True``.

See Also
--------
api.extensions.ExtensionArray._concat_same_type : Concatenate multiple
    array of this dtype.
api.extensions.ExtensionArray._explode : Transform each element of
    list-like to a row.
api.extensions.ExtensionArray._from_factorized : Reconstruct an
    ExtensionArray after factorization.
api.extensions.ExtensionArray._from_sequence : Construct a new
    ExtensionArray from a sequence of scalars.

Examples
--------
>>> class MyExtensionArray(pd.arrays.NumpyExtensionArray):
...     def _formatter(self, boxed=False):
...         return lambda x: "*" + str(x) + "*"
>>> MyExtensionArray(np.array([1, 2, 3, 4]))
<MyExtensionArray>
[*1*, *2*, *3*, *4*]
Length: 4, dtype: int64
)r   repr)ry   r  s   &&rQ   r  ExtensionArray._formatter7  s    Z JrT   c                    V ^8  d   QhRRRR/# )rK   axesr   rN   r   rO   )rP   s   "rQ   rR   rS   l  s      s t rT   c                    V R,          # )a  
Return a transposed view on this array.

Because ExtensionArrays are always 1D, this is a no-op.  It is included
for compatibility with np.ndarray.

Returns
-------
ExtensionArray

Examples
--------
>>> pd.array([1, 2, 3]).transpose()
<IntegerArray>
[1, 2, 3]
Length: 3, dtype: Int64
r1  rO   )ry   r  s   &*rQ   	transposeExtensionArray.transposel  s    $ AwrT   c                   V ^8  d   QhRR/# r8  rO   )rP   s   "rQ   rR   rS     s        4  rT   c                	"    V P                  4       # r   )r  r   s   &rQ   TExtensionArray.T  s    ~~rT   c                    V ^8  d   QhRRRR/# )rK   orderz"Literal['C', 'F', 'A', 'K'] | NonerN   r   rO   )rP   s   "rQ   rR   rS     s      =  rT   c                    V # )a  
Return a flattened view on this array.

Parameters
----------
order : {None, 'C', 'F', 'A', 'K'}, default 'C'

Returns
-------
ExtensionArray
    A flattened view on the array.

See Also
--------
ExtensionArray.tolist: Return a list of the values.

Notes
-----
- Because ExtensionArrays are 1D-only, this is a no-op.
- The "order" argument is ignored, is for compatibility with NumPy.

Examples
--------
>>> pd.array([1, 2, 3]).ravel()
<IntegerArray>
[1, 2, 3]
Length: 3, dtype: Int64
rO   )ry   r  s   &&rQ   ravelExtensionArray.ravel  s	    : rT   c                    V ^8  d   QhRRRR/# )rK   	to_concatzSequence[Self]rN   r   rO   )rP   s   "rQ   rR   rS     s     $' $'. $'T $'rT   c                    \        V 4      h)a  
Concatenate multiple array of this dtype.

Parameters
----------
to_concat : sequence of this type
    An array of the same dtype to concatenate.

Returns
-------
ExtensionArray

See Also
--------
api.extensions.ExtensionArray._explode : Transform each element of
    list-like to a row.
api.extensions.ExtensionArray._formatter : Formatting function for
    scalar values.
api.extensions.ExtensionArray._from_factorized : Reconstruct an
    ExtensionArray after factorization.

Examples
--------
>>> arr1 = pd.array([1, 2, 3])
>>> arr2 = pd.array([4, 5, 6])
>>> pd.arrays.IntegerArray._concat_same_type([arr1, arr2])
<IntegerArray>
[1, 2, 3, 4, 5, 6]
Length: 6, dtype: Int64
r   )rV   r  s   &&rQ   rI   ExtensionArray._concat_same_type  s    J "#&&rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   rS     s     ' 'd 'rT   c                	.    V P                   P                  # r   )rH   r   r   s   &rQ   r   ExtensionArray._can_hold_na  s    zz&&&rT   r  c               $    V ^8  d   QhRRRRRR/# )rK   namer   r  rM   rN   rF   rO   )rP   s   "rQ   rR   rS     s)     /S /S/S$(/S	/SrT   c               8    \        RV RV P                   24      h)a  
Return an ExtensionArray performing an accumulation operation.

The underlying data type might change.

Parameters
----------
name : str
    Name of the function, supported values are:
    - cummin
    - cummax
    - cumsum
    - cumprod
skipna : bool, default True
    If True, skip NA values.
**kwargs
    Additional keyword arguments passed to the accumulation function.
    Currently, there is no supported kwarg.

Returns
-------
array
    An array performing the accumulation operation.

Raises
------
NotImplementedError : subclass does not define accumulations

See Also
--------
api.extensions.ExtensionArray._concat_same_type : Concatenate multiple
    array of this dtype.
api.extensions.ExtensionArray.view : Return a view on the array.
api.extensions.ExtensionArray._explode : Transform each element of
    list-like to a row.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr._accumulate(name="cumsum")
<IntegerArray>
[1, 3, 6]
Length: 3, dtype: Int64
zcannot perform z with type )r   rH   )ry   r  r  r  s   &&$,rQ   _accumulateExtensionArray._accumulate  s!    ^ "OD6TZZL"QRRrT   keepdimsc               $    V ^8  d   QhRRRRRR/# )rK   r  r   r  rM   r  rO   )rP   s   "rQ   rR   rS   	  s)     J JJ$(J;?JrT   c          	     *   \        WR4      pVf3   \        R\        V 4      P                   RV P                   RV R24      hV! RRV/VB pV'       d?   VR9   d!   V P                  V.V P                  R7      pV# \        P                  ! V.4      pV# )	az  
Return a scalar result of performing the reduction operation.

Parameters
----------
name : str
    Name of the function, supported values are:
    { any, all, min, max, sum, mean, median, prod,
    std, var, sem, kurt, skew }.
skipna : bool, default True
    If True, skip NaN values.
keepdims : bool, default False
    If False, a scalar is returned.
    If True, the result has dimension with size one along the reduced axis.
**kwargs
    Additional keyword arguments passed to the reduction function.
    Currently, `ddof` is the only supported kwarg.

Returns
-------
scalar or ndarray:
    The result of the reduction operation. The type of the result
    depends on `keepdims`:
    - If `keepdims` is `False`, a scalar value is returned.
    - If `keepdims` is `True`, the result is wrapped in a numpy array with
    a single element.

Raises
------
TypeError : subclass does not define operations

See Also
--------
Series.min : Return the minimum value.
Series.max : Return the maximum value.
Series.sum : Return the sum of values.
Series.mean : Return the mean of values.
Series.median : Return the median of values.
Series.std : Return the standard deviation.
Series.var : Return the variance.
Series.prod : Return the product of values.
Series.sem : Return the standard error of the mean.
Series.kurt : Return the kurtosis.
Series.skew : Return the skewness.

Examples
--------
>>> pd.array([1, 2, 3])._reduce("min")
np.int64(1)
>>> pd.array([1, 2, 3])._reduce("max")
np.int64(3)
>>> pd.array([1, 2, 3])._reduce("sum")
np.int64(6)
>>> pd.array([1, 2, 3])._reduce("mean")
np.float64(2.0)
>>> pd.array([1, 2, 3])._reduce("median")
np.float64(2.0)
N'z' with dtype z does not support operation 'r  rq   rO   )rG  max)getattrri   rs   r  rH   rX   rt   r   )ry   r  r  r  r  r)  r   s   &&$$,  rQ   _reduceExtensionArray._reduce	  s    z t4(<DJ''(djj\ B//3fA7  .V.v.~%,,fXTZZ,H  6(+rT   zClassVar[None]__hash__c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   rS   Y	  s        *  rT   c                .    \         P                  ! V 4      # )a  
Specify how to render our entries in to_json.

Notes
-----
The dtype on the returned ndarray is not restricted, but for non-native
types that are not specifically handled in objToJSON.c, to_json is
liable to raise. In these cases, it may be safer to return an ndarray
of strings.
)rt   ru   r   s   &rQ   _values_for_jsonExtensionArray._values_for_jsonY	  s     zz$rT   c               (    V ^8  d   QhRRRRRRRR/# )rK   encodingr   hash_key
categorizerM   rN   znpt.NDArray[np.uint64]rO   )rP   s   "rQ   rR   rS   f	  s,     )
 )
)
*-)
;?)
	)
rT   c               F    ^ RI Hp V P                  4       w  rVV! WQW#R7      # )a[  
Hook for hash_pandas_object.

Default is to use the values returned by _values_for_factorize.

Parameters
----------
encoding : str
    Encoding for data & key when strings.
hash_key : str
    Hash_key for string key to encode.
categorize : bool
    Whether to first categorize object arrays before hashing. This is more
    efficient when the array contains duplicate values.

Returns
-------
np.ndarray[uint64]
    An array of hashed values.

See Also
--------
api.extensions.ExtensionArray._values_for_factorize : Return an array and
    missing value suitable for factorization.
util.hash_array : Given a 1d array, return an array of hashed values.

Examples
--------
>>> pd.array([1, 2])._hash_pandas_object(
...     encoding="utf-8", hash_key="1000000000000000", categorize=False
... )
array([ 6238072747940578789, 15839785061582574730], dtype=uint64)
)
hash_array)r  r  r  )pandas.core.util.hashingr  rf  )ry   r  r  r  r  r`   _s   &$$$   rQ   _hash_pandas_object"ExtensionArray._hash_pandas_objectf	  s*    H 	8..0	
 	
rT   c                   V ^8  d   QhRR/# )rK   rN   z#tuple[Self, npt.NDArray[np.uint64]]rO   )rP   s   "rQ   rR   rS   	  s     " "= "rT   c                    V P                  4       p\        P                  ! \        V 4      3\        P                  R7      pW3# )a  
Transform each element of list-like to a row.

For arrays that do not contain list-like elements the default
implementation of this method just returns a copy and an array
of ones (unchanged index).

Returns
-------
ExtensionArray
    Array with the exploded values.
np.ndarray[uint64]
    The original lengths of each list-like for determining the
    resulting index.

See Also
--------
Series.explode : The method on the ``Series`` object that this
    extension array method is meant to support.

Examples
--------
>>> import pyarrow as pa
>>> a = pd.array(
...     [[1, 2, 3], [4], [5, 6]], dtype=pd.ArrowDtype(pa.list_(pa.int64()))
... )
>>> a._explode()
(<ArrowExtensionArray>
[1, 2, 3, 4, 5, 6]
Length: 6, dtype: int64[pyarrow], array([3, 1, 2], dtype=int32))
)r   rH   )rI   rt   onesr   uint64)ry   r`   countss   &  rQ   _explodeExtensionArray._explode	  s2    @ D	|299=~rT   c                   V ^8  d   QhRR/# )rK   rN   listrO   )rP   s   "rQ   rR   rS   	  s       rT   c                    V P                   ^8  d    V  Uu. uF  qP                  4       NK  	  up# \        V 4      # u upi )a  
Return a list of the values.

These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)

Returns
-------
list
    Python list of values in array.

See Also
--------
Index.to_list: Return a list of the values in the Index.
Series.to_list: Return a list of the values in the Series.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr.tolist()
[1, 2, 3]
)r   tolistr  )ry   r  s   & rQ   r  ExtensionArray.tolist	  s7    0 99q=(,-1HHJ--Dz .s   <c                    V ^8  d   QhRRRR/# )rK   locr;   rN   r   rO   )rP   s   "rQ   rR   rS   	  s     " "+ " "rT   c                	    \         P                  ! \         P                  ! \        V 4      4      V4      pV P	                  V4      # r   )rt   deletert  r   r(  )ry   r  r+  s   && rQ   r  ExtensionArray.delete	  s.    ))BIIc$i0#6yy!!rT   c                    V ^8  d   QhRRRR/# )rK   r  r   rN   r   rO   )rP   s   "rQ   rR   rS   	  s     )P )P# )P )PrT   c                    \        V\        V 4      4      p\        V 4      P                  V.V P                  R7      p\        V 4      P                  V RV W0VR .4      # )a  
Insert an item at the given position.

Parameters
----------
loc : int
    Index where the `item` needs to be inserted.
item : scalar-like
    Value to be inserted.

Returns
-------
ExtensionArray
    With `item` inserted at `loc`.

See Also
--------
Index.insert: Make new Index inserting new item at location.

Notes
-----
This method should be both type and dtype-preserving.  If the item
cannot be held in an array of this type/dtype, either ValueError or
TypeError should be raised.

The default implementation relies on _from_sequence to raise on invalid
items.

Examples
--------
>>> arr = pd.array([1, 2, 3])
>>> arr.insert(2, -1)
<IntegerArray>
[1, 2, -1, 3]
Length: 4, dtype: Int64
rq   N)r   r   rs   rX   rH   rI  )ry   r  r}   item_arrs   &&& rQ   insertExtensionArray.insert	  sZ    J "#s4y1:,,dV4::,FDz++T$3Z:,NOOrT   c                    V ^8  d   QhRRRR/# )rK   r   r>  rN   r   rO   )rP   s   "rQ   rR   rS    
  s      2 d rT   c                F    \        V4      '       d
   W!,          pMTpW0V&   R# )aq  
Analogue to np.putmask(self, mask, value)

Parameters
----------
mask : np.ndarray[bool]
value : scalar or listlike
    If listlike, must be arraylike with same length as self.

Returns
-------
None

Notes
-----
Unlike np.putmask, we do not repeat listlike values with mismatched length.
'value' should either be a scalar or an arraylike with the same length
as self.
N)r   )ry   r   r   vals   &&& rQ   _putmaskExtensionArray._putmask 
  s"    ( +CCT
rT   c                    V ^8  d   QhRRRR/# )rK   r   r>  rN   r   rO   )rP   s   "rQ   rR   rS   
  s      0 D rT   c                j    V P                  4       p\        V4      '       d   W!( ,          pMTpWCV( &   V# )z
Analogue to np.where(mask, self, value)

Parameters
----------
mask : np.ndarray[bool]
value : scalar or listlike

Returns
-------
same type as self
)rI   r   )ry   r   r   r   r  s   &&&  rQ   _whereExtensionArray._where
  s6     ,CCurT   r  r  average	na_optionr=  pctc          
     ,    V ^8  d   QhRRRRRRRRRR/# )	rK   r  r4   r  r   r  r   rM   r  rO   )rP   s   "rQ   rR   rS   2
  s>     
 
 
 	

 
 
 
rT   c          	     >    V^ 8w  d   \         h\        V VVVVVR7      # )z
See Series.rank.__doc__.
)r  r  r  r   r  )r   r(   )ry   r  r  r  r   r  s   &$$$$$rQ   _rankExtensionArray._rank2
  s0     19%%
 	
rT   c                    V ^8  d   QhRRRR/# )rK   r   r>   rH   r   rO   )rP   s   "rQ   rR   rS   K
  s      5  rT   c                   V P                  . VR7      p\        P                  ! \        P                  ! R4      V4      pVP	                  VRR7      p\        WP4      '       d   W%P                  8w  d   \        RV R24      hV# )z
Create an ExtensionArray with the given shape and dtype.

See also
--------
ExtensionDtype.empty
    ExtensionDtype.empty is the 'official' public version of this API.
rq   Tr!  z5Default 'empty' implementation is invalid for dtype='r  r#  )rX   rt   broadcast_tointpr(  r   rH   r   )rV   r   rH   objtakerr   s   &&&   rQ   _emptyExtensionArray._emptyJ
  sw       5 1U3%D1&&&%<<*?%GwaP  rT   c               $    V ^8  d   QhRRRRRR/# )rK   qsznpt.NDArray[np.float64]interpolationr   rN   r   rO   )rP   s   "rQ   rR   rS   a
  s"     5 53 5C 5D 5rT   c                    \         P                  ! V P                  4       4      p\         P                  ! V 4      p\         P                  p\	        WCWQV4      p\        V 4      P                  V4      # )z
Compute the quantiles of self for each quantile in `qs`.

Parameters
----------
qs : np.ndarray[float64]
interpolation: str

Returns
-------
same type as self
)rt   ru   r   re  r*   rs   rX   )ry   r  r  r   rX  rE  
res_valuess   &&&    rQ   	_quantileExtensionArray._quantilea
  sR     zz$))+&jjVV
':=Q
Dz((44rT   c                    V ^8  d   QhRRRR/# )rK   r:  rM   rN   r   rO   )rP   s   "rQ   rR   rS   u
  s      D D rT   c                "    \        WR7      w  r#V# )z
Returns the mode(s) of the ExtensionArray.

Always returns `ExtensionArray` even if only one value.

Parameters
----------
dropna : bool, default True
    Don't consider counts of NA values.

Returns
-------
same type as self
    Sorted, if possible.
)r:  )r'   )ry   r:  r   r  s   &&  rQ   _modeExtensionArray._modeu
  s    $ -	rT   c                    V ^8  d   QhRRRR/# )rK   ufuncznp.ufuncr  r   rO   )rP   s   "rQ   rR   rS   
  s     U UX Us UrT   c                	   \         ;QJ d    R  V 4       F  '       g   K   RM	  RM! R  V 4       4      '       d   \        # \        P                  ! WV.VO5/ VB pV\        Jd   V# RV9   d   \        P                  ! WV.VO5/ VB # VR8X  d(   \        P
                  ! WV.VO5/ VB pV\        Jd   V# \        P                  ! WV.VO5/ VB # )c              3  X   "   T F   p\        V\        \        \        34      x  K"  	  R # 5ir   )r   r   r   r   ).0r   s   & rQ   	<genexpr>1ExtensionArray.__array_ufunc__.<locals>.<genexpr>
  s%      
PVuJuy(LABBPVr   TFoutreduce)r   NotImplementedr    !maybe_dispatch_ufunc_to_dunder_opdispatch_ufunc_with_outdispatch_reduction_ufuncdefault_array_ufunc)ry   r  r  inputsr  r   s   &&&*, rQ   __array_ufunc__ExtensionArray.__array_ufunc__
  s    3 
PV
333 
PV
 
 
 "!<<
"(
,2
 'MF?44V&,06  X77V&,06F ^+,,T&T6TVTTrT   c                   V ^8  d   QhRR/# )rK   	na_actionzLiteral['ignore'] | NonerO   )rP   s   "rQ   rR   rS   
  s     < <%= <rT   c                    \        WVR7      # )a3  
Map values using an input mapping or function.

Parameters
----------
mapper : function, dict, or Series
    Mapping correspondence.
na_action : {None, 'ignore'}, default None
    If 'ignore', propagate NA values, without passing them to the
    mapping correspondence. If 'ignore' is not supported, a
    ``NotImplementedError`` should be raised.

Returns
-------
Union[ndarray, Index, ExtensionArray]
    The output of the mapping function applied to the array.
    If the function returns a tuple with more than one element
    a MultiIndex will be returned.
)r/  )r&   )ry   mapperr/  s   &&&rQ   mapExtensionArray.map
  s    ( ;;rT   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )rK   howr   has_dropped_narM   	min_countr   ngroupsidsznpt.NDArray[np.intp]rN   r2   rO   )rP   s   "rQ   rR   rS   
  sP     d& d& d& 	d&
 d& d& "d& 
d&rT   c                  ^ RI Hp ^ RIHp VP	                  V4      p	V! WVR7      p
^ p\        V P                  V4      '       d   V
P                  R9   d   \        RV P                   RV R24      hV
P                  R9  dA   V
P                  V
P                  V
P                  \        P                  ! \        4      R4       T pV
P                  R8X  d3   R	pR
V9   g   Q hVR
,          '       d   V^ 8X  d   VP                  R	4      pVP                  \        \        P                  R7      pM\!        RV P                   24      hV
P"                  ! V3RVRVRVRRRV/VB pV
P                  V
P$                  9   d   V# \        V P                  V4      '       d/   V P                  pVP'                  4       pVP)                  WR7      # \         h)a3  
Dispatch GroupBy reduction or transformation operation.

This is an *experimental* API to allow ExtensionArray authors to implement
reductions and transformations. The API is subject to change.

Parameters
----------
how : {'any', 'all', 'sum', 'prod', 'min', 'max', 'mean', 'median',
       'median', 'var', 'std', 'sem', 'nth', 'last', 'ohlc',
       'cumprod', 'cumsum', 'cummin', 'cummax', 'rank'}
has_dropped_na : bool
min_count : int
ngroups : int
ids : np.ndarray[np.intp]
    ids[i] gives the integer label for the group that self[i] belongs to.
**kwargs : operation-specific
    'any', 'all' -> ['skipna']
    'var', 'std', 'sem' -> ['ddof']
    'cumprod', 'cumsum', 'cummin', 'cummax' -> ['skipna']
    'rank' -> ['ties_method', 'ascending', 'na_option', 'pct']

Returns
-------
np.ndarray or ExtensionArray
)StringDtype)WrappedCythonOp)r5  r   r6  zdtype 'z' does not support operation 'r  Fsum r  )r   z,function is not implemented for this dtype: r7  r8  comp_idsr   Ninitialrq   )
r   meanmedianr2  cumprodstdsemvarskewkurt)r   r%  )pandas.core.arrays.string_r;  pandas.core.groupby.opsr<  get_kind_from_howr   rH   r5  ri   _get_cython_functionr   rt   rv   r5  r   re  r   _cython_op_ndim_compatcast_blocklistr   rX   )ry   r5  r6  r7  r8  r9  r  r;  r<  r   opr@  rX  npvaluesr  rH   string_array_clss   &$$$$$,          rQ   _groupby_opExtensionArray._groupby_op
  s   H 	;;005Odjj+..vv    djj\)GuAN  vv^+''&9I5QCvv  6)))(##	Q**R.C||FRVV|<H%>tzzlK  ..

 
 	

 
 
 

 66R&&& djj+..JJE$99;#22:2KK &%rT   rO   r   ).)T)NT)first)r  N)leftN)F)C)Vr  
__module____qualname____firstlineno____doc___typ__pandas_priority__r   classmethodrX   r]   rb   rm   rz   r	   r   r   r   r   r   r   r   r}   r   r   r   propertyrH   r   r   r   r   r   r   r   r   r  r  r  r  r-  r5  r:  r#   rM  r)   rW  r^  r%   rf  rm  rD   ro  r|  r(  rI   r   r  r  r  r  r  r  r  rI  r   r   r  r  __annotations__r  r  r  r  r  r  r  r  r  r  r  r  r,  r2  rR  __static_attributes__rO   rT   rQ   rF   rF   r   s   Ur D I #'/3#'BG#' #'J %'=B%' %'N ' ':  >OB : := =(B4Sl(((
( 0h '+>>	(\ ( (&  & # #  " ( (, O OT TJ JO:b (D ' '!F6
 6
 %	6

 "6
p *D *Dl
\T !	T
 ;?T TlHT"6 =DA.F>4:Ax29h.@+B?!B(. *T,\%V_( !	_(
 _(B(<  ? ?(\/ ;7"/j(    > $' $'V ' '/S+//SbJ+/JBGJ^  )
V"H8")PV6.
 
  	

  
 
 
0  ,5(*U4<2d& d&rT   rF   c                      ] tR tRt]RR/R R ll4       t]R R l4       tRR/R	 R
 llt]RR/R R ll4       t]R R l4       tRR/R R lltRtR# )ExtensionArraySupportsAnyAlli$  r  .c                    V ^8  d   QhRRRR/# rK   r  zLiteral[True]rN   rM   rO   )rP   s   "rQ   rR   )ExtensionArraySupportsAnyAll.__annotate__&      >>]>T>rT   c               	    R # r   rO   r  s   &$rQ   r    ExtensionArraySupportsAnyAll.any%      ;>rT   c                    V ^8  d   QhRRRR/# rK   r  rM   rN   zbool | NATyperO   )rP   s   "rQ   rR   re  )      88T8m8rT   c               	    R # r   rO   r  s   &$rQ   r   rh  (      58rT   Tc                    V ^8  d   QhRRRR/# rk  rO   )rP   s   "rQ   rR   re  +       ( (T (] (rT   c               	    \        V 4      hr   r   r  s   &$rQ   r   rh  +      !$''rT   c                    V ^8  d   QhRRRR/# rd  rO   )rP   s   "rQ   rR   re  /  rf  rT   c               	    R # r   rO   r  s   &$rQ   r%   ExtensionArraySupportsAnyAll.all.  ri  rT   c                    V ^8  d   QhRRRR/# rk  rO   )rP   s   "rQ   rR   re  2  rl  rT   c               	    R # r   rO   r  s   &$rQ   r%  ru  1  rn  rT   c                    V ^8  d   QhRRRR/# rk  rO   )rP   s   "rQ   rR   re  4  rp  rT   c               	    \        V 4      hr   r   r  s   &$rQ   r%  ru  4  rr  rT   rO   N)r  rW  rX  rY  r	   r   r%  r`  rO   rT   rQ   rb  rb  $  sc    >S> >8 8(D ( >S> >8 8(D ( (rT   rb  c                      ] tR tRtRt]R 4       t]R R l4       t]R 4       t]R R l4       t	]R	 4       t
]R
 R l4       tRtR# )ExtensionOpsMixini8  z
A base class for linking the operators to their dunder names.

.. note::

   You may want to set ``__array_priority__`` if you want your
   implementation to be called when involved in binary operations
   with NumPy arrays.
c                	    \        V 4      hr   r   rV   rO  s   &&rQ   _create_arithmetic_method+ExtensionOpsMixin._create_arithmetic_methodC      !#&&rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   ExtensionOpsMixin.__annotate__H  s     V VD VrT   c                	2   \        V R V P                  \        P                  4      4       \        V RV P                  \        P
                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V R	V P                  \        P                  4      4       \        V R
V P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                   4      4       \        V RV P                  \        P"                  4      4       \        V RV P                  \$        4      4       \        V RV P                  \        P&                  4      4       R# )__add____radd____sub____rsub____mul____rmul____pow____rpow____mod____rmod____floordiv____rfloordiv____truediv____rtruediv__
__divmod____rdivmod__N)setattrr~  operatoraddr"   raddsubrsubmulrmulpowrpowmodrmodfloordiv	rfloordivtruedivrtruedivdivmodrdivmodrV   s   &rQ   _add_arithmetic_ops%ExtensionOpsMixin._add_arithmetic_opsG  s   Y = =hll KLZ!>!>y~~!NOY = =hll KLZ!>!>y~~!NOY = =hll KLZ!>!>y~~!NOY = =hll KLZ!>!>y~~!NOY = =hll KLZ!>!>y~~!NO^S%B%B8CTCT%UV#"?"?	@S@S"T	
 	]C$A$A(BRBR$ST^S%B%B9CUCU%VW\3#@#@#HI]C$A$A)BSBS$TUrT   c                	    \        V 4      hr   r   r}  s   &&rQ   _create_comparison_method+ExtensionOpsMixin._create_comparison_method\  r  rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   r  a  s     K KD KrT   c                	   \        V R V P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P
                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       R# )r   r   __lt____gt____le____ge__N)	r  r  r  eqneltgtleger  s   &rQ   _add_comparison_ops%ExtensionOpsMixin._add_comparison_ops`  s    Xs<<X[[IJXs<<X[[IJXs<<X[[IJXs<<X[[IJXs<<X[[IJXs<<X[[IJrT   c                	    \        V 4      hr   r   r}  s   &&rQ   _create_logical_method(ExtensionOpsMixin._create_logical_methodi  r  rT   c                   V ^8  d   QhRR/# r   rO   )rP   s   "rQ   rR   r  n  s     M M MrT   c                	   \        V R V P                  \        P                  4      4       \        V RV P                  \        P
                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       \        V RV P                  \        P                  4      4       R# )__and____rand____or____ror____xor____rxor__N)
r  r  r  and_r"   rand_or_ror_xorrxorr  s   &rQ   _add_logical_ops"ExtensionOpsMixin._add_logical_opsm  s    Y : :8== IJZ!;!;IOO!LMXs99(,,GHY : :9>> JKY : :8<< HIZ!;!;INN!KLrT   rO   N)r  rW  rX  rY  rZ  r]  r~  r  r  r  r  r  r`  rO   rT   rQ   r{  r{  8  s     ' ' V V( ' ' K K ' ' M MrT   r{  c                  T    ] tR tRtRt]R	R R ll4       t]R 4       t]R 4       tRt	R# )
ExtensionScalarOpsMixiniw  a  
A mixin for defining ops on an ExtensionArray.

It is assumed that the underlying scalar objects have the operators
already defined.

Notes
-----
If you have defined a subclass MyExtensionArray(ExtensionArray), then
use MyExtensionArray(ExtensionArray, ExtensionScalarOpsMixin) to
get the arithmetic operators.  After the definition of MyExtensionArray,
insert the lines

MyExtensionArray._add_arithmetic_ops()
MyExtensionArray._add_comparison_ops()

to link the operators to your class.

.. note::

   You may want to set ``__array_priority__`` if you want your
   implementation to be called when involved in binary operations
   with NumPy arrays.
Nc                   V ^8  d   QhRR/# )rK   coerce_to_dtyperM   rO   )rP   s   "rQ   rR   $ExtensionScalarOpsMixin.__annotate__  s     N7 N7 N7rT   c                P   aaa VVV3R lpRSP                    R2p\        WEV 4      # )a  
A class method that returns a method that will correspond to an
operator for an ExtensionArray subclass, by dispatching to the
relevant operator defined on the individual elements of the
ExtensionArray.

Parameters
----------
op : function
    An operator that takes arguments op(a, b)
coerce_to_dtype : bool, default True
    boolean indicating whether to attempt to convert
    the result to the underlying ExtensionArray dtype.
    If it's not possible to create a new ExtensionArray with the
    values, an ndarray is returned instead.

Returns
-------
Callable[[Any, Any], Union[ndarray, ExtensionArray]]
    A method that can be bound to a class. When used, the method
    receives the two arguments, one of which is the instance of
    this class, and should return an ExtensionArray or an ndarray.

    Returning an ndarray may be necessary when the result of the
    `op` cannot be stored in the ExtensionArray. The dtype of the
    ndarray uses NumPy's normal inference rules.

Examples
--------
Given an ExtensionArray subclass called MyExtensionArray, use

    __add__ = cls._create_method(operator.add)

in the class definition of MyExtensionArray to create the operator
for addition, that will be based on the operator implementation
of the underlying elements of the ExtensionArray
c                H  <a  V 3R  lp\        V\        \        \        34      '       d   \        # S pV! V4      p\        W4RR7       UUu. uF  w  rVS
! WV4      NK  	  pppV	VV 3R lpS
P                  R9   d   \        VRR/ w  rVV! V4      V! V4      3# V! V4      # u uppi )c                   < \        V \        4      '       g   \        V 4      '       d   T pV# V .\        S4      ,          pV# r   )r   rF   r   r   )paramovaluesry   s   & rQ   convert_valuesNExtensionScalarOpsMixin._create_method.<locals>._binop.<locals>.convert_values  s=    e^44U8K8K#G   %gD	1GrT   T)strictc                   < S'       dE   SP                  V 4      p\        V\        S4      4      '       g   \        P                  ! V 4      pV# \        P                  ! V SR 7      pV# )rq   )rz   r   rs   rt   ru   )rX  resr  result_dtypery   s   & rQ   _maybe_convertNExtensionScalarOpsMixin._create_method.<locals>._binop.<locals>._maybe_convert  sT    " 55c:C%c4:66 jjo 
 **S=C
rT   r  >   r  r  )r   r   r   r   r&  zipr  )ry   r   r  lvaluesrvaluesrK  rL  r  r  r  rO  r  s   f&       rQ   _binop6ExtensionScalarOpsMixin._create_method.<locals>._binop  s     %)X|!DEE%%G$U+G +.gt*LM*L2a8*LCM {{33C--%a(.*;;;!#&&' Ns   
B__)r  r   )rV   rO  r  r  r  op_names   &fff  rQ   _create_method&ExtensionScalarOpsMixin._create_method  s+    P$	'L r{{m2& #66rT   c                	$    V P                  V4      # r   )r  r}  s   &&rQ   r~  1ExtensionScalarOpsMixin._create_arithmetic_method  s    !!"%%rT   c                	2    V P                  VR \        R7      # )F)r  r  )r  rM   r}  s   &&rQ   r  1ExtensionScalarOpsMixin._create_comparison_method  s    !!"e$!OOrT   rO   )TN)
r  rW  rX  rY  rZ  r]  r  r~  r  r`  rO   rT   rQ   r  r  w  sH    2 N7 N7` & & P PrT   r  )e__conditional_annotations__rZ  
__future__r   r  typingr   r   r   r   r   r   r	   rk   numpyrt   pandas._libsr
   r&  r   pandas.compatr   pandas.compat.numpyr   r   pandas.errorsr   pandas.util._decoratorsr   r   pandas.util._exceptionsr   pandas.util._validatorsr   r   pandas.core.dtypes.astyper   pandas.core.dtypes.commonr   r   r   r   pandas.core.dtypes.dtypesr   pandas.core.dtypes.genericr   r   r   pandas.core.dtypes.missingr   pandas.corer    r!   r"   r{  r#   r$   r%   r&   r'   r(   r)    pandas.core.array_algos.quantiler*   pandas.core.missingr+   pandas.core.sortingr,   r-   collections.abcr.   r/   r0   pandas._libs.missingr1   pandas._typingr2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   pandasrB   rC   rD   r_  rF   rb  r{  r  )r  s   @rQ   <module>r     s7   #      , . - 5
 5  5 
 , 
   @ 3
   ,    &
 02 n 1 #$n*& n*& %n*&bU(> ((<M <M~ #$qP/ qP %qPrT   