Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/core/internals/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/core/internals/__pycache__/blocks.cpython-312.pyc

�

Mٜg����B�ddlmZddlmZddlZddlZddlmZmZm	Z	m
Z
mZmZddl
Z
ddlZddlZddlmZmZmZddlmZmZmZddlmZmZddlmZdd	lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd
l,m-Z-ddl.m/Z/ddl0m1Z1dd
l2m3Z3ddl4m5Z5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=ddl>m?Z?m@Z@mAZAmBZBmCZCmDZDddlEmFZFmGZGmHZHmIZImJZJddlKmLZLmMZMmNZNmOZOddlPmQZQmRZRmSZSddlTmUZUddlVmWcmXZYddlZm[Z[m\Z\m]Z]m^Z^m_Z_ddl`maZaddlbmcZcmdZdmeZeddlfmgZgddlhmiZimjZjmkZkmlZlmmZmmnZnmoZoddlpmqZqddlrmWcmsZtddlumvZvddlwmxZxmyZyddlzm{Z{ddl|m}Z}erddl~mZm�Z�dd l�m�Z�dd!l�m�Z�e�j
d"�Z�d#Z�d$Z�dBd%�Z�Gd&�d'eqe�j�Z�Gd(�d)e��Z�Gd*�d+e��Z�Gd,�d-e��Z�Gd.�d/e��Z�Gd0�d1e��Z�Gd2�d3e��Z�Gd4�d5e��Z�Gd6�d7e��Z�dCd8�Z�dDd9�Z�	dE					dFd:�Z�dd;�							dGd<�Z�dHd=�Z�								dId>�Z�dEdJd?�Z�dKdLd@�Z�dCdA�Z�y)M�)�annotations)�wrapsN)�
TYPE_CHECKING�Any�Callable�Literal�cast�final)�
get_option�using_copy_on_write�warn_copy_on_write)�NaT�	internals�lib)�BlockPlacement�BlockValuesRefs)�NA)�	ArrayLike�AxisInt�DtypeBackend�DtypeObj�F�
FillnaOptions�IgnoreRaise�InterpolateOptions�QuantileInterpolation�Self�Shape�npt��AbstractMethodError)�cache_readonly)�find_stack_level)�validate_bool_kwarg)�astype_array_safe�astype_is_view)�LossySetitemError�can_hold_element�convert_dtypes�find_result_type�maybe_downcast_to_dtype�np_can_hold_element)�is_1d_only_ea_dtype�is_float_dtype�is_integer_dtype�is_list_like�	is_scalar�is_string_dtype)�DatetimeTZDtype�ExtensionDtype�
IntervalDtype�NumpyEADtype�PeriodDtype)�ABCDataFrame�ABCIndex�ABCNumpyExtensionArray�	ABCSeries)�is_valid_na_for_dtype�isna�na_value_for_dtype)�missing)�extract_bool_array�putmask_inplace�putmask_without_repeat�setitem_datetimelike_compat�validate_putmask)�quantile_compat)�compare_or_regex_search�
replace_regex�should_use_regex)�shift)�Categorical�
DatetimeArray�ExtensionArray�
IntervalArray�NumpyExtensionArray�PeriodArray�TimedeltaArray)�PandasObject)�expressions)�ensure_wrapped_if_datetimelike�
extract_array)�check_setitem_lengths)�get_values_for_csv)�Iterable�Sequence)�Index)�NDArrayBackedExtensionArray�objectaOSetting a value on a view: behaviour will change in pandas 3.0.
You are mutating a Series or DataFrame object, and currently this mutation will
also have effect on other Series or DataFrame objects that share data with this
object. In pandas 3.0 (with Copy-on-Write), updating one Series or DataFrame object
will never modify another.
aSetting a value on a view: behaviour will change in pandas 3.0.
Currently, the mutation will also have effect on the object that shares data
with this object. For example, when setting a value in a Series that was
extracted from a column of a DataFrame, that DataFrame will also be updated:

    ser = df["col"]
    ser[0] = 0     <--- in pandas 2, this also updates `df`

In pandas 3.0 (with Copy-on-Write), updating one Series/DataFrame will never
modify another, and thus in the example above, `df` will not be changed.
c�L��t��d�fd��}tt|�S)zp
    If we have a multi-column block, split and operate block-wise.  Otherwise
    use the original method.
    c���|jdk(s|jddk(r�|g|��i|��S|j�g|��i|��S)N�r)�ndim�shape�split_and_operate)�self�args�kwargs�meths   ��G/usr/local/lib/python3.12/site-packages/pandas/core/internals/blocks.py�newfunczmaybe_split.<locals>.newfunc�sQ����9�9��>�T�Z�Z��]�a�/���.�t�.�v�.�.�*�4�)�)�$�@��@��@�@���return�list[Block])rr	r)rergs` rf�maybe_splitrl�s,����4�[�A��A���7��rhc	��eZdZUdZded<ded<ded<ded	<d
ZdZeedTd���Z	eedTd
���Z
eedTd���ZeedTd���Zeed���Z
eedTd���ZeedTd���Zed��Zeed���Zed��ZedUd��Zej*dVd��Ze		dW					dXd��Ze		dW					dYd��ZedZd��Zed[d��Zed\d��Zed]d��Ze	d^							d_d��Zed`d ��Zedad!��Zedbd"��Zedbd#��Z edcd$��Z!edbd%��Z"edbd&��Z#ed^ddd'��Z$e								ded(��Z%ee&d^dfd)���Z'ed*dd+�					dgd,��Z(						dh																	did-�Z)eedjd.���Z*e				dk											dld/��Z+ed0dd1�			dmd2��Z,edndod3��Z-edpd4��Z.edqd5��Z/e				dr							dsd6��Z0e				dr					dtd7��Z1e				du											dvd8��Z2e			dw									dxd9��Z3dyd:�Z4d;�Z5edzd<��Z6d{d=�Z7				d|d>�Z8d^d}d?�Z9ede:jvf							d~d@��Z<				ddA�Z=d^d�dB�Z>	d�			dfdC�Z?	d�					d�dD�Z@					d�							d�dE�ZAdFdddddddG�															d�dH�ZBedddIdddddJ�																	d�dK��ZCed�dL��ZDd�d�dM�ZEe	d�					d�dN��ZFed^d�dO��ZGdbdP�ZHedTdQ��ZIed�dR��ZJd�d�dS�ZKy)��Blockz�
    Canonical n-dimensional unit of homogeneous dtype contained in a pandas
    data structure

    Index-ignorant; let the container take care of that
    znp.ndarray | ExtensionArray�values�intr_r�refsr�__init__�Fc�`�|j}t|t�xst|t�S)z�
        We validate dimension for blocks that can hold 2D values, which for now
        means numpy dtypes or DatetimeTZDtype.
        )�dtype�
isinstancer4r3�rbrus  rf�_validate_ndimzBlock._validate_ndim�s0���
�
���e�^�4�4�
�
��?�9
�	
rhc�<�|jjtk(S�N)roru�
_dtype_obj�rbs rf�	is_objectzBlock.is_object�s���{�{� � �J�.�.rhc�V�tj|jj�Srz)r�is_np_dtyperorur|s rf�is_extensionzBlock.is_extension�s ���?�?�4�;�;�#4�#4�5�5�5rhc��|jSrz)r�r|s rf�_can_consolidatezBlock._can_consolidate�s���$�$�$�$rhc�F�|j|jjfSrz)r�ru�namer|s rf�_consolidate_keyzBlock._consolidate_key�s���$�$�d�j�j�o�o�5�5rhc��|j}t|tj�r|jdvS|jS)z7
        Can we store NA values in this Block?
        �iub)rurv�np�kind�_can_hold_narws  rfr�zBlock._can_hold_na�s6���
�
���e�R�X�X�&��:�:�U�*�*��!�!�!rhc�b�|jjtjt�k(S)z^
        We can be bool if a) we are bool dtype or b) object dtype with bool objects.
        )rorur��boolr|s rf�is_boolz
Block.is_bool�s!���{�{� � �B�H�H�T�N�2�2rhc�,�t|j�Srz)�external_valuesror|s rfr�zBlock.external_values�s���t�{�{�+�+rhc�0�t|jd��S)NF)�compat)r>rur|s rf�
fill_valuezBlock.fill_value�s��"�$�*�*�U�;�;rhc�p�|jtk7r"t||j�r|j}|Srz)rur{r<r��rb�values  rf�_standardize_fill_valuezBlock._standardize_fill_values,���:�:��#�(=�e�T�Z�Z�(P��O�O�E��rhc��|jSrz��	_mgr_locsr|s rf�mgr_locszBlock.mgr_locs
s���~�~�rhc��||_yrzr�)rb�new_mgr_locss  rfr�zBlock.mgr_locss	��%��rhNc��|�|j}|jrt||j��}t	|||j|��S)zm
        Create a new block, with type inference propagate any values that are
        not specified
        �r_��	placementr_rq)r�r��ensure_block_shaper_�	new_block�rbror�rqs    rf�
make_blockzBlock.make_blocksA�������I����'��T�Y�Y�?�F���9�4�9�9�4�P�Prhc�\�|�|j}t|�|||j|��S)z2Wrap given values in a block of same type as self.r�)r��typer_r�s    rf�make_block_same_classzBlock.make_block_same_class$s0�������I��t�D�z�&�I�D�I�I�D�Q�Qrhc�P�t|�j}|jdk(r|�dt|��d|j��}|Sdj|jD�cgc]
}t|���c}�}|�d|jj�d|�d|j��}|Scc}w)Nr^z: z dtype: z x z, z	, dtype: )
r��__name__r_�lenru�joinr`�strr��indexer)rbr��result�sr`s     rf�__repr__zBlock.__repr__4s����D�z�"�"���9�9��>��v�R��D�	�{�(�4�:�:�,�?�F�
�
��J�J��
�
�;�
�1��A��
�;�<�E��v�R��
�
� 5� 5�6�b���y�����U�F��
�� <s�B#c�,�t|j�Srz)r�ror|s rf�__len__z
Block.__len__@s���4�;�;��rhc��|j|}|j|�}|j}t|�|||j|��S)zC
        Perform __getitem__-like, return result as block.
        �rq)r��_slicerqr�r_)rb�slcr��
new_valuesrqs     rf�slice_block_columnszBlock.slice_block_columnsDsD��
�~�~�c�*���[�[��%�
��y�y���t�D�z�*�l�D�I�I�D�I�Irhc��|j|}|j|�}t|�|||jd��S�z
        Perform __getitem__-like, return result as block.

        Only supports slices that preserve dimensionality.
        Nr�)r�r�r�r_)rb�indicesr�r�s    rf�take_block_columnszBlock.take_block_columnsOs;���~�~�g�.���[�[��)�
��t�D�z�*�l�D�I�I�D�I�Irhc��|j|�}|r|jj�r|jnd}t|�|||j|��Sr�)r�rq�
has_referencer�r_)rb�slicerr��ref_inplace_opr�rqs      rf�getitem_block_columnszBlock.getitem_block_columns^sJ���[�[��(�
� .�$�)�)�2I�2I�2K�t�y�y�QU���t�D�z�*�l�D�I�I�D�I�Irhc�H�t|d��}t|j|�S)z#require the same dtype as ourselvesT��
extract_numpy)rTr(ro)rb�elements  rf�_can_hold_elementzBlock._can_hold_elementks!�� ��t�<������W�5�5rhc�4�|j|jk(S)z�
        Should we set self.values[indexer] = value inplace or do we need to cast?

        Parameters
        ----------
        value : np.ndarray or ExtensionArray

        Returns
        -------
        bool
        �rur�s  rf�should_storezBlock.should_storeqs���{�{�d�j�j�(�(rhc�`�||jfi|��}t|�}|j|�S)z[
        apply the function to my values; return a block if we are not
        one
        )ro�maybe_coerce_values�_split_op_result)rb�funcrdr�s    rf�applyzBlock.apply�s2���d�k�k�,�V�,��$�V�,���$�$�V�,�,rhc���|jdk(sJ�||j�}|jjdk(r|}n|jdd�}|j|�}|gS)N�r^���)r_ro�reshaper�)rbr�r��
res_values�nbs     rf�reducezBlock.reduce�s^���y�y�A�~��~��d�k�k�"���;�;���q� ��J�����A�.�J�
�_�_�Z�
(���t�rhc�b�|jdkDr�t|jt�rsg}t	|j
�D]W\}}t
|j�s	|||dz}n||}t|�}|j||��}|j|��Y|S|j|�}|gS)Nr^)ror�)
r_rvrur4�	enumerater�r-rr��append)	rbr��nbs�i�loc�vals�bp�blockr�s	         rfr�zBlock._split_op_result�s����;�;��?�z�&�,�,��G��C�#�D�N�N�3���3�*�6�<�<�8�!�!�a�!�e�,�D�!�!�9�D�#�C�(�����t�r��B���
�
�5�!�4��J�
�_�_�V�
$���t�rhc��|jdk(sJ�g}t|j�D]\\}}|jt	||dz�}t|�}t
|�||d|j��}|j|��^|S)zD
        Split a block into a list of single-column blocks.
        r�r^r�)	r_r�r�ro�slicerr�rqr�)rb�
new_blocksr��ref_locr�r�r�s       rf�_splitzBlock._split�s���
�y�y�A�~��~��
�#�D�N�N�3�J�A�w��;�;�u�Q��A���/�D���(�B���d��D�B�Q�T�Y�Y�G�B����b�!�4��rhc��|jdk(r|jddk7sJ�g}|j�D]}||g|��i|��}|j|��!|S)z�
        Split the block and apply func column-by-column.

        Parameters
        ----------
        func : Block method
        *args
        **kwargs

        Returns
        -------
        List[Block]
        r�rr^)r_r`r��extend)rbr�rcrd�
res_blocksr��rbss       rfrazBlock.split_and_operate�sc���y�y�A�~�$�*�*�Q�-�1�"4�4�4��
��+�+�-�B��r�+�D�+�F�+�C����c�"� ��rhc��t|jj|�}||jk(rtd��t	|�rtt|jj�rUt
|�rJ|turBt|tjtjf�rtj|�sd}ntt|tj�rZ|jdk(rKt|jj�r,t|j�rt!j"|�rd}|r?t%j&d|�d|jj�d�t(t+���|jj|k(r&td|�d	|jj�d
���|j-|d��S)z�
        coerce the current block to a dtype compat for other
        we will return a block, possibly object, and not raise

        we can also safely try to coerce to the same dtype
        and will receive the same block
        z\Something has gone wrong, please report a bug at https://github.com/pandas-dev/pandas/issuesFr^zrSetting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'z' has dtype incompatible with z5, please explicitly cast to a compatible dtype first.��
stacklevelzDid not expect new dtype z to equal self.dtype zE. Please report a bug at https://github.com/pandas-dev/pandas/issues.)�copy)r*roru�AssertionErrorr1r/r=rrvr��
datetime64�timedelta64�isnat�ndarrayr_r.r�has_only_ints_or_nan�warnings�warn�
FutureWarningr#�astype)rb�other�warn_on_upcast�	new_dtypes    rf�coerce_to_target_dtypezBlock.coerce_to_target_dtype�ss��%�T�[�[�%6�%6��>�	���
�
�"� �>��
�
�e�� ����!2�!2�3��U���S� ��5�2�=�=�"�.�.�"A�B�r�x�x�PU��#�N��u�b�j�j�)��
�
�a�� ����!2�!2�3��u�{�{�+��(�(��/�"�N���M�M���� >�t�{�{�?P�?P�>Q�RF�F��+�-�

��;�;���	�)� �+�I�;�6K��;�;�$�$�%�&?�?��
�
�{�{�9�5�{�1�1rhc	��|dur|S|jtk(r�|dk(r
td�r|St|D�cgc]}|j	||����c}�}|dk(rWt|�t|�k7st
d�t||�D��s$tjdtt���|S|�|S|dk(rtd�d	ur|St|D�cgc]}|j||���c}�}|dk(rWt|�t|�k7std
�t||�D��r$tjdtt���|Scc}wcc}w)NF�fillna�future.no_silent_downcasting)�	using_cowr�c3�TK�|] \}}|j|jk(���"y�wrzr�)�.0�x�ys   rf�	<genexpr>z(Block._maybe_downcast.<locals>.<genexpr>.s&����6�3C�4�1�a�A�G�G�q�w�w�&�3C���&(z�Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`r��whereTc3�TK�|] \}}|j|jk7���"y�wrzr�)r��left�rights   rfrz(Block._maybe_downcast.<locals>.<genexpr>Ms&����.�=M�k�d�E��
�
�e�k�k�)�=M�ra|Downcasting behavior in Series and DataFrame methods 'where', 'mask', and 'clip' is deprecated. In a future version this will not infer object dtypes or cast all-round floats to integers. Instead call result.infer_objects(copy=False) for object inference, or cast round floats explicitly. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`)rur{r�
extend_blocks�convertr��all�zipr�r�r�r#�_downcast_2d�any)rb�blocks�downcastr��caller�blkr��bs        rf�_maybe_downcastzBlock._maybe_downcastsn���u���M��:�:��#���!�j�1O�&P��
��QW�X�QW�#����y�9�}��E�QW�X��C���!��s�8�s�6�{�*�#�6�36�s�F�3C�6�3��M�M�P�&�#3�#5�	��J�
�
��M�
�w�
�:�.L�#M�QU�#U��M��f� U�f������)�!D�f� U�V�C��W���6�{�c�#�h�&�#�.�=@���=M�.�+�
�
�
�L�"�/�1���
��iY��2!Vs�E�Ec��t|j|��}t|�}||jur|jnd}|j	||��gS)zs
        downcast specialized to 2D case post-validation.

        Refactored to allow use of maybe_split.
        r�Nr�)r+ror�rqr�)rbrur�r�rqs     rfrzBlock._downcast_2dasJ��-�T�[�[��F�
�(��4�
�&�$�+�+�5�t�y�y�4�����
���6�7�7rhT�r�r�c��|js-|s|r|jd��gS|r|j�gS|gS|jdk7rs|jddk7ra|j	t
j||��}td�|D��r+|r|jd��gS|r|j�gS|gS|S|j}|jdk(r|d}tj|d�	�}d
}|r||ur|j�}n||ur|j}t||j�}t|�}|j||��gS)zz
        Attempt to coerce any object types to better types. Return a copy
        of the block (if copy = True).
        F��deepr^rrc3�NK�|]}|jjdk(���y�w)�ON�rur�)r�rs  rfrz Block.convert.<locals>.<genexpr>�s����;�F�S�3�9�9�>�>�S�(�F�s�#%r�T)�convert_non_numericNr�)r}r�r_r`rarnr	r
ror�maybe_convert_objectsrqr�r�r�)rbr�r�rror�rqs       rfr	z
Block.convertnsK���~�~��I��	�	�u�	�-�.�.�$(�D�I�I�K�=�4�t�f�4��9�9��>�d�j�j��m�q�0��+�+��
�
�D�I�,��F��;�F�;�;�� �I�I�5�I�1�2�2�(,��	�	��}�8�4�&�8��M������;�;�!���A�Y�F��.�.�� $�
�
����J�&�(�����J�
�6�
!��9�9�D�'�
�D�I�I�>�
�(��4�
����
���6�7�7rhc	
���|r �jr�jd|��}	n�g}	t||||g�s |	D�
cgc]}
|
j|����c}
Sg}|	D]�}|jdk(s�j
ddk(r|gn|j
�}
|
D�
cgc]}
t|
j||||||���}}
t�fd�|D��r"|j|j|�����t||
�D]5\}}
|j|
j|||
jdk7����7��|Scc}
wcc}
w)NFrrr^rc3�<�K�|]}|�jk(���y�wrzr�)r�rurbs  �rfrz'Block.convert_dtypes.<locals>.<genexpr>�s�����;�F�5�5�D�J�J�&�F�s�)rur��squeeze)
r}r	r
r�r_r`r�r)ror
r�rr�)rbr�r��
infer_objects�convert_string�convert_integer�convert_boolean�convert_floating�
dtype_backend�blksrr�r�sub_blks�dtypesrus`               rfr)zBlock.convert_dtypes�sK����T�^�^��<�<�U�i�<�@�D��6�D��
����P�
�04�4�t�!�A�F�F��F�%�t�4�4����C� #���A�
����A��!�1C��u�����H�"��"�A���H�H�"�#�#�$�!�!��"�
���;�F�;�;��
�
�3�8�8��8�.�/�����1���q��
�
�1�8�8�%�d�A�F�F�a�K�8�P�Q�2�)�,�
��35��s�D7�"D<c�.�|jjSrz)rorur|s rfruzBlock.dtype�s���{�{� � � rhc
�@�|j}|r@|jdk(r1t|�r&|jddk7rt	d��|ddd�f}t||||��}t
|�}d}|s|s,t|j|j�r|j}|j||��}	|	j|jk7rWtd|�d	|jj�d
|j�d|	jj�d
|	j�d���|	S)
ax
        Coerce to the new dtype.

        Parameters
        ----------
        dtype : np.dtype or ExtensionDtype
        copy : bool, default False
            copy if indicated
        errors : str, {'raise', 'ignore'}, default 'raise'
            - ``raise`` : allow exceptions to be raised
            - ``ignore`` : suppress exceptions. On error return original object
        using_cow: bool, default False
            Signaling if copy on write copy logic is used.
        squeeze : bool, default False
            squeeze values to ndim=1 if only one column is given

        Returns
        -------
        Block
        r�rr^z*Can not squeeze with more than one column.N)r��errorsr�zcannot set astype for copy = [z
] for dtype (z [z]) to different shape (z]))
ror_r-r`�
ValueErrorr%r�r&rurqr��	TypeErrorr�)
rbrur�r,r�r ror�rq�newbs
          rfr�zBlock.astype�s
��:�����v�{�{�a�'�,?��,F��|�|�A��!�#� �!M�N�N��A�q�D�\�F�&�v�u�4��O�
�(��4�
����T�~�f�l�l�J�DT�DT�'U��9�9�D����z���5���:�:����#��0���7��J�J�O�O�$�B�t�z�z�l�3��J�J�O�O�$�B�t�z�z�l�"�6��
�
�rh�nan)�na_rep�quotingc�Z�t|j|||||��}|j|�S)z"convert to our native types format)r1r2�float_format�date_format�decimal)rVror�)rbr4r5r6r1r2r�s       rfrVzBlock.get_values_for_csvs5��
$��K�K���%�#��

�����v�&�&rhc��|j}|r|j�}d}n|j}t|�||j|j
|��S)zcopy constructorNr�)ror�rqr�r�r_)rbrrorqs    rfr�z
Block.copysI��������[�[�]�F��D��9�9�D��t�D�z�&�D�N�N����QU�V�Vrhc��|r0|r.|jj�}|j|��}|S|r|n|j�}|S)Nr)rqr�r�)rbr��inplacerrs     rf�_maybe_copyzBlock._maybe_copy%sF�����9�9�*�*�,�D��)�)��)�&�C��
�"�$�t�y�y�{�C��
rhc�t�d}|}|r.|r |jj�rd}||fS|j}||fS)NT)rqr�)rbr�r9rqr�s     rf�_get_refs_and_copyzBlock._get_refs_and_copy.sI�����{����T�Y�Y�4�4�6����T�z���y�y���T�z�rhc
���|j}t|t�rC|j||�}t	t|j�}|j||d��|gS|j
|�s+|r|jd��gS|r|gS|j�gS|�tj||�}|j�s+|r|jd��gS|r|gS|j�gS|j
|��r|j||�}t|j||�|rat�rW|�U|jsI|jj�r/t!j"t$t&t)���d|_
|j*r|�ut-d�dur|g}	|	S|j/d|��}	t1|	�dkDs|	d	j2|j2k7r$t!j"d
t&t)���|	S|g}	|	S|j4dk(s|j6d	dk(rY|�|t8ur)|j;t=j2t>��}n|jA|�}|jC||d|��Sg}	tE|jG��D]:\}
}|	jItK|�jC|||d||
|
dz|����<|	S)
z�
        replace the to_replace value with value, possible to create new
        blocks here this is just a call to putmask.
        T��
to_replacer�r9Frr�r�rr^r�Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`)r?r�r9�mask�r?r�r9rAr�)&rorvrJr:r	�_replacer�r�r?�mask_missingr
rAr
�warned_alreadyrqr�r�r��COW_WARNING_GENERAL_MSGr�r#r}rr	r�rur_r`rr�r�r[r��replacer�r�r�r�)rbr?r�r9rAr��already_warnedrorrr�r�s            rfrGz
Block.replace<s���&�����f�k�*��"�"�9�g�6�C��+�s�z�z�2�F��O�O�z���O�M��5�L��%�%�j�1�
��	�	�u�	�-�.�.�!(��v�;�t�y�y�{�m�;��<��'�'��
�;�D��x�x�z���	�	�u�	�-�.�.�!(��v�;�t�y�y�{�m�;�
�
#�
#�E�
*��"�"�9�g�6�C��C�J�J��e�4��&�(�"�.�&�5�5��9�9�*�*�,��M�M�/�%�#3�#5��
59�N�1��N�N�u�}��<�=��E�!�U�F�$�M�!!�[�[�e�y�[�I�F��6�{�Q��&��)�/�/�S�Y�Y�*F� �
�
�T�*�'7�'9���M�����M�
�Y�Y�!�^�t�z�z�!�}��1��}�����k�k�"�(�(�6�"2�3���1�1�%�8���;�;�%����	��
��F�"�4�;�;�=�1���2��
�
���J�&�&��#-�#� $�!�!�a�!�e�_�"+�
'��	�2��Mrhc��|j|�s+|r|jd��gS|r|gS|j�gStj|�}|j	||�}t|j|||�|rat�rW|�U|jsI|jj�r/tjttt���d|_|j!d|��}	t#d�}
t%|	�dkDs|	dj&|j&k7r&|
s$tjd	tt���|	S)
aA
        Replace elements by the given value.

        Parameters
        ----------
        to_replace : object or pattern
            Scalar to replace or regular expression to match.
        value : object
            Replacement object.
        inplace : bool, default False
            Perform inplace modification.
        mask : array-like of bool, optional
            True indicate corresponding element is ignored.
        using_cow: bool, default False
            Specifying if copy on write is enabled.

        Returns
        -------
        List[Block]
        Frr�Trr�r^rr@)r�r��re�compiler:rGror
rErqr�r�r�rFr�r#r	rr�ru)rbr?r�r9rAr�rH�rxr�r��opts           rf�_replace_regexzBlock._replace_regex�s!��<�%�%�j�1���	�	�u�	�-�.�.�$�D�6�7�4�9�9�;�-�7�
�Z�Z�
�
#��� � ��G�4���e�l�l�B��t�4�
�"�$��*�"�1�1��y�y�&�&�(��
�
�+�!�/�1��
15��-��m�m��)�m�<���7�8����H�q�L�C��F�L�L�E�K�K�7���M�M�H��+�-�

��
rhc
�����|j�t�t�rC|j||�}t	t|j���j||d��|gSt
||�D��	cgc]\}}	|j|�s�||	f��}
}}	t|
�s+|r|jd��gS|r|gS|j�gSt|
�dz
}t�j�rt������fd�|
D�}n�fd�|
D�}|rt|�}|r|g}
n|r|n|j�g}
|rat�rW|�U|jsI|j j#�r/t%j&t(t*t-���d|_t/d	�}t1t
|
|��D�]�\}\\}}}||k(}g}t1|
�D�]f\}}t|
�dk(r|}n|}t|t2�rJ�|||dz}|j5||||�|�
�}|ri||k7rd|D]_}t7j8|�}|j j:j=|j j:j?|���a|s�|r�|j@r�tCd�|D��s~g}|D]u}|jE||��}t|�dkDs|d
j|jk7r$t%j&dt*t-���|jG|��w|}|jG|���i|}
���|
Scc}	}w)z:
        See BlockManager.replace_list docstring.
        Tr>Frr^c3�p�K�|]-}tttt�|d���������/y�w)r)�regexrAN)r@r	rrF)r�r��na_maskrQros  ���rfrz%Block.replace_list.<locals>.<genexpr>$sB�����
6��A�#��!�/�"�A�a�D��G�����s�36c3�P�K�|]}tj�|d����y�w)rN)r?rD)r�r�ros  �rfrz%Block.replace_list.<locals>.<genexpr>1s#�����G��A�W�)�)�&�!�A�$�7��s�#&r�r�)r?r�rAr9rQr�c3�$K�|]}|du���
y�wrzrs�r�rs  rfrz%Block.replace_list.<locals>.<genexpr>vs����=�9�a��T�	�9�s�rrr@)$rorvrJr:r	rCrr�r�r�r2rur=�listr
rErqr�r�r�rFr�r#rr�r��_replace_coerce�weakref�ref�referenced_blocks�pop�indexr}r
r	r�) rb�src_list�	dest_listr9rQr�rHrrr�pairs�src_len�masks�rbrMr��src�destrAr	�new_rb�blk_num�m�mibr�rrYr��res_blk�	convertedrRros     `                         @@rf�replace_listzBlock.replace_list�sI��������f�k�*��"�"�9�g�6�C��+�s�z�z�2�F��O�O�x�y�$�O�O��5�L� #�8�Y�7�
�7�t�q�!�4�;Q�;Q�RS�;T�Q��F�7�	�
��5�z���	�	�u�	�-�.�.�$�D�6�7�4�9�9�;�-�7��e�*�q�.���6�<�<�(��F�|�m�G�
6��
6�E�H��G�E����K�E����B�!�$�t�y�y�{�3�B�
�"�$��*�"�1�1��y�y�&�&�(��
�
�+�!�/�1��
15��-��7�8��&/��E�5�0A�&B�"�A�"���d�T��7�l�G�"$�F�
!*�"�
�����r�7�a�<��A��C�)�#�t�4�4�4��G�g��k�2�A�
�,�,�"���#��'�
-�����g��$��%�k�k�!�n�����0�0�4�4��F�F�4�4�:�:�3�?��$����
�
��=�9�=�=��C�#)��$+�O�O�.7�-�9�%4�%�	��y�>�A�-��1��1C�1C�w�}�}�1T�$�M�M�!X�!.�+;�+=���
�
�9�-�#$*�$!�F��
�
�f�%�s!.�t�B�C'C�D�	��u
s�2M�Mc��t||�r|j||||��S|��|j�r�|jj	�}|jt
jt�d|��}||us|r|s|j�}n0|r.|r,|jj	�r|r|j�}t|j||�|gS|r|gS|r|gS|j�gS|j|||||��S)ai
        Replace value corresponding to the given boolean array with another
        value.

        Parameters
        ----------
        to_replace : object or pattern
            Scalar to replace or regular expression to match.
        value : object
            Replacement object.
        mask : np.ndarray[bool]
            True indicate corresponding element is ignored.
        inplace : bool, default True
            Perform inplace modification.
        regex : bool, default False
            If true, perform regular expression substitution.

        Returns
        -------
        List[Block]
        )r9rAFrrB)
rHrNr
rqr�r�r�rur[r�rArorG)	rbr?r�rAr9rQr��has_refr�s	         rfrWzBlock._replace_coerce�s��>�E�:�.��&�&�����	'��
��}��8�8�:�"�i�i�5�5�7�G����R�X�X�f�%5�E�Y��W�B��d�
�i���W�W�Y�� �W����1F�1F�1H�Y��W�W�Y��#�B�I�I�t�U�;��4�K�� �6�M�!(��v�;�t�y�y�{�m�;��<�<�%����#� ��
rhc��|S�zA
        For compatibility with 1D-only ExtensionArrays.
        rs�rb�args  rf�_maybe_squeeze_argzBlock._maybe_squeeze_arg�s	���
rhc��|Srors)rbr�s  rf�_unwrap_setitem_indexerzBlock._unwrap_setitem_indexer�s	���rhc�.�|jjSrz)ror`r|s rfr`zBlock.shape�s���{�{� � � rhc� �|j|Srz�ro)rbr�s  rf�igetz
Block.iget�s���{�{�1�~�rhc� �|j|S)zreturn a slice of my valuesrw)rbr�s  rfr�zBlock._slice�s��
�{�{�6�"�"rhc�d�|r|jj�|_||j|<y)a�
        Modify block values in-place with new item value.

        If copy=True, first copy the underlying values in place before modifying
        (for Copy-on-Write).

        Notes
        -----
        `set_inplace` never creates a new array or new Block, whereas `setitem`
        _may_ create a new array and always creates a new Block.

        Caller is responsible for checking values.dtype == self.dtype.
        N�ror��rb�locsror�s    rf�set_inplacezBlock.set_inplace�s)����+�+�*�*�,�D�K�"����D�rhc��|j}|tjur|j}d}nd}t	j
|||||��}t
|t�r|jdk(r|�J�|dk(r|�J�|�|j}|j|jk7r|j||�S|j||�S)zN
        Take values according to indexer and return them as a block.
        FT)�axis�
allow_fillr�r^r)
ror�
no_defaultr��algos�take_ndrv�ExtensionBlockr_r�rur�r�)rbr�r�r�r�ror�r�s        rfr�z
Block.take_nds�����������'����J��J��J��]�]��G�$�:�*�
�
��d�N�+��	�	�Q��<�+?�@�@��A�I�,�"6�7�7����>�>�L����t�z�z�)��?�?�:�|�<�<��-�-�j�,�G�Grhc���|j|jj|��\}}|jd�}|j|}||}t	|�}t||��g}||fS)a
        Return a list of unstacked blocks of self

        Parameters
        ----------
        unstacker : reshape._Unstacker
        fill_value : int
            Only used in ExtensionBlock._unstack
        new_placement : np.ndarray[np.intp]
        allow_fill : bool
        needs_masking : np.ndarray[bool]

        Returns
        -------
        blocks : list of Block
            New blocks of unstacked values.
        mask : array-like of bool
            The mask of columns of `blocks` we should keep.
        �r�r�r�)�get_new_valuesro�Tr
r�new_block_2d)	rb�	unstackerr��
new_placement�
needs_maskingr�rAr�rs	         rf�_unstackzBlock._unstack/sw��4%�3�3��K�K�M�M�j�4�
��
�D��x�x��{�� �\�\�$�'�
�%�d�+�
�
�M�
*���z�R�8�9���t�|�rhc��|j|�}ttj|j�}|j
dk(r|j}t|||�|jtk7r
t|d��}	t|j|�}|jtk(r0||}tj|�rt|t|�|�}|j!|d��}ttj|jj�}t#|tj�r"|j
dk(rt|�dk(r|d}	|||<|S#t$t&f$r}t|�rt'd�|��d}~wwxYw#t($r(|j+|d�	�}|j-||�cYSwxYw)
a
        Attempt self.values[indexer] = value, possibly creating a new array.

        Parameters
        ----------
        indexer : tuple, list-like, array-like, slice, int
            The subset of self.values to set
        value : object
            The value being set
        using_cow: bool, default False
            Signaling if CoW is used.

        Returns
        -------
        Block

        Notes
        -----
        `indexer` is a direct slice/positional indexer. `value` must
        be a compatible shape.
        r�Tr��r9r^)r.z)setting an array element with a sequence.N�r�)r�r	r�r�ror_r�rUrur{rTr,rr0rCr�r:rvr.r-r'r��setitem)	rbr�r�r�ro�casted�vi�errr�s	         rfr�z
Block.setitem]s���.�,�,�U�3���b�j�j�$�+�+�.���9�9��>��X�X�F�	�g�u�f�5��:�:��#�!�%�t�<�E�	�(����u�=�F��z�z�Z�'��G�_���#�#�B�'�9���R��&�Q�F��#�#�I�t�#�<�D��"�*�*�d�k�k�m�m�4�F��&�"�*�*�-�&�+�+��2B�s�6�{�VW�GW�����
�"(��w�����
�z�*�
���'�$�C������
��)!�	.��,�,�U�4�,�H�B��:�:�g�u�-�-�	.�s*�?F�E�F	�,F�F	�.F=�<F=c�$�|}ttj|j�}t	|j
|�\}}t
|tttf�rJ�|tjur|j}|j|�}t|d��}|r|r|jd��gS|gSt!�rW|�U|j"sI|j$j'�r/t)j*t,t.t1���d|_	t3|j4|�}|j7|d��}ttj|j�}t9|j
||�|gS#t:$�r	|j<dk(s|j>d	dk(r_tA|�s%|jC|d�
�jE||�cYS|jG�d	}	|jI|	||	|��}
|
gcYSt
|tj�}g}|jK�}
tM|
�D]J\}}
|}|r|dd�||dz�f}|dd�||dz�f}|
jE|||��}|jO|��L|cYSwxYw)a}
        putmask the data to the block; it is possible that we may create a
        new dtype of block

        Return the resulting block(s).

        Parameters
        ----------
        mask : np.ndarray[bool], SparseArray[bool], or BooleanArray
        new : a ndarray/object
        using_cow: bool, default False

        Returns
        -------
        List[Block]
        Tr�FrNr�r�r^rr��r�)(r	r�r�rorDr�rvr9r;r8rr�r�r�rTr�r
rErqr�r�r�rFr�r#r,rur:rBr'r_r`r0r��putmask�nonzeror�r�r�r�)rbrA�newr�rH�	orig_maskro�noopr�r�r��is_arrayr�r�r��n�submaskr�s                  rfr�z
Block.putmask�sW��&�	��b�j�j�$�+�+�.��%�f�h�h��5�
��d��c�H�i��#F�G�G�G��#�.�.� ��/�/�C��*�*�3�/���C�t�4�����	�	�u�	�-�.�.��6�M�
� ��*�"�1�1��y�y�&�&�(��
�
�+�!�/�1��
15��-�$	"�(����s�;�F��#�#�I�t�#�<�D��"�*�*�d�k�k�2�F�"�6�8�8�T�6�:��6�M�� �	"��y�y�A�~����A��!�!3�$�C�(��6�6��D�7���g�d�C�(�)�#�l�l�n�Q�/�G����g�s�7�|�y��Q�B��4�K�&�c�2�:�:�6���
��k�k�m��&�s�^�E�A�r��A����1�q�1�u�9��-��'��1�q�1�u�9��5�G��*�*�W�a�9�*�E�C��%�%�c�*�,�"�!�9	"�s!�A&E<�<AJ�-J�BJ�Jc�|�|j|jk(sJ�t|tttf�rJ�|jdk(}t|�}t
tj|j�}|}|r|j}t||�\}}	|	r&|r|jd��gS|j�gS|tjur|j}|j!|�}	t#|j$|�}
|
}t'||j)�|�}||urmt+|�r:t-|�t-|�kr#tj.|||�t1d��|j�}tj2|||�n�t+|�rct|tj�sIt-|�|j4dk(r.tj6|�j9|j4�}t;j.|||�}	|r|j}|jO|�gS#t<t>t@f$r�|jdk(s|j4ddk(r<|jC|�}
|
j/|||��}|jE|||d	�
�cYSt|tjtFf�}g}|jI�}tK|�D]K\}}|}|r|dd�||dz�f}|dd�||dz�f}|j/||||��}|jM|��M|cYSwxYw)
a�
        evaluate the block; return result block(s) from the result

        Parameters
        ----------
        other : a ndarray/object
        cond : np.ndarray[bool], SparseArray[bool], or BooleanArray
        _downcast : str or None, default "infer"
            Private because we only specify it when calling from fillna.

        Returns
        -------
        List[Block]
        r�Frz�This should not be reached; call to np.where above is expected to raise ValueError. Please report a bug at github.com/pandas-dev/pandasr�r^rr�r�rr�rN)�	_downcastr�)(r_rvr9r;r8r@r	r�r�ror�rDr�rr�r�r�r,rurC�sumr0r�r�NotImplementedErrorr�r`�arrayr�rRr-r.r'r�rrLr�r�r�r�)rbr��condr�r��	transposero�
orig_other�icondr�r��altr�r�rr�r�r�r�r��othr�r�s                       rfrzBlock.where�s��"�y�y�D�I�I�%�%�%��e�h�	�<�%H�I�I�I��I�I��N�	�!�$�'���b�j�j�$�+�+�.���
���X�X�F�&�v��u�5���t����	�	�u�	�-�.�.��I�I�K�=� ��C�N�N�"��O�O�E��,�,�U�3��D	B�)����u�=�F�F�E�-�f�e�i�i�k�5�I�C��%����&�3�u�:��F��+C��H�H�e�V�V�U�3�-�7���
 ������
�
�6�5�#�.�
!��'�&�u�b�j�j�9��E�
�d�j�j��n�4�
�H�H�U�O�3�3�F�L�L�A�E�
%�*�*�E�6�6�5�A����X�X�F�����'�(�(��M�I�'8�9�	"��y�y�A�~����A��!�!3��3�3�E�:�����Z����K���+�+��Y�)�G�,���&�e�b�j�j�.�-I�J���
��k�k�m��&�s�^�E�A�r��C��#�A�q�1�q�5�y�L�1��"�1�a�!�a�%�i�<�0�G��(�(��W�	�Y�#��C��%�%�c�*�,�"�!�?	"�s�/H:�:A/L;�+B
L;�:L;c�T�t|d�}|jsd}n.t|j�}t	|j|�\}}|rE|r|r|jd��gS|gS|j|��}	|	j
|	g||d��}
|
S|�$d|j|jdz
�|kD<|r |jj|||��}
n|j|jd�	�}
t|
D�cgc]}|j
|g||d����c}�Scc}w)
z�
        fillna on the block with the value. If we fail, then convert to
        block to hold objects instead and try again
        r9TFrr�r�r^)r�rH)r�)
r$r�r=rorDr�r�cumsumr_r�r�rr)rbr��limitr9rr�rHr�rAr�r�rs            rfr�zBlock.fillnaksV��&�g�y�9��� � ��D�����$�D�)�$�+�+�t�<�J�D�$���� �I�I�5�I�1�2�2��v�
��Y�Y�	�M�Y�2���(�(��D�8�y��)����
���7<�D����T�Y�Y��]�+�e�3�4���,�,������>���C��*�*�U�T�V�V�G�u�*�=�C�
�
�	
��C��#�#��E�H�	�(�$���	
�
�	
��
s�D%r�r�r9r��
limit_arearr�rHc�n�|js+|r|jd��gS|r|gS|j�gS|j||�\}	}
tt|j
�}|dk(r|j}|j||||	��}|	sat�rW|�U|jsI|jj�r/tjttt!���d|_	|dk(r|j}t#|d��}
|j%|
|
��}|j'|g||d	�
�S)NFrr^)�methodr�r�r�r�Tr�r�r��r)r�r�r<r	rN�array_valuesr��_pad_or_backfillr
rErqr�r�r�rFr�r#rTr�r)rbr�r�r9r�r�rr�rHr�rqr�r��datar�s               rf�pad_or_backfillzBlock.pad_or_backfill�s0��� � ���	�	�u�	�-�.�.�$�D�6�7�4�9�9�;�-�7��,�,�Y��@�
��d��'��):�):�;���1�9��6�6�D��*�*���!��	+�
�
��"�$��*�"�1�1��y�y�&�&�(��
�
�+�!�/�1��
15��-��1�9�#���J��Z�t�<��
�
'�
'��4�
'�
8���!�!�2�$��)�H�!�M�Mrh�forward)r9r��limit_directionr�rr�rHc	��t|d�}|dk(rtj|�|js+|r|j	d��gS|r|gS|j	�gS|j
tk(r+|r|j	d��gS|r|gS|j	�gS|j||�\}}|jjd
||jdz
|||||d�|
��}
t|
d��}|sat�rW|	�U|	jsI|jj�r/t!j"t$t&t)��	�d|	_
|j+||�
�}|j-|g||d��S)Nr9�asfreqFrr^)r�r�r\r�r�r�r�Tr�r�r��interpolater�rs)r$r?�clean_fill_methodr�r�rur{r<r�r�r_rTr
rErqr�r�r�rFr�r#r�r)rbr�r\r9r�r�r�rr�rHrdr�rqr�r�r�s                rfr�zBlock.interpolate�s���&�g�y�9���X���%�%�f�-�� � ���	�	�u�	�-�.�.�$�D�6�7�4�9�9�;�-�7��:�:��#���	�	�u�	�-�.�.�$�D�6�7�4�9�9�;�-�7��,�,�Y��@�
��d�3�T�&�&�2�2�	
�����Q����+�!��	
��	
�
��Z�t�<���"�$��*�"�1�1��y�y�&�&�(��
�
�+�!�/�1��
15��-�
�
'�
'��4�
'�
8���!�!�2�$��)�M�!�R�Rrhc��tj|jj|d��j}|j	|��gS)z'return block for the diff of the valuesr�r�rw)r��diffror�r�)rbr�r�s   rfr�z
Block.diff"s8��
�Z�Z����
�
�q�q�9�;�;�
����z��2�3�3rhc���|jdz
}tj|�s|jtk7rtd��|j
|�}	t|j|�}ttj|j�}t||||�}|j|�gS#t$r'|j|�}|j||��cYSwxYw)z+shift the block by periods, possibly upcastr^zfill_value must be a scalarr�)r_rr1rur{r-r�r,r	r�r�rorIr�r'r�)rb�periodsr�r�r�ror�r�s        rfrIzBlock.shift*s����y�y�1�}���}�}�Z�(�T�Z�Z�:�-E��:�;�;��1�1�*�=�
�
	<�)��
�
�J��F��"�*�*�d�k�k�2�F��v�w��f�=�J��.�.�z�:�;�;��!�	<��,�,�Z�8�B��8�8�G�
�8�;�;�	<�s�B/�/-C�Cc���|jdk(sJ�t|�sJ�t|jt	j
|j�|�}t|d��}t||j��S)a
        compute the quantiles of the

        Parameters
        ----------
        qs : Index
            The quantiles to be computed in float64.
        interpolation : str, default 'linear'
            Type of interpolation.

        Returns
        -------
        Block
        r�r�r�)
r_r0rEror��asarray�_valuesr�r�r�)rb�qs�
interpolationr�s    rf�quantilezBlock.quantileKs`��*�y�y�A�~��~��B���� ����b�j�j����.D�m�T��$�F��3���F�d�n�n�=�=rhc��|jr|jr|j|��Sd}|jj	|�}||jur|s|j�}n|j
}|j
||��S)a�
        Rounds the values.
        If the block is not of an integer or float dtype, nothing happens.
        This is consistent with DataFrame.round behavivor.
        (Note: Series.round would raise)

        Parameters
        ----------
        decimals: int,
            Number of decimal places to round to.
            Caller is responsible for validating this
        using_cow: bool,
            Whether Copy on Write is enabled right now
        rNr�)�
is_numericr�r�ro�roundrqr�)rb�decimalsr�rqros     rfr�zBlock.roundisz�� ���$�,�,��9�9�i�-�9�0�0���
���"�"�8�,���T�[�[� ��
 ������y�y���)�)�&�t�)�<�<rhc�J�t|�s|g}|jdk(rtttj|j
�}tj||�}|jj
|�}t|�|||j��gStj|�|j
jdk\rt�tj||j
jdgg�}|jj}g}d}|jj�r|jnd}|D]f}||dzk(rnY|j
|dz|�dd�f}||dz|}	t|�|t!|	�|j|��}
|j#|
�|}�h|S)aDeletes the locs from the block.

        We split the block to avoid copying the underlying data. We create new
        blocks for every connected segment of the initial block that is not deleted.
        The new blocks point to the initial array.
        r^�r�r_rr�Nr�)r0r_r	r�r�ro�deleter�r��maxr`�
IndexError�concatenate�as_arrayrqr�rr�)rbr�ror��mgr_locs_arrr��previous_locrq�idxr}r�s           rfr�zBlock.delete�s}���C� ��%�C��9�9��>��"�*�*�d�k�k�2�F��Y�Y�v�s�+�F��~�~�,�,�S�1�H��D��J�v���	�	�J�K�K�
�6�6�#�;�$�+�+�+�+�A�.�.����n�n�c�D�K�K�$5�$5�a�$8�#9�:�;���~�~�.�.��"$�
���!�I�I�3�3�5�t�y�y�4���C��l�Q�&�&�����\�A�%5��%;�Q�%>�?��#�L�1�$4�s�;���T�$�Z��n�T�&:����QU����!�!�"�%��L�� �rhc��t|��)�(return a boolean if I am possibly a viewr r|s rf�is_viewz
Block.is_view�s��"�$�'�'rhc��t|��)zP
        The array that Series.array returns. Always an ExtensionArray.
        r r|s rfr�zBlock.array_values����
"�$�'�'rhc��t|��)z�
        return an internal format, currently just the ndarray
        this is often overridden to handle to_dense like operations
        r rws  rf�
get_valueszBlock.get_values�r�rh�rjr�)rjr)r�rrj�None)NN)r��BlockPlacement | Nonerq�BlockValuesRefs | Nonerjrn)r�r�rqr�rjr)rjr�)rjrp)r�r�rjr)r��npt.NDArray[np.intp]rjr�F)r�r�r�rr�r�rjr)r�rrjr�)r�rrjr�ri)r�rrjrk)r�r�rjrn)rrkr�r�rr�rjrk�r�r�rjrk)r�r�r�r�rjrk)TTTTT�numpy_nullable)r�r�r�r�r!r�r"r�r#r�r$r�r%r�r&rrjrk)rjr)F�raiseFF)rurr�r�r,rr�r�r r�rjrn)r1r�rjrn)T)rr�rjr)r�r�r9r�rjr)r�r�r9r�)FNFN)r9r�rAznpt.NDArray[np.bool_] | Noner�r�rjrk)r9r�r�r�rjrk)FFFN)r]z
Iterable[Any]r^z
Sequence[Any]r9r�rQr�r�r�rjrk)TFF)
rA�npt.NDArray[np.bool_]r9r�rQr�r�r�rjrk)rq�
np.ndarrayrjr��rjr)r��)int | tuple[int, int] | tuple[slice, int]rjr�)r��4slice | npt.NDArray[np.bool_] | npt.NDArray[np.intp]rjr�rorr�r�rjr�)r�r�r�rr�r�rjrn�r�r�r�r�)r�r�rjrn�FN��inferF�r�z
str | boolr�r�rjrk�NFNFN�r��
int | Noner9r�r�r�rjrk�r�rr�rr9r�r�r�r��#Literal['inside', 'outside'] | Noner�Literal['infer'] | Noner�r�rjrk)r�rr\rYr9r�r�r�r�z&Literal['forward', 'backward', 'both']r�r�rr�r�r�rjrk)r�rprjrkrz�r�rpr�rrjrk)�linear)r�rYr�rrjrn)r�rpr�r�rjr�rjrL�ru�DtypeObj | Nonerjr�)Lr��
__module__�__qualname__�__doc__�__annotations__�	__slots__r�r
r"rxr}r�r�r�r��propertyr�r�r�r�r��setterr�r�r�r�r�r�r�r�r�r�r�r�r�rar�rrlrr	r)rur�rVr�r:r<rGrNrkrWrrrtr`rxr�r~rr�r�r�r�r�rr�r�r�r�rIr�r�r�r�r�r�rsrhrfrnrn�s!	���
(�'�

�I�
�����I��J�
��
���
���/���/���6���6���%���%���6���6���"���"��
�3���3��,��,���<���<����������_�_�&��&��,0�'+�	Q�)�Q�%�	Q�

�Q��Q�"�,0�'+�	
R�)�
R�%�	
R�

�
R��
R��	��	�� �� ��J��J��J��J��RW�
J��
J�+9�
J�KO�
J�	
�
J��
J��6��6�
�)��)�"�-��-��
��
�����*�
��
�����2�42��42�l�I��I��	I�
�I�
�
I��I�V��	8���	8����	,8��,8��	,8�

�,8��,8�d#�#� $� $�!%�&6�,��,��,��	,�
�,��
,��,��,�$�,�
�,�b��!���!���%���
1��1��1��	1�
�1��
1�
�1��1�f�CH�RV�'�=@�'�	�'��'��	W��	W����������
�-1���u��	u�+�
u��u�
�u��u�n�
�
���F��	F��
F�
�F��F�P�
����Q��Q�!�Q��	Q�
�Q��
Q�
�Q��Q�f����;�$�	;�
�;��
;��;�
�;��;�B���!��!��#�J�#�	�#�#�$�
/3��>�>�%H�%�%H��%H�,�	%H�
�
%H��%H�N*�,�	*�
-�*�\?�DBF�T"�$(�T"�	�T"�nOT�u)�&0�u)�GK�u)�	�u)�t!�����=
��=
��	=
��
=
�
�=
�F�� �:>�,0���2N��2N��	2N�
�2N��
2N�8�2N�*�2N��2N�
�2N�h�� �BK�:>�,0���AS�#�AS��	AS�
�AS��
AS�@�AS�8�AS�*�AS��AS�
�AS��AS�F�4��4�<�B�08�>��>�-�>�
�	>��>�:� =�� =�J.�`�(��(��(��(�(rhrnc	���eZdZUdZded<eddd��Zeddd��Ze	d					dd��Ze	d			dd	��Z	ed�fd
��Z
eedd���Zeddd��Z
ed
ddddddd�															dd��Z�xZS)�
EABackedBlockz>
    Mixin for Block subclasses backed by ExtensionArray.
    rLroNc��|jjj||��j}|j|�gS)z�
        Shift the block by `periods`.

        Dispatches to underlying ExtensionArray and re-boxes in an
        ExtensionBlock.
        )r�r�)ror�rIr�)rbr�r�r�s    rfrIzEABackedBlock.shift�s;���[�[�]�]�(�(��Z�(�P�R�R�
��*�*�:�6�7�7rhFc���|}|}|j|�}|j|�}|j}|jdk(r|j}t|||�	|||<|S#ttf$rzt|jt�r'|j|d��}|j||�cYSt|t�r'|j|d��}|j||�cYS�wxYw)a�
        Attempt self.values[indexer] = value, possibly creating a new array.

        This differs from Block.setitem by not allowing setitem to change
        the dtype of the Block.

        Parameters
        ----------
        indexer : tuple, list-like, array-like, slice, int
            The subset of self.values to set
        value : object
            The value being set
        using_cow: bool, default False
            Signaling if CoW is used.

        Returns
        -------
        Block

        Notes
        -----
        `indexer` is a direct slice/positional indexer. `value` must
        be a compatible shape.
        r�Tr�)rtrrror_r�rUr-r.rvrur5r�r��NDArrayBackedExtensionBlock)rbr�r�r��orig_indexer�
orig_valueror�s        rfr�zEABackedBlock.setitem�s���4���
��.�.�w�7���'�'��.�������;�;�!���X�X�F��g�u�f�5�	�#�F�7�O��K���I�&�	��$�*�*�m�4��0�0��D�0�Q���z�z�,�
�;�;��D�"=�>��0�0��D�0�Q���z�z�,�
�;�;��	�s�A#�#AC,�35C,�*C,c�j�|jj}t|�}|}|}|j|�}|j|�}|tj
ur|j}t||�\}}	|	r&|r|jd��gS|j�gS	|j||�j}
|j7|
�}|gS#ttf$�rS|jdk(s|jddk(r�t|jt �r<|j#|�}|j%|||��}|j'|||d��cYSt|t(�r<|j#|�}|j%|||��}|j'|||d��cYS�t|t*j,t.f�}
g}|j1�}t3|�D]J\}}|}|
r|dd�||dz�f}|dd�||dz�f}|j%|||��}|j5|��L|cYSwxYw)NFrr^rr�rr�)ror�r@rrrr�r�rDr��_wherer-r.r_r`rvrur5r�rrr	r�r�rLr�r�r�r�)rbr�r�r�r��arrr��	orig_condr�r�r�rr�r�r�r�r�r�r�r�s                    rfrzEABackedBlock.where s@��
�k�k�m�m��!�$�'���
��	��'�'��.���&�&�t�,���C�N�N�"��O�O�E�&�s�T�E�2���t����	�	�u�	�-�.�.��I�I�K�=� �'	"����D�%�0�2�2�J�P�
'�
'�
�
3���t���Q�I�&�%	"��y�y�A�~����A��!�!3��d�j�j�-�8��5�5�j�A�C��)�)�J�	�Y�)�O�C��/�/��i�9�W�0��� ��&A�B��5�5�j�A�C��)�)�J�	�Y�)�O�C��/�/��i�9�W�0���
�&�j�2�:�:�~�2N�O���
��k�k�m��&�s�^�E�A�r�"�A��&�q�!�a�!�e�)�|�4��'��1�q�1�u�9��5�G��(�(�1�g��(�C�C��%�%�c�*�,�"�!�K%	"�s!�C�BH2�A
H2�"B
H2�1H2c���t|�}|tjur|j}|}|}|j	|�}|j	|�}|j�s|r|j
d��gS|gSt�rW|�U|jsI|jj�r/tjttt���d|_|j!|d��}|j"}|j$dk(r|j&}	|j)||�|gS#t*t,f$�r'|j$dk(s|j.d	dk(ryt1|j2t4�r'|j7|d�
�}|j9||�cYSt1|t:�r'|j7|d�
�}|j9||�cYS�t1|t<j>t@f�}	g}
|jC�}tE|�D]H\}}
|}|	r|dd�||dz�f}|dd�||dz�f}|
j9||�}|
jG|��J|
cYSwxYw)z+
        See Block.putmask.__doc__
        FrNr�Tr�r�r^rr�)$r@rr�r�rrr
r�r
rErqr�r�r�rFr�r#r:ror_r��_putmaskr.r-r`rvrur5r�r�r	r�r�rLr�r�r�)rbrAr�r�rH�orig_newr�rorr�r�r�r�r�r�r�r�s                 rfr�zEABackedBlock.putmaskes@��"�$�'���#�.�.� ��/�/�C����	��%�%�c�*���&�&�t�,���x�x�z���	�	�u�	�-�.�.��6�M�
� ��*�"�1�1��y�y�&�&�(��
�
�+�!�/�1��
15��-����	�4��8�������;�;�!���X�X�F�#	"��O�O�D�#�&�F�v�
��E�:�&� 	"��y�y�A�~����A��!�!3��d�j�j�-�8��5�5�h�t�5�T�C��;�;�y�(�;�;���&A�B��5�5�h�t�5�T�C��;�;�y�(�;�;��&�h����^�0L�M���
��k�k�m��&�s�^�E�A�r� �A��$�Q��A��E�	�\�2��'��1�q�1�u�9��5�G��*�*�W�a�0�C��%�%�c�*�,�"�!�A 	"�s �D)�)A0I �5I �BI �I c� ��|jdk(rU|jj|�}|jj|�}t	|�|||j��gS|jjdk(rgSt
�|�	|�S)Nr^r�)r_ror�r�r��super)rbr�ror��	__class__s    �rfr�zEABackedBlock.delete�sz����9�9��>��[�[�'�'��,�F��~�~�,�,�S�1�H��D��J�v���	�	�J�K�K�
�[�[�
�
��
"��I��w�~�c�"�"rhc��|jSrzrwr|s rfr�zEABackedBlock.array_values�s���{�{�rhc��|j}|tk(r|jt�}t	j
|�j
|j�S)zS
        return object dtype as boxed values, such as Timestamps/Timedelta
        )ror{r�r[r�r�r�r`)rbruros   rfr�zEABackedBlock.get_values�sA��
!�K�K���J���]�]�6�*�F��z�z�&�!�)�)�$�*�*�5�5rhrr�c��|j}	||d�}
dtj|	j�jvr||
d<n#|�!tt
|	�j�d���|	jdk(r,|dk(r'|	jjdi|
��j}n|	jdi|
��}|j|�gS)N)r�r�r�z� does not implement limit_area (added in pandas 2.2). 3rd-party ExtnsionArray authors need to add this argument to _pad_or_backfill.r�r^rs)ro�inspect�	signaturer��
parametersr�r�r�r_r�r�)rbr�r�r9r�r�rr�rHrordr�s            rfr�zEABackedBlock.pad_or_backfill�s�������,2�U�!C���7�,�,�V�-D�-D�E�P�P�P�#-�F�<� �
�
#�%���<�(�(�)�*A�A��
��;�;�!����	�2����2�2�<�V�<�>�>�J�0��0�0�:�6�:�J��*�*�:�6�7�7rhrzr�r�)r�r�r�r�r�r�rir�r�r�)r�r�r�rrr
rIr�rr�r�r"r�r�r��
__classcell__�rs@rfrr�sW����
��
�
8��
8��6��6�p�NS�B�&0�B�GK�B�	�B��B�H�AE�K�$(�K�	�K��K�Z�	#��	#��������6��6��
�� �:>�,0���8��8��	8�
�8��
8�8�8�*�8��8�
�8��8rhrc����eZdZUdZded<					d							d�fd�
Zedd��Zdd�Zddd�Z	d�Z
d	�Zedd
��Z
edd��Z				dd�Zedd
��Z				dd�Z�xZS)r�z�
    Block for holding extension types.

    Notes
    -----
    This holds all 3rd-party extension array types. It's also the immediate
    parent class for our internal extension types' blocks.

    ExtensionArrays are limited to 1-D.
    rLroc�H��t|jt�rt�|�||||||��S|r;|j
r/|jjs|j}|j}n�|j||�\}	}	|jj	|d||	��}|	sbt�rX|�V|jsJ|jj�r0tjtt t#���d|_	|j-||��}
|
j/|
g||d	�
�S#t$$rhd}|jj	|d|��}tjdt'|j�j(�d�t*t#���Y��wxYw)N)r�r�r9rr�rH)r�r�r�r�r�T)r�r�r�z�ExtensionArray.fillna added a 'copy' keyword in pandas 2.1.0. In a future version, ExtensionArray subclasses will need to implement this keyword or an exception will be raised. In the interim, the keyword is ignored by �.r�r�)r�r)rvrur5rr�r�ro�_hasnarqr<r
rEr�r�r�rFr�r#r.r�r��DeprecationWarningr�r)rbr�r�r9rr�rHrqr�r�r�rs           �rfr�zExtensionBlock.fillna�s�����d�j�j�-�0��7�>����!�#�-�
"��
���*�*�4�;�;�3E�3E��9�9�D����J��0�0��G�D�J�D�$�!
=�!�[�[�/�/���E��0��
�*�*�,�&�2�*�9�9��y�y�.�.�0� �
�
�3�)�'7�'9��
9=��5�
�
'�
'�
��
'�
>���!�!�2�$��I�h�!�W�W��A�
���!�[�[�/�/�e�D�PU�/�V�
��
�
�I��D�K�K�(�1�1�2�!�	5�
'�/�1�	�

�s�D0�0A.F!� F!c��|jdk(rt|j�fSt|j�t|j�fS)Nr^)r_r�ror�r|s rfr`zExtensionBlock.shape=	s>���9�9��>�����$�&�&��4�>�>�"�C����$4�4�4rhc�V�t|t�r{|\}}tj|�s|dk7rt	|�d���t|t
�r/|dkr|t
|j�z
}|j||dzS|j|S|dk7rt	|�d���|jS)Nrz only contains one itemr^)rv�tuple�com�
is_null_slicer�r�r�ro)rbr��colr�s    rfrxzExtensionBlock.igetD	s����a����H�C���$�$�S�)�c�Q�h� �D�6�)@�!A�B�B��#�u�%���7��3�t�{�{�+�+�C��{�{�3��q��1�1��;�;�s�#�#��A�v� �D�6�)@�!A�B�B��;�;�rhc�d�|r|jj�|_||jddyrzr{r|s    rfr~zExtensionBlock.set_inplace`	s(����+�+�*�*�,�D�K�����A�rhc�R�t|tjtf�rE|j|j
jdzk(r|jddk(sJ�|dd�df}|St|t�r1|jddk(sJ�|jdd��j}|S)z@
        If necessary, squeeze a (N, 1) ndarray to (N,)
        r^Nrr�)
rvr�r�rLr_ror`r8�_ixsr�rps  rfrrz!ExtensionBlock._maybe_squeeze_argg	s���
�s�R�Z�Z��8�9����D�K�K�,�,�q�0�0��9�9�Q�<�1�$�$�$��a��d�)�C��
�
��\�
*��9�9�Q�<�1�$�$�$��(�(�1�1�(�%�-�-�C��
rhc���t|t�r�t|�dk(r�td�|D��rO|\}}|jdk(r%|dk(j�r|j
ddk(st
d��|dd�df}|Stj|d�r|ddk(r|d}|Stj|d�r|d}|St|d�r|dddk(r|d}|St
d��|S)zw
        Adapt a 2D-indexer to our 1D values.

        This is intended for 'setitem', not 'iget' or '_slice'.
        r�c3�rK�|]/}t|tj�xr|jdk(���1y�w)r�N)rvr�r�r_rUs  rfrz9ExtensionBlock._unwrap_setitem_indexer.<locals>.<genexpr>�	s,����N�g��:�a����,�<����1��<�g�s�57r^rzPThis should not be reached. Please report a bug at github.com/pandas-dev/pandas/N)rvr%r�r
�sizer`r�r�
is_integerr&r'r0)rbr��first�seconds    rfrtz&ExtensionBlock._unwrap_setitem_indexer}	s���g�u�%�#�g�,�!�*;�
�N�g�N�N� '�
��v��K�K�1�$�&�A�+�):�):�)<����Q��ST�AT�-�8��� ��1��+��"�������
�+���
�a��!�!�*�����"�"�7�1�:�.�!�!�*�����g�a�j�)�g�a�j��m�q�.@�!�!�*����	*�4����rhc��y)z,Extension arrays are never treated as views.Frsr|s rfr�zExtensionBlock.is_view�	s��rhc�B�|jjjSrz)roru�_is_numericr|s rfr�zExtensionBlock.is_numeric�	s���{�{� � �,�,�,rhc���|jdk(rLt|t�std|��t	d�|}t|�std|��td�}|j|S)z�
        Return a slice of my values.

        Parameters
        ----------
        slicer : slice, ndarray[int], or ndarray[bool]
            Valid (non-reducing) indexer for self.values.

        Returns
        -------
        ExtensionArray
        r�z+invalid slicing for a 1-ndim ExtensionArrayr^N)r_rvr�r��ranger�ro)rbr��new_locss   rfr�zExtensionBlock._slice�	sp��&�9�9��>��f�e�,�$�A�6����Q�x��'�H��x�=�$�A�6����4�[�F��{�{�6�"�"rhc��|j|}t|�||j|j|j��S)zN
        Perform __getitem__-like specialized to slicing along index.
        )r_rq)ror�r�r_rq)rbr�r�s   rf�slice_block_rowszExtensionBlock.slice_block_rows�	s5���[�[��(�
��t�D�z�*�d�n�n�4�9�9�4�9�9�U�Urhc�*�|j\}}|j|}||}tt||��D���	cgc]D\}\}}	t	|�|j
j
||||��t|	�d����F}
}}}	|
|fScc}	}}w)N)r�r�r�r�)�
arange_resultr�r�rr�ro�taker)rbr�r�r�r�r�rAr�r��placers           rfr�zExtensionBlock._unstack�	s���%�2�2��
�D� �\�\�$�'�
�%�d�+�
�(1��Z��1O�'P�

�(Q�#��#�G�U�
�D��J���� � ��
�a�(8�Z�!���u�%��
�(Q�	�

��t�|���

s�A	Br�r�r�)r�r�r�r�r�)r�r�rjrL)r�r�rjrr�)r�r�r�rrr�r"r`rxr~rrrtrr�r�r�r
r9r�rrs@rfr�r��s����	�
��
!�����=X��=X��	=X��
=X�
�=X�~�5��5��8 ��,(�T����
�-��-�&#�J�&#�	�&#�P�V��V�'�,�	'�
-�'rhr�c�\�eZdZUded<dZed	d��Zed
d��Zddd�Ze	d	d��Z
y)
�
NumpyBlockr�rorsc�2�|jjduS�r�N)ro�baser|s rfr�zNumpyBlock.is_view
s���{�{���t�+�+rhc�,�t|j�Srz)rNror|s rfr�zNumpyBlock.array_values
s��"�4�;�;�/�/rhNc�j�|tk(r|jjt�S|jSrz)r{ror�rws  rfr�zNumpyBlock.get_values
s)���J���;�;�%�%�j�1�1��{�{�rhc�N�|jj}|j}|dvS)N�fciub)rorur�)rbrur�s   rfr�zNumpyBlock.is_numeric
s$�����!�!���z�z���w��rhr�r�rzr�)r�r�r�rrrr�r�r�r"r�rsrhrfr?r?
sL�����I�
�,��,��0��0��
���rhr?c��eZdZdZy)�NumericBlockrsN�r�r�r�rrsrhrfrHrH'
�	���IrhrHc��eZdZdZy)�ObjectBlockrsNrIrsrhrfrLrL-
rJrhrLc�.�eZdZUdZded<edd��Zy)r	z8
    Block backed by an NDArrayBackedExtensionArray
    rZroc�F�|jjjduSrA)ro�_ndarrayrBr|s rfr�z#NDArrayBackedExtensionBlock.is_view:
s���{�{�#�#�(�(��4�4rhNr�)r�r�r�rrrr�rsrhrfr	r	3
s!���
(�'�
�5��5rhr	c�$�eZdZUdZdZdZded<y)�DatetimeLikeBlockz*Block for datetime64[ns], timedelta64[ns].rsFzDatetimeArray | TimedeltaArrayroN)r�r�r�rrr�rrsrhrfrQrQA
s��4��I��J�*�*rhrQc� �eZdZUdZded<dZy)�DatetimeTZBlockz0implement a datetime64 block with a tz attributerKrorsN)r�r�r�rrrrsrhrfrSrSI
s��:����IrhrSc�4�t|tj�rJt|�}t	|j
jt�rtj|t��}t|ttf�r|j�|jd�}|S)a:
    Input validation for values passed to __init__. Ensure that
    any datetime64/timedelta64 dtypes are in nanoseconds.  Ensure
    that we do not have string dtypes.

    Parameters
    ----------
    values : np.ndarray or ExtensionArray

    Returns
    -------
    values : np.ndarray or ExtensionArray
    r�N)rvr�r�rS�
issubclassrur�r�r�r[rKrP�freq�
_with_freqrws rfr�r�U
sm�� �&�"�*�*�%�/��7���f�l�l�'�'��-��X�X�f�F�3�F��&�=�.�9�:�v�{�{�?V��"�"�4�(���Mrhc��t|t�rtSt|t�rtSt|t
�rtS|j}|dvrtStS)z�
    Find the appropriate Block subclass to use for the given values and dtype.

    Parameters
    ----------
    dtype : numpy or pandas dtype

    Returns
    -------
    cls : class, subclass of Block
    �Mm)
rvr3rSr7r	r4r�r�rQr?rs  rf�get_block_typerZr
sR���%��)���	�E�;�	'�*�*�	�E�>�	*����:�:�D��t�|� � ��rhc�Z�t|j�}t|�}||d||��S)Nr��r_r�rq)rZrur�)ror�rq�klasss    rfr�r��
s-��
�6�<�<�(�E�
 ��
(�F���a�9�4�@�@rhr�c�D�t|j�}|||||��S)Nr\)rZru)ror�r_rqr]s     rfr�r��
s#��
�6�<�<�(�E���d�i�d�C�Crhc��|j|kDrtd|j�d|�d���t|j�sf|j|k7rtd|j�d|�d���t	|�t	|�k7r#tdt	|��dt	|�����y|dk(rt	|�d	k7rtd
��yy)aV
    ndim inference and validation.

    Validates that values.ndim and ndim are consistent.
    Validates that len(values) and len(placement) are consistent.

    Parameters
    ----------
    values : array-like
    placement : BlockPlacement
    ndim : int

    Raises
    ------
    ValueError : the number of dimensions do not match
    z0Wrong number of dimensions. values.ndim > ndim [z > �]z1Wrong number of dimensions. values.ndim != ndim [z != zWrong number of items passed z, placement implies r�r^z
need to splitN)r_r-r-rur�)ror�r_s   rf�
check_ndimra�
s���$�{�{�T���
#�#)�;�;�-�s�4�&��
;�
�	
�
�v�|�|�,��;�;�$���(�(.���}�D���a�A��
��y�>�S��[�(��/��F��}�=%�%(��^�$4�6��
�)�

���s�9�~��*���)�)�+�rhc��t|t�r,|j�}|r|dkDrtj|�}t|t
�r|j}||fS)zU
    Ensure that we don't allow NumpyExtensionArray / NumpyEADtype in internals.
    r^)rvr:�to_numpyr��
atleast_2dr6�numpy_dtype)rorur_s   rf�extract_pandas_arrayrf�
sQ���&�0�1����"���D�1�H��]�]�6�*�F��%��&��!�!���5�=�rhc��|�g}t|t�r<|D]5}t|t�r|j|��%|j|��7|St|t�sJt|���|j|�|S)z.return a new extended blocks, given the result)rvrVr�r�rnr�)r�r�rs   rfrr�
su��
�~����&�$���A��!�T�"��
�
�a� ��
�
�a� �	��M��&�%�(�6�$�v�,�6�(��
�
�f���Mrhc��|j|kr3t|j�std|�}|j	dd�}|S)z:
    Reshape if possible to have values.ndim == ndim.
    z+np.ndarray | DatetimeArray | TimedeltaArrayr^r�)r_r-rur	r�)ror_s  rfr�r��
s@��
�{�{�T��"�6�<�<�0��G��P�F��^�^�A�r�*�F��Mrhc�*�t|ttf�r|jt�St|t
tf�r|j}t|tj�r+t�r!|j�}d|j_
|S)a+
    The array that Series.values returns (public attribute).

    This has some historical constraints, and is overridden in block
    subclasses to return the correct array (e.g. period returns
    object ndarray and datetimetz a datetime64[ns] ndarray instead of
    proper extension array).
    F)rvrOrMr�r[rKrPrOr�r�r�view�flags�	writeablerws rfr�r�sn���&�;�
�6�7��}�}�V�$�$�	�F�]�N�;�	<������&�"�*�*�%�*=�*?������!&������Mrh)rerrjr)rorrjr)rurrjztype[Block]rz)rorr�rrqr�)r�rr_rprqr�rjrn)r�rr_rprjr�)rorrur�r_rprjz!tuple[ArrayLike, DtypeObj | None]ri)r^)rorr_rprjr)��
__future__r�	functoolsrrrJ�typingrrrrr	r
r�rX�numpyr��pandas._configrrr
�pandas._libsrr�libinternalsr�pandas._libs.internalsrr�pandas._libs.missingr�pandas._typingrrrrrrrrrrrr�
pandas.errorsr!�pandas.util._decoratorsr"�pandas.util._exceptionsr#�pandas.util._validatorsr$�pandas.core.dtypes.astyper%r&�pandas.core.dtypes.castr'r(r)r*r+r,�pandas.core.dtypes.commonr-r.r/r0r1r2�pandas.core.dtypes.dtypesr3r4r5r6r7�pandas.core.dtypes.genericr8r9r:r;�pandas.core.dtypes.missingr<r=r>�pandas.corer?�pandas.core.algorithms�core�
algorithmsr��pandas.core.array_algos.putmaskr@rArBrCrD� pandas.core.array_algos.quantilerE�pandas.core.array_algos.replacerFrGrH�"pandas.core.array_algos.transformsrI�pandas.core.arraysrJrKrLrMrNrOrP�pandas.core.baserQ�pandas.core.common�commonr&�pandas.core.computationrR�pandas.core.constructionrSrT�pandas.core.indexersrU�pandas.core.indexes.baserV�collections.abcrWrX�pandas.core.apirY�pandas.core.arrays._mixinsrZrur{rF�COW_WARNING_SETITEM_MSGrlrnrr�r?rHrLr	rQrSr�rZr�r�rarfrr�r�rsrhrf�<module>r�sG��"���	����������
�$�
�
�
�
�.�2�4�7������������ �&�&���=���
5����*� � �/��7�7���
&�F��R�X�X�h�
�
������"[(�L�,�,�,�[(�|8Z8�E�Z8�zZ�]�Z�z���4�:���*��5�-�5�+�3�+��'���:�<RV�
A��
A�"0�
A�8N�
A�$$(�D��D��	D�
!�D��
D�'*�T���-��58��&��,
� 
� rh

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists