
    PiG             
      f   d Z ddlmZ ddlmZmZmZmZmZ ddl	Z	ddl
Z
ddlZddlmZ ddlmZmZmZmZmZmZmZ ddlZddlZddlmZmZmZ ddlmZ dd	lm Z  dd
l!m"Z"m#Z# ddl$m%Z% ddl&m'Z( ddl)m*Z*m+Z+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1m2Z2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8m9Z9m:Z: ddl;m<Z< ddl=m>Z>m?Z?m@Z@mAZAmBZBmCZC ddlDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZM ddlNmOZO ddlPmQZQmRZR ddlSmTZT ddlUmVZVmWZWmXZXmYZY ddlZm[Z[m\Z\m]Z^m_Z_m`Z`maZa ddlbmcZc ddldmeZe ddlfmgZg ddlhmiZimjZj ddlkmlZl ddlmmnZn dd lompZqmrZrmsZs dd!ltmuZu dd"lvmwZwmxZx dd#lymzZz dd$l{m|Z|m}Z}m~Z~mZmZmZmZ ddlmc mc m\Z dd%lmZ dd&lmZmZ dd'lmZ dd(lmZ dd)lmZ dd*lmZmZ dd+lmZ dd,lmZ ddlmc mc mZ dd-lmZ ddlZerXdd.lmZ dd/lmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ dd0lmZ dd1lmZ d2gZd3d2d4d5d6d7d2d8d9d:	Z e4d;           G d< d2e\j        eu                      ZdS )=zG
Data structure for 1-dimensional cross-sectional and time series data
    )annotations)CallableHashableIterableMappingSequenceN)dedent)IOTYPE_CHECKINGAnyLiteralSelfcastoverload)lib
propertiesreshape)is_range_indexer)CHAINED_WARNING_DISABLED)	REF_COUNTREF_COUNT_METHOD)import_optional_dependency)function)ChainedAssignmentErrorInvalidIndexErrorPandas4Warning)%_chained_assignment_method_update_msg_chained_assignment_msg)Appenderdeprecate_nonkeyword_argumentsdoc
set_module)find_stack_level)validate_ascendingvalidate_bool_kwargvalidate_percentile)astype_is_view)LossySetitemError"construct_1d_arraylike_from_scalarfind_common_typeinfer_dtype_frommaybe_box_nativemaybe_unbox_numpy_scalar)	is_dict_likeis_float
is_integeris_iteratoris_list_likeis_object_dtype	is_scalarpandas_dtypevalidate_all_hashable)ExtensionDtype)ABCDataFrame	ABCSeries)is_hashable)isnana_value_for_dtypenotnaremove_na_arraylike)
algorithmsbasecommonnanopsops	roperator)Accessor)SeriesApply)ExtensionArray)ListAccessorStructAccessor)CategoricalAccessor)SparseAccessor)arrayextract_arraysanitize_array)NDFrame)disallow_ndim_indexingunpack_1tuple)CombinedDatetimelikeProperties)DatetimeIndexIndex
MultiIndexPeriodIndexdefault_indexensure_indexmaybe_sequence_to_range)maybe_droplevels)check_bool_indexercheck_dict_or_set_indexers)SingleBlockManager)selectn)_shared_docs)ensure_key_mappednargsort)StringMethods)to_datetime)
SeriesInfo)BlockValuesRefs)!AggFuncTypeAnyAllAnyArrayLike	ArrayLikeArrowArrayExportableArrowStreamExportableAxisAxisIntCorrelationMethodDropKeepDtypeDtypeObjFilePath	FrequencyIgnoreRaiseIndexKeyFunc
IndexLabelLevelListLikeMutableMappingT
NaPositionNumpySorterNumpyValueArrayLikeQuantileInterpolationReindexMethodRenamerScalarSortKindStorageOptionsSuffixesValueKeyFuncWriteBuffernpt	DataFrameSeriesGroupBySeriesindexz{0 or 'index'}zXaxis : {0 or 'index'}
        Unused. Parameter needed for compatibility with DataFrame.z[inplace : bool, default False
        If True, performs operation inplace and returns None.
np.ndarray z
index : array-like, optional
    New labels for the index. Preferably an Index object to avoid
    duplicating data.
axis : int or str, optional
    Unused.)	axesklassaxes_single_argaxisinplaceunique
duplicatedoptional_byoptional_reindexpandasc                      e Zd ZU dZdZeeej        fZ	de
d<   dgZde
d<   ddhej        z  Zh d	Zej        j        ej        z   eg           z  Zd
Z eej        j        j        ej        j        j                  Zde
d<   	 	 	 	 	 dddZ	 dddZddZedd            Zd Zedd             Zd! Zedd#            Zedd%            Zedd&            Z edd'            Z!e!j"        dd)            Z!ed*             Z#ed+             Z$edd-            Z% e&ej        j'        j                  edd/                        Z'dd1Z(	 ddd4Z)edd6            Z*ddd<Z+ddd?Z,d@ Z-dA Z.ddDZ/ddGZ0dddJZ1ddKZ2ddLZ3ddMZ4ddNZ5ddOZ6dddPZ7dddSZ8e9	 ddTdTdTdTdUdd^            Z:e9	 ddTdTdTd_d da            Z:e9	 ddTdTdTdbddc            Z:	 ddHe;j<        dHdHdUddfZ:ddhZ=e9	 ddTdTdTdTdTdTdTdTdTdi	dds            Z>e9dTdTdTdTdTdTdTdTdTdi	ddu            Z> e?e@dvdjgdwx          	 	 	 	 	 	 	 	 	 	 ddd|            Z>e9	 ddTdTdTd}dd            ZAe9dTdTdTd}d	d            ZAe9dTdTdTd}d
d            ZA e?e@dvdjgdx          	 	 	 	 dd
d            ZAddZBddZCe9dd            ZDe9dTddd            ZDeEdddZDe;j<        fddZFeGdd            ZHdddZI e& eJd                     e&eKd         eLz             e?e@g ddx          	 	 	 	 	 	 	 ddd                                    ZMddZNdddZOd fdZPe9dTdTdTddd            ZQe9dTdTddd            ZQe9dTdTdTddd            ZQddHdHdd fdZQdddZRdddZSdddZTdddZUe9	 d d!d            ZVe9	 dd"d            ZVe9	 	 d d#dÄ            ZV	 	 d$d#dƄZV	 	 d%d&d̄ZW	 	 d'd(dτZXd)d*dфZYd)d+dӄZZd,dքZ[dׄ Z\d؄ Z]	 	 d-d.dZ^dd/dZ_	 	 	 	 d0d1 fdZ`	 dd2dZad3dZbd4dZce9dTdTdTdTdTdTdTdd5d            Zde9dTdTdTdTdTdTdd6d            Zde9dTdTdTdTdTdTdTdd7d            Zdd7dzdHd ddHddd8dZde9dTdTdTdTdTdTdTdTdd9d            Zee9dTdTdTdTdTdTdTdTdTd	d:d	            Zee9dTdTdTdTdTdTdTdTdTd	d;d
            Zed7ddzdHd ddzdHdd	d< fdZe	 	 	 	 d=d>dZf	 d?d@dZg	 d?d@dZhdde;j<        fdAdZidBdZjddCdZk	 	 	 dDdEdZl	 	 	 dFdGd#ZmddHd%Zn eJd&          Zo eJd'          ZpdIdJd(ZqeqZr	 ddKd*Zs	 dLd,d-dMd2ZtdNd5Zudd6Zve9	 ddTdTdTdTd7dOd=            Zwe9	 ddTdTdTdTdTd>dPd?            Zw	 dde;j<        dHdd@d>dQ fdAZwd7e;j<        dBdR fdCZx	 ddde;j<        dddddDdS fdHZye9	 ddTdTdTdIdTdL            Zze9	 ddTdTdTdTdMdUdN            Zze9	 ddTdTdTdTdMdVdP            Zze;j<        fe;j<        d7e;j<        dHdMdV fdQZze9	 ddTdTdTdTdTdRdWdV            Z{e9	 ddTdTdTdTdTdTdWdXdX            Z{e9	 ddTdTdTdTdTdTdWdYdY            Z{	 dd7ddddHdZdWdY fd[Z{dZ fd]Z|	 	 	 	 	 d[d\dcZ}d]d^deZ~d3dfZ	 d_d`djZdadmZd3dnZ eej        eLdo         p          d3 fdq            Zd3 fdrZ eej        eLdo         p          d3 fds            Ze9dTdTdTdTdtdbdw            Ze9dTdTdTdxdcdy            Zd7dHddHdtdddzZdd{e;j<        fdedZde;j<        fdfdZdgZde
d<    ee          Zd7Zde
d<   dZde
d<    ej        d7d          Z edge          Z ede          Z ede          Z edej        j                  Z ede          Z ede          Z ede          Zej        j        Zd Zd Zd ZddgdZddhdZdidZddd7ddJdZ	 	 	 djdkdZ e& ej        dd                    djdld            ZdjdldZ e& ej        dd                    djdld            ZdjdldZ e& ej        dd                    djdld            ZdjdldZ e& ej        dd                    djdld            Z e& ej        dd                    djdld            ZeZ e& ej        dd                    djdld            Z	 	 	 djdkdZeZ e& ej        dd                    djdld            ZdjdldZeZeZ e& ej        dd                    djdld            ZeZ e& ej        dd                    djdld            Z e& ej        dd                    djdld            ZdjdldZ e& ej        dd                    djdld            Z e& ej        dd                    djdld            Z e& ej        dd                    djdld            Z e& ej        dd                    djdld            Z e& ej        dd                    djdld            Zd7dzdHdddmdÄZd7dHdzdĜdndƄZ e?e@dvgdǬx          	 	 	 dodndȄ            Z e?e@dvgdɬx          	 	 	 dpdqdʄ            Z e?e@dvgdˬx          	 	 	 dpdqd̄            Z e?e@dvgdͬx          	 	 	 	 drdsdτ            Z e?e@dvgdЬx          	 	 	 	 drdsdф            Z e?e@dvgdҬx          	 	 	 dpdtdӄ            Z e?e@dvgdԬx          	 	 	 dpdtdՄ            Z e?e@dvgd֬x          	 	 	 	 dudvdׄ            Z e?e@dvgdجx          	 	 	 	 dudvdل            Z e?e@dvgdڬx          	 	 	 	 dudvdۄ            Z e?e@dvgdܬx          	 	 	 dpdqd݄            Z e?e@dvgdެx          	 	 	 dpdqd߄            ZeZeZؐddwdZِddwdZڐddwdZېddwdZ܈ xZS (x  r   a  
    One-dimensional ndarray with axis labels (including time series).

    Labels need not be unique but must be a hashable type. The object
    supports both integer- and label-based indexing and provides a host of
    methods for performing operations involving the index. Statistical
    methods from ndarray have been overridden to automatically exclude
    missing data (currently represented as NaN).

    Operations between Series (+, -, /, \*, \*\*) align values based on their
    associated index values-- they need not be the same length. The result
    index will be the sorted union of the two indexes.

    Parameters
    ----------
    data : array-like, Iterable, dict, or scalar value
        Contains data stored in Series. If data is a dict, argument order is
        maintained. Unordered sets are not supported.
    index : array-like or Index (1d)
        Values must be hashable and have the same length as `data`.
        Non-unique index values are allowed. Will default to
        RangeIndex (0, 1, 2, ..., n) if not provided. If data is dict-like
        and index is None, then the keys in the data are used as the index. If the
        index is not None, the resulting Series is reindexed with the index values.
    dtype : str, numpy.dtype, or ExtensionDtype, optional
        Data type for the output Series. If not specified, this will be
        inferred from `data`.
        See the :ref:`user guide <basics.dtypes>` for more usages.
    name : Hashable, default None
        The name to give to the Series.
    copy : bool, default None
        Whether to copy input data, only relevant for array, Series, and Index
        inputs (for other input, e.g. a list, a new array is created anyway).
        Defaults to True for array input and False for Index/Series.
        Even when False for Index/Series, a shallow copy of the data is made.
        Set to False to avoid copying array input at your own risk (if you
        know the input data won't be modified elsewhere).
        Set to True to force copying Series/Index input up front.

    See Also
    --------
    DataFrame : Two-dimensional, size-mutable, potentially heterogeneous tabular data.
    Index : Immutable sequence used for indexing and alignment.

    Notes
    -----
    Please reference the :ref:`User Guide <basics.series>` for more information.

    Examples
    --------
    Constructing Series from a dictionary with an Index specified

    >>> d = {"a": 1, "b": 2, "c": 3}
    >>> ser = pd.Series(data=d, index=["a", "b", "c"])
    >>> ser
    a   1
    b   2
    c   3
    dtype: int64

    The keys of the dictionary match with the Index values, hence the Index
    values have no effect.

    >>> d = {"a": 1, "b": 2, "c": 3}
    >>> ser = pd.Series(data=d, index=["x", "y", "z"])
    >>> ser
    x   NaN
    y   NaN
    z   NaN
    dtype: float64

    Note that the Index is first built with the keys from the dictionary.
    After this the Series is reindexed with the given Index values, hence we
    get all NaN as a result.

    Constructing Series from a list with `copy=False`.

    >>> r = [1, 2]
    >>> ser = pd.Series(r, copy=False)
    >>> ser.iloc[0] = 999
    >>> r
    [1, 2]
    >>> ser
    0    999
    1      2
    dtype: int64

    Due to input data type the Series has a `copy` of
    the original data even though `copy=False`, so
    the data is unchanged.

    Constructing Series from a 1d ndarray with `copy=False`.

    >>> r = np.array([1, 2])
    >>> ser = pd.Series(r, copy=False)
    >>> ser.iloc[0] = 999
    >>> r
    array([999,   2])
    >>> ser
    0    999
    1      2
    dtype: int64

    Due to input data type the Series has a `view` on
    the original data, so
    the data is changed as well.
    seriesr   _namez	list[str]	_metadatar   name>   dtcatstrsparsei  )r!   r]   _mgrNdtypeDtype | Nonecopybool | NonereturnNonec                
   d}t          |t                    r|||du s|}|sGt          j        dt	          |          j         dt	          |           j         dt          d           |                    d          }t          j	        | |           || _
        d S t          |t          t          j        f          r>|dur:|"t          |j        t!          |                    r|                                }d}|d}t          |t                    rc|sa|                    d          }|sIt          j        dt	          |          j         dt	          |           j         dt          d           d}t#          j        ||t	          |                     }|t'          |          }||                     |          }|E||nt+          d	          }t-          |          s|t/          t!          |          d
          }ng }t          |t0                    rt3          d          d }t          |t4                    r"||                    |          }|s|j        }nt          |t          j                  r%t-          |j                  rt;          d          nt          |t<                    r[|$|j        }|j                             d          }nb|!                    |          }|j         }|"                    d	          rd}n-t          |tF                    r| $                    |||          \  }}d }d}nt          |t                    r||j        }n+|j        %                    |          r|rtM          d          |sIt          j        dt	          |          j         dt	          |           j         dt          d           d}nct          |t                    rnMtO          j(        |          }tS          |          r*t-          |          s|t          j        tT                    }|/tS          |          s|g}t+          t-          |                    }n$tS          |          rtO          j+        ||           t          |t                    rU|:t          |j        t!          |                    sd}|                    |          }|r|                    d          }n)tY          ||||          }t          j-        |||          }t          j	        | |           || _
        | .                    d	|           d S )NFz
Passing a z to zK is deprecated and will raise in a future version. Use public APIs instead.   
stackleveldeepTr   compatz8initializing a Series from a MultiIndex is not supportedzVCannot construct a Series from an ndarray with compound dtype.  Use DataFrame instead.zkCannot pass both SingleBlockManager `data` argument and a different `index` argument. `copy` must be False.r   )refs)/
isinstancer]   warningswarntype__name__r   r   rO   __init__r   rG   npndarrayr'   r   r5   ibasemaybe_extract_namerX   _validate_dtyperW   lenr<   rU   NotImplementedErrorrT   astype_references
ValueErrorr   r   r   reindex_has_no_referencer   
_init_dictequalsAssertionErrorcommaybe_iterable_to_listr2   objectrequire_length_matchrN   
from_array	_set_axis)selfdatar   r   r   r   	allow_mgrr   s           f/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/core/series.pyr   zSeries.__init__q  s    	t/00	$, /d!4 / /$t**:M / / / #     99%9((DT4(((DIFd^RZ899 	!5  =N4:|E?R?R$S$S=99;;D D<Dd.// 	! 	!99%9((D !/d!4 / /$t**:M / / / #     !	'dDJJ?? ''E((//E<".EEM!4D4DE5zz U.),u*=*=eLLLdJ'' 	%J   dE"" 7	) {{5)) ('bj)) 1	)4:  !>   f%% )	)}
y~~5~11||E**y))!,, ! Dg&&  	)//$u==KD%EDD011 	)}
Z&&u--   %>    !/d!4 / /$t**:M / / / #     !	n-- 	)-d33DD!! )#d)) )((=%% v!#d)),,EE$ 	2$T5111 d.// 		I %dj,u2E2EFF ! D{{{// ,yydy++!$ud;;D%0u4HHHDt$$$	q%         r   r   Index | NoneDtypeObj | Nonec                   |rPt          t          |                                                    }t          |                                          }nH|5t          |          s|t          t          |          d          }ng }|}nt          d          g }}t          |||          }|r||
                    |          }|j        |j        fS )aM  
        Derive the "_mgr" and "index" attributes of a new Series from a
        dictionary input.

        Parameters
        ----------
        data : dict or dict-like
            Data used to populate the new Series.
        index : Index or None, default None
            Index for the new Series: if None, use dict keys.
        dtype : np.dtype, ExtensionDtype, or None, default None
            The dtype for the new Series: if None, infer from data.

        Returns
        -------
        _data : BlockManager for the new Series
        index : index for the new Series
        NFr   r   )r   r   )rY   tuplekeyslistvaluesr   r<   r5   rW   r   r   r   r   )r   r   r   r   r   r   ss          r   r   zSeries._init_dict	  s    .  	0
 +5+=+=>>D$++--((FF 5zz U.+L,?,?NNNDD(++R&D 6U333  	!E%		%  Avqwr   c                   t          dd          }||j                            |          nd}|                    | |          }t	          ||j                  s|                    |g          }|                                S )a  
        Export the pandas Series as an Arrow C stream PyCapsule.

        This relies on pyarrow to convert the pandas Series to the Arrow
        format (and follows the default behavior of ``pyarrow.Array.from_pandas``
        in its handling of the index, i.e. to ignore it).
        This conversion is not necessarily zero-copy.

        Parameters
        ----------
        requested_schema : PyCapsule, default None
            The schema to which the dataframe should be casted, passed as a
            PyCapsule containing a C ArrowSchema representation of the
            requested schema.

        Returns
        -------
        PyCapsule
        pyarrowz16.0.0min_versionN)r   )r   DataType_import_from_c_capsulerL   r   ChunkedArraychunked_array__arrow_c_stream__)r   requested_schemapar   cas        r   r   zSeries.__arrow_c_stream__<  s    ( (	xHHH  + K../?@@@ 	
 XXdX&&"bo.. 	(!!2$''B$$&&&r   type[Series]c                    t           S N)r   r   s    r   _constructorzSeries._constructor]  s    r   c                    t                               ||          }d |_        t          |           t           u r|S |                     |          S Nr   )r   	_from_mgrr   r   r   )r   mgrr   sers       r   _constructor_from_mgrzSeries._constructor_from_mgra  sO    s..	:: J   %%%r   Callable[..., DataFrame]c                    ddl m} |S )z}
        Used when a manipulation result has one higher dimension as the
        original, such as Series.to_frame()
        r   r   )pandas.core.framer   )r   r   s     r   _constructor_expanddimzSeries._constructor_expanddimn  s     	0/////r   c                    ddl m}  |j        ||j                  }t	          |           t
          u r|S |                     |          S )Nr   r   r   )r   r   r   r   r   r   r   )r   r   r   r   dfs        r   _constructor_expanddim_from_mgrz&Series._constructor_expanddim_from_mgrx  s[    ////// Y 38444:: I **2...r   boolc                    | j         j        S r   )r   _can_hold_nar   s    r   r   zSeries._can_hold_na  s    y%%r   rq   c                    | j         j        S )a  
        Return the dtype object of the underlying data.

        See Also
        --------
        Series.dtypes : Return the dtype object of the underlying data.
        Series.astype : Cast a pandas object to a specified dtype dtype.
        Series.convert_dtypes : Convert columns to the best possible dtypes using dtypes
            supporting pd.NA.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.dtype
        dtype('int64')
        )r   r   r   s    r   r   zSeries.dtype  s    $ yr   c                    | j         S )a  
        Return the dtype object of the underlying data.

        See Also
        --------
        DataFrame.dtypes :  Return the dtypes in the DataFrame.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.dtypes
        dtype('int64')
        r   r   s    r   dtypeszSeries.dtypes  s      zr   c                    | j         S )aN  
        Return the name of the Series.

        The name of a Series becomes its index or column name if it is used
        to form a DataFrame. It is also used whenever displaying the Series
        using the interpreter.

        Returns
        -------
        label (hashable object)
            The name of the Series, also the column name if part of a DataFrame.

        See Also
        --------
        Series.rename : Sets the Series name when given a scalar input.
        Index.name : Corresponding Index property.

        Examples
        --------
        The Series name can be set initially when calling the constructor.

        >>> s = pd.Series([1, 2, 3], dtype=np.int64, name="Numbers")
        >>> s
        0    1
        1    2
        2    3
        Name: Numbers, dtype: int64
        >>> s.name = "Integers"
        >>> s
        0    1
        1    2
        2    3
        Name: Integers, dtype: int64

        The name of a Series within a DataFrame is its column name.

        >>> df = pd.DataFrame(
        ...     [[1, 2], [3, 4], [5, 6]], columns=["Odd Numbers", "Even Numbers"]
        ... )
        >>> df
           Odd Numbers  Even Numbers
        0            1             2
        1            3             4
        2            5             6
        >>> df["Even Numbers"].name
        'Even Numbers'
        )r   r   s    r   r   zSeries.name  s    b zr   valuec                    t          |t          |           j         d           t                              | d|           d S )Nz.name)
error_namer   )r6   r   r   r   __setattr__)r   r  s     r   r   zSeries.name  sE    e4::3F0M0M0MNNNN4%00000r   c                4    | j                                         S )a  
        Return Series as ndarray or ndarray-like depending on the dtype.

        .. warning::

           We recommend using :attr:`Series.array` or
           :meth:`Series.to_numpy`, depending on whether you need
           a reference to the underlying data or a NumPy array.

        Returns
        -------
        numpy.ndarray or ndarray-like

        See Also
        --------
        Series.array : Reference to the underlying data.
        Series.to_numpy : A NumPy array representing the underlying data.

        Examples
        --------
        >>> pd.Series([1, 2, 3]).values
        array([1, 2, 3])

        >>> pd.Series(list("aabc")).values
        <ArrowStringArray>
        ['a', 'a', 'b', 'c']
        Length: 4, dtype: str

        >>> pd.Series(list("aabc")).astype("category").values
        ['a', 'a', 'b', 'c']
        Categories (3, str): ['a', 'b', 'c']

        Timezone aware datetime data is converted to UTC:

        >>> pd.Series(pd.date_range("20130101", periods=3, tz="US/Eastern")).values
        array(['2013-01-01T05:00:00.000000',
               '2013-01-02T05:00:00.000000',
               '2013-01-03T05:00:00.000000'], dtype='datetime64[us]')
        )r   external_valuesr   s    r   r   zSeries.values  s    R y((***r   c                4    | j                                         S )aT  
        Return the internal repr of this data (defined by Block.interval_values).
        This are the values as stored in the Block (ndarray or ExtensionArray
        depending on the Block class), with datetime64[ns] and timedelta64[ns]
        wrapped in ExtensionArrays to match Index._values behavior.

        Differs from the public ``.values`` for certain data types, because of
        historical backwards compatibility of the public attribute (e.g. period
        returns object ndarray and datetimetz a datetime64[ns] ndarray for
        ``.values`` while it returns an ExtensionArray for ``._values`` in those
        cases).

        Differs from ``.array`` in that this still returns the numpy array if
        the Block is backed by a numpy array (except for datetime64 and
        timedelta64 dtypes), while ``.array`` ensures to always return an
        ExtensionArray.

        Overview:

        dtype       | values        | _values       | array                 |
        ----------- | ------------- | ------------- | --------------------- |
        Numeric     | ndarray       | ndarray       | NumpyExtensionArray   |
        Category    | Categorical   | Categorical   | Categorical           |
        dt64[ns]    | ndarray[M8ns] | DatetimeArray | DatetimeArray         |
        dt64[ns tz] | ndarray[M8ns] | DatetimeArray | DatetimeArray         |
        td64[ns]    | ndarray[m8ns] | TimedeltaArray| TimedeltaArray        |
        Period      | ndarray[obj]  | PeriodArray   | PeriodArray           |
        Nullable    | EA            | EA            | EA                    |

        )r   internal_valuesr   s    r   _valueszSeries._values  s    @ y((***r   re   c                $    | j         j        j        S r   )r   _blockr   r   s    r   r   zSeries._references7  s    y$$r   rG   c                8    | j                                         }|S r   )r   array_values)r   arrs     r   rL   zSeries.array;  s     i$$&& 
r   intc                *    t          | j                  S )z2
        Return the length of the Series.
        )r   r   r   s    r   __len__zSeries.__len__D  s     49~~r   npt.DTypeLike | Noner   c                    | j         }|t          j        ||          }nt          j        |||          }|du r|S |du st	          |j        |j                  r |                                }d|j        _        |S )a\  
        Return the values as a NumPy array.

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

        Parameters
        ----------
        dtype : str or numpy.dtype, optional
            The dtype to use for the resulting NumPy array. By default,
            the dtype is inferred from the data.

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

        Returns
        -------
        numpy.ndarray
            The values in the series converted to a :class:`numpy.ndarray`
            with the specified `dtype`.

        See Also
        --------
        array : Create a new array from data.
        Series.array : Zero-copy view to the array backing the Series.
        Series.to_numpy : Series method for similar behavior.

        Examples
        --------
        >>> ser = pd.Series([1, 2, 3])
        >>> np.asarray(ser)
        array([1, 2, 3])

        For timezone-aware data, the timezones may be retained with
        ``dtype='object'``

        >>> tzser = pd.Series(pd.date_range("2000", periods=2, tz="CET"))
        >>> np.asarray(tzser, dtype="object")
        array([Timestamp('2000-01-01 00:00:00+0100', tz='CET'),
               Timestamp('2000-01-02 00:00:00+0100', tz='CET')],
              dtype=object)

        Or the values may be localized to UTC and the tzinfo discarded with
        ``dtype='datetime64[ns]'``

        >>> np.asarray(tzser, dtype="datetime64[ns]")  # doctest: +ELLIPSIS
        array(['1999-12-31T23:00:00.000000000', ...],
              dtype='datetime64[ns]')
        Nr   )r   r   TF)	r	  r   asarrayrL   r'   r   viewflags	writeable)r   r   r   r   r  s        r   	__array__zSeries.__array__L  s    h <*V5111CC(6T:::C4<<J5==N6<CC=((**C"'CI
r   list[Index]c                    | j         gS )z7
        Return a list of the row axis labels.
        r   r   s    r   r   zSeries.axes  s    
 
|r   r   ir   rm   r   c                    | j         |         S )z
        Return the i-th value or values in the Series by location.

        Parameters
        ----------
        i : int

        Returns
        -------
        scalar
        )r	  )r   r  r   s      r   _ixszSeries._ixs  s     |Ar   slobjslicec                    | j                             ||          }|                     ||j                  }| j        |_        |                    |           S )N)r   r   )r   	get_slicer   r   r   __finalize__)r   r  r   r   outs        r   _slicezSeries._slice  sU     i!!%d!33((38(<<J	%%%r   c                   t          |           t          j        ||           }|t          u r|                     d          S t          |          }t          |t          t          f          rt          |          }n|r| 
                    |          S t          |          rt          |          }t          |d          r{	 | 
                    |          }|S # t          t          t          f$ rI t          |t                    r1t          | j        t"                    r|                     |          cY S Y nw xY wt          |t&                    r|                     |          S t          j        |          rEt-          | j        |          }t/          j        |t2                    }|                     |          S |                     |          S )NFr   )allow_slicer   )r\   r   apply_if_callableEllipsisr   r4   r   r   r   rQ   
_get_valuer1   r:   KeyError	TypeErrorr   r   rU   _get_values_tupler   _getitem_sliceis_bool_indexerr[   r   r  r   _get_rows_with_mask	_get_with)r   keykey_is_scalarresults       r   __getitem__zSeries.__getitem__  s   "3'''#C..(??99%9(((!#cD%=)) 	($$CC 	( ??3''' s 	s))Cs... 	77--i):; 7 7 7 c5)) 7jZ.P.P 7  11#666667 c5!! 	,&&s+++s## 	1$TZ55C*S---C++C000~~c"""s   C AD=<D=c                    t          |t                    rt          d          t          |t                    r|                     |          S | j        |         S )NzWIndexing a Series with DataFrame is not supported, use the appropriate DataFrame column)r   r8   r,  r   r-  loc)r   r2  s     r   r1  zSeries._get_with  s`    c<(( 	/B   U## 	/))#...x}r   r2  r   c                   t          j        | r0t          j        | j        |                   }t          |           |S t          | j        t                    st          d          | j        
                    |          \  }}|                     | j        |         |d          }t          |t                    r|j                            | j                   |                    |           S )N0key of type tuple not found and not a MultiIndexFr   r   )r   any_noner   r  r	  rP   r   r   rU   r+  get_loc_levelr   r   r   add_referencesr#  )r   r2  r4  indexer	new_indexnew_sers         r   r-  zSeries._get_values_tuple  s    < 	 ZS 122F"6***M$*j11 	OMNNN "Z55c::##DL$9QV#WWgu%% 	3L''	222##D)))r   r>  npt.NDArray[np.bool_]c                    | j                             |          }|                     ||j                                      |           S r   )r   get_rows_with_maskr   r   r#  )r   r>  new_mgrs      r   r0  zSeries._get_rows_with_mask  sA    )..w77))')EERRSWXXXr   Ftakeablec                L   |r| j         |         S | j                            |          }t          |          r| j         |         S t	          | j        t
                    r| j        }| j         |         }t          |          dk    r|j        dk    r|d         S ||         }t          ||          }| 	                    ||| j
        d          }t	          |t                    r|j                            | j                   |                    |           S | j        |         S )z
        Quickly retrieve single value at passed index label.

        Parameters
        ----------
        label : object
        takeable : interpret the index as indexers, default False

        Returns
        -------
        scalar value
           r   Fr   r   r   )r	  r   get_locr0   r   rU   r   nlevelsrZ   r   r   r   r   r=  r#  iloc)r   labelrE  r7  mi
new_valuesr?  r@  s           r   r*  zSeries._get_value  s"     	'<&& j  ''c?? 	%<$$dj*-- 	"Bc*J:!##
a!!}$3I(E::I'')$)% (  G #u%% 7++DI666''--- 9S>!r   c                   t           sRt          j        |           t          k    r5t	          j        |           s!t          j        t          t          d           t          |           t	          j        ||           }|t          u rt          d           }t          |t                    r2| j                            |d          }|                     ||          S 	 |                     ||           d S # t&          $ r || j        |<   Y d S t*          t,          t.          f$ r4 | j                            |          }|                     ||           Y d S t2          $ rm}t          |t4                    r*t          | j        t6                    st'          d          |t	          j        |          rt;          | j        |          }t=          j        |t@                    }tC          |          rtE          |          tE          |           k    r_t          |tF                    sJtI          | j%                  s6|&                                d         }|                     ||           Y d }~d S 	 | '                    | |d	           n# t2          $ r || j(        |<   Y nw xY wY d }~d S | )                    ||           Y d }~d S d }~ww xY w)
Nr   r   getitemkindr9  r   r   Tr   )*r   sysgetrefcountr   r   is_local_in_caller_framer   r   r   r   r\   r(  r)  r   r   r   _convert_slice_indexer_set_values_set_with_enginer+  r7  r,  r   r(   rI  r   r   rU   r/  r[   r   r  r   r2   r   r   r3   r   nonzero_whererK  	_set_with)r   r2  r  r>  errs        r   __setitem__zSeries.__setitem__.  s   ' 	t$$	11#:V; ;1 +-CPQ    	#3'''#C..(??++Cc5!! 	4j77)7LLG##GU3330	+!!#u----- 	" 	" 	" "DHSMMMM:'89 	- 	- 	-j((--GWe,,,,,,  #	+ #	+ #	+#u%% jZ.P.P  F  "3'' +(S99jD111 !''E

c$ii//&uf55 0+DJ77 0 "kkmmA.G$$We444FFFFF+KKeTK::::( + + +%*DIcNNN+  sE*********G#	+sP   C6 6KAK
K DK2JKJ# K"J##K,KKc                p    | j                             |          }| j                            ||           d S r   )r   rI  r   setitem_inplace)r   r2  r  r7  s       r   rY  zSeries._set_with_engines  s7    j  %% 		!!#u-----r   c                    t          |t                    rJ t          |          rt          |          }|                     ||           d S r   )r   r   r1   r   _set_labelsr   r2  r  s      r   r\  zSeries._set_withy  sQ     c5)))))s 	s))Ce$$$$$r   c                    t          j        |          }| j                            |          }|dk    }|                                rt          ||          d          |                     ||           d S )Nz not in index)r   asarray_tuplesafer   get_indexeranyr+  rX  )r   r2  r  r>  masks        r   rb  zSeries._set_labels  sw    #C(("j44S99"}88:: 	8c$i666777%(((((r   c                    t          |t          t          f          r|j        }| j                            ||          | _        d S )N)r>  r  )r   rT   r   r	  r   setitemrc  s      r   rX  zSeries._set_values  s?    cE6?++ 	+CI%%c%??			r   c                    |s7	 | j                             |          }n# t          $ r || j        |<   Y dS w xY w|}|                     ||           dS )a  
        Quickly set single value at passed label.

        If label is not contained, a new object is created with the label
        placed at the end of the result index.

        Parameters
        ----------
        label : object
            Partial indexing with MultiIndex not allowed.
        value : object
            Scalar value.
        takeable : interpret the index as indexers, default False
        N)r   rI  r+  r7  rX  )r   rL  r  rE  r7  s        r   
_set_valuezSeries._set_value  sx      	j((//   "'
 Ce$$$$$s    77repeatsint | Sequence[int]c                    t          j        dd|i           | j                            |          }| j                            |          }|                     ||d                              | d          S )a  
        Repeat elements of a Series.

        Returns a new Series where each element of the current Series
        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
            Series.
        axis : None
            Unused. Parameter needed for compatibility with DataFrame.

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

        See Also
        --------
        Index.repeat : Equivalent function for Index.
        numpy.repeat : Similar method for :class:`numpy.ndarray`.

        Examples
        --------
        >>> s = pd.Series(["a", "b", "c"])
        >>> s
        0    a
        1    b
        2    c
        dtype: str
        >>> s.repeat(2)
        0    a
        0    a
        1    b
        1    b
        2    c
        2    c
        dtype: str
        >>> s.repeat([1, 2, 3])
        0    a
        1    b
        1    b
        2    c
        2    c
        2    c
        dtype: str
         r   Fr:  repeatmethod)nvvalidate_repeatr   rr  r	  r   r#  )r   rn  r   r?  rN  s        r   rr  zSeries.repeat  s~    f 	2~...J%%g..	\((11
  95 IIVV W 
 
 	
r   .)dropr   r   allow_duplicateslevelrv   rw  Literal[False]rw   r   rx  r   c                   d S r   rq  r   ry  rw  r   r   rx  s         r   reset_indexzSeries.reset_index  s	     Cr   )r   r   rx  Literal[True]c                   d S r   rq  r|  s         r   r}  zSeries.reset_index  s	     r   )rw  r   rx  c                   d S r   rq  r|  s         r   r}  zSeries.reset_index   	     sr   IndexLabel | NoneDataFrame | Series | Nonec               l    t          |d          }|rt          t                               }|gt          |t          t
          f          s|g}n|} fd|D             }t          |           j        j        k     r j                            |          }|r| _        n 	                    d          }||_        |
                     d          S |rt          d          |t          j        u r j        d	}n j        }                     |          }	|	                    |||
          S dS )a|  
        Generate a new DataFrame or Series with the index reset.

        This is useful when the index needs to be treated as a column, or
        when the index is meaningless and needs to be reset to the default
        before another operation.

        Parameters
        ----------
        level : int, str, tuple, or list, default optional
            For a Series with a MultiIndex, only remove the specified levels
            from the index. Removes all levels by default.
        drop : bool, default False
            Just reset the index, without inserting it as a column in
            the new DataFrame.
        name : object, optional
            The name to use for the column containing the original Series
            values. Uses ``self.name`` by default. This argument is ignored
            when `drop` is True.
        inplace : bool, default False
            Modify the Series in place (do not create a new object).
        allow_duplicates : bool, default False
            Allow duplicate column labels to be created.

        Returns
        -------
        Series or DataFrame or None
            When `drop` is False (the default), a DataFrame is returned.
            The newly created columns will come first in the DataFrame,
            followed by the original Series values.
            When `drop` is True, a `Series` is returned.
            In either case, if ``inplace=True``, no value is returned.

        See Also
        --------
        DataFrame.reset_index: Analogous function for DataFrame.

        Examples
        --------
        >>> s = pd.Series(
        ...     [1, 2, 3, 4],
        ...     name="foo",
        ...     index=pd.Index(["a", "b", "c", "d"], name="idx"),
        ... )

        Generate a DataFrame with default index.

        >>> s.reset_index()
          idx  foo
        0   a    1
        1   b    2
        2   c    3
        3   d    4

        To specify the name of the new column use `name`.

        >>> s.reset_index(name="values")
          idx  values
        0   a       1
        1   b       2
        2   c       3
        3   d       4

        To generate a new Series with the default set `drop` to True.

        >>> s.reset_index(drop=True)
        0    1
        1    2
        2    3
        3    4
        Name: foo, dtype: int64

        The `level` parameter is interesting for Series with a multi-level
        index.

        >>> arrays = [
        ...     np.array(["bar", "bar", "baz", "baz"]),
        ...     np.array(["one", "two", "one", "two"]),
        ... ]
        >>> s2 = pd.Series(
        ...     range(4),
        ...     name="foo",
        ...     index=pd.MultiIndex.from_arrays(arrays, names=["a", "b"]),
        ... )

        To remove a specific level from the Index, use `level`.

        >>> s2.reset_index(level="a")
               a  foo
        b
        one  bar    0
        two  bar    1
        one  baz    2
        two  baz    3

        If `level` is not set, all levels are removed from the Index.

        >>> s2.reset_index()
             a    b  foo
        0  bar  one    0
        1  bar  two    1
        2  baz  one    2
        3  baz  two    3
        r   Nc                D    g | ]}j                             |          S rq  )r   _get_level_number).0levr   s     r   
<listcomp>z&Series.reset_index.<locals>.<listcomp>  s)    VVVCdj::3??VVVr   Fr   r}  rs  z<Cannot reset_index inplace on a Series to create a DataFramer   )ry  rw  rx  )r%   rW   r   r   r   r   r   rJ  	droplevelr   r#  r,  r   
no_defaultr   to_framer}  )
r   ry  rw  r   r   rx  r?  
level_listr@  r   s
   `         r   r}  zSeries.reset_index  sb   b &gy99 "	%c$ii00I !%%77 '"'JJ!&JVVVV:VVV
z??TZ%777 $
 4 4Z @ @I H&

)))// )++D+GGG 	N   s~%% 9$DD9Dt$$B>>$9I "    tr   r   c                B    t          j                    } | j        di |S )zI
        Return a string representation for a particular Series.
        rq  )fmtget_series_repr_params	to_string)r   repr_paramss     r   __repr__zSeries.__repr__  s*     022t~,,,,,r   )	na_repfloat_formatheaderr   lengthr   r   max_rowsmin_rowsbufr  r  
str | Noner  r  r  
int | Noner  c       	            d S r   rq  r   r  r  r  r  r   r  r   r   r  r  s              r   r  zSeries.to_string  s	     cr   FilePath | WriteBuffer[str]c       	            d S r   rq  r  s              r   r  zSeries.to_string  s	     sr   r   r  )allowed_argsr   NaNT"FilePath | WriteBuffer[str] | Nonec                   t          j        | ||||||||
|	
  
        }|                                }t          |t                    s$t          dt          |          j                  ||S t          |d          r|	                    |           n?t          |dd          5 }|	                    |           ddd           n# 1 swxY w Y   dS )aq  
        Render a string representation of the Series.

        Parameters
        ----------
        buf : StringIO-like, optional
            Buffer to write to.
        na_rep : str, optional
            String representation of NaN to use, default 'NaN'.
        float_format : one-parameter function, optional
            Formatter function to apply to columns' elements if they are
            floats, default None.
        header : bool, default True
            Add the Series header (index name).
        index : bool, optional
            Add index (row) labels, default True.
        length : bool, default False
            Add the Series length.
        dtype : bool, default False
            Add the Series dtype.
        name : bool, default False
            Add the Series name if not None.
        max_rows : int, optional
            Maximum number of rows to show before truncating. If None, show
            all.
        min_rows : int, optional
            The number of rows to display in a truncated repr (when number
            of rows is above `max_rows`).

        Returns
        -------
        str or None
            String representation of Series if ``buf=None``, otherwise None.

        See Also
        --------
        Series.to_dict : Convert Series to dict object.
        Series.to_frame : Convert Series to DataFrame object.
        Series.to_markdown : Print Series in Markdown-friendly format.
        Series.to_timestamp : Cast to DatetimeIndex of Timestamps.

        Examples
        --------
        >>> ser = pd.Series([1, 2, 3]).to_string()
        >>> ser
        '0    1\n1    2\n2    3'
        )	r   r  r  r   r   r  r  r  r  z.result must be of type str, type of result is Nwritewzutf-8)encoding)r  SeriesFormatterr  r   r   r   r   r   hasattrr  open)r   r  r  r  r  r   r  r   r   r  r  	formatterr4  fs                 r   r  zSeries.to_string  s<   ~ '%
 
 
	 $$&& &#&& 	 : $V 5: :  
 ;MS'"" 	 IIfc3111  Q                             ts   (C

CCmoder   storage_optionsr  r  StorageOptions | Nonec                   d S r   rq  r   r  r  r   r  kwargss         r   to_markdownzSeries.to_markdown)  s	     cr   IO[str]c                   d S r   rq  r  s         r   r  zSeries.to_markdown4  r  r   IO[str] | Nonec                   d S r   rq  r  s         r   r  zSeries.to_markdown?  s	     Sr   r  wtc                J     |                                  j        |f|||d|S )aN	  
        Print Series in Markdown-friendly format.

        Parameters
        ----------
        buf : str, Path or StringIO-like, optional, default None
            Buffer to write to. If None, the output is returned as a string.
        mode : str, optional
            Mode in which file is opened, "wt" by default.
        index : bool, optional, default True
            Add index (row) labels.

        storage_options : dict, optional
            Extra options that make sense for a particular storage connection, e.g.
            host, port, username, password, etc. For HTTP(S) URLs the key-value pairs
            are forwarded to ``urllib.request.Request`` as header options. For other
            URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are
            forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more
            details, and for more examples on storage options refer `here
            <https://pandas.pydata.org/docs/user_guide/io.html?
            highlight=storage_options#reading-writing-remote-files>`_.

        **kwargs
            These parameters will be passed to `tabulate                 <https://pypi.org/project/tabulate>`_.

        Returns
        -------
        str
            Series in Markdown-friendly format.

        See Also
        --------
        Series.to_frame : Rrite a text representation of object to the system clipboard.
        Series.to_latex : Render Series to LaTeX-formatted table.

        Notes
        -----
        Requires the `tabulate <https://pypi.org/project/tabulate>`_ package.

        Examples
            --------
            >>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
            >>> print(s.to_markdown())
            |    | animal   |
            |---:|:---------|
            |  0 | elk      |
            |  1 | pig      |
            |  2 | dog      |
            |  3 | quetzal  |

            Output markdown with a tabulate option.

            >>> print(s.to_markdown(tablefmt="grid"))
            +----+----------+
            |    | animal   |
            +====+==========+
            |  0 | elk      |
            +----+----------+
            |  1 | pig      |
            +----+----------+
            |  2 | dog      |
            +----+----------+
            |  3 | quetzal  |
            +----+----------+
        r  )r  r  r  s         r   r  zSeries.to_markdownJ  s@    Z +t}}*
%
 
LR
 
 	
r   Iterable[tuple[Hashable, Any]]c                d    t          t          | j                  t          |           d          S )a  
        Lazily iterate over (index, value) tuples.

        This method returns an iterable tuple (index, value). This is
        convenient if you want to create a lazy iterator.

        Returns
        -------
        iterable
            Iterable of tuples containing the (index, value) pairs from a
            Series.

        See Also
        --------
        DataFrame.items : Iterate over (column name, Series) pairs.
        DataFrame.iterrows : Iterate over DataFrame rows as (index, Series) pairs.

        Examples
        --------
        >>> s = pd.Series(["A", "B", "C"])
        >>> for index, value in s.items():
        ...     print(f"Index : {index}, Value : {value}")
        Index : 0, Value : A
        Index : 1, Value : B
        Index : 2, Value : C
        Tstrict)zipiterr   r   s    r   itemszSeries.items  s)    6 4
##T$ZZ====r   rT   c                    | j         S )ap  
        Return alias for index.

        Returns
        -------
        Index
            Index of the Series.

        See Also
        --------
        Series.index : The index (axis labels) of the Series.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3], index=[0, 1, 2])
        >>> s.keys()
        Index([0, 1, 2], dtype='int64')
        r  r   s    r   r   zSeries.keys  s    & zr   into'type[MutableMappingT] | MutableMappingTry   c                   d S r   rq  r   r  s     r   to_dictzSeries.to_dict  s	     #r   )r  
type[dict]dictc                   d S r   rq  r  s     r   r  zSeries.to_dict  s    :=#r   c                  t          j        |          }t          | j                  st	          | j        t
                    r' |d |                                 D                       S  ||                                           S )a  
        Convert Series to {label -> value} dict or dict-like object.

        Parameters
        ----------
        into : class, default dict
            The collections.abc.MutableMapping subclass to use as the return
            object. Can be the actual class or an empty instance of the mapping
            type you want.  If you want a collections.defaultdict, you must
            pass it initialized.

        Returns
        -------
        collections.abc.MutableMapping
            Key-value representation of Series.

        See Also
        --------
        Series.to_list: Converts Series to a list of the values.
        Series.to_numpy: Converts Series to NumPy ndarray.
        Series.array: ExtensionArray of the data backing this Series.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3, 4])
        >>> s.to_dict()
        {0: 1, 1: 2, 2: 3, 3: 4}
        >>> from collections import OrderedDict, defaultdict
        >>> s.to_dict(into=OrderedDict)
        OrderedDict([(0, 1), (1, 2), (2, 3), (3, 4)])
        >>> dd = defaultdict(list)
        >>> s.to_dict(into=dd)
        defaultdict(<class 'list'>, {0: 1, 1: 2, 2: 3, 3: 4})
        c              3  >   K   | ]\  }}|t          |          fV  d S r   )r,   )r  kvs      r   	<genexpr>z!Series.to_dict.<locals>.<genexpr>  s4      LLtq!1.q112LLLLLLr   )r   standardize_mappingr3   r   r   r7   r  )r   r  into_cs      r   r  zSeries.to_dict  s{    P (..4:&& 	(*TZ*P*P 	(6LLtzz||LLLLLL 6$**,,'''r   c                ,   |t           j        u r*| j        }|t          d          }n!t	          |g          }nt	          |g          }| j                            |          }|                     ||j                  }|	                    | d          S )aB  
        Convert Series to DataFrame.

        Parameters
        ----------
        name : object, optional
            The passed name should substitute for the series name (if it has
            one).

        Returns
        -------
        DataFrame
            DataFrame representation of Series.

        See Also
        --------
        Series.to_dict : Convert Series to dict object.

        Examples
        --------
        >>> s = pd.Series(["a", "b", "c"], name="vals")
        >>> s.to_frame()
          vals
        0    a
        1    b
        2    c
        NrG  r   r  rs  )
r   r  r   rW   rT   r   	to_2d_mgrr   r   r#  )r   r   columnsr   r   s        r   r  zSeries.to_frame  s    : 3>!!9D|'**--TFmmGi!!'**11#CH1EEtJ777r   ,ArrowArrayExportable | ArrowStreamExportablec                B   t          dd          }t          ||j        |j        f          s[t	          |d          s5t	          |d          s%t          dt          |          j         d          |                    |          }n|}|	                                }|S )a  
        Construct a Series from an array-like Arrow object.

        This function accepts any Arrow-compatible array-like object implementing
        the `Arrow PyCapsule Protocol`_ (i.e. having an ``__arrow_c_array__``
        or ``__arrow_c_stream__`` method).

        This function currently relies on ``pyarrow`` to convert the object
        in Arrow format to pandas.

        .. _Arrow PyCapsule Protocol: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html

        .. versionadded:: 3.0

        Parameters
        ----------
        data : pyarrow.Array or Arrow-compatible object
            Any array-like object implementing the Arrow PyCapsule Protocol
            (i.e. has an ``__arrow_c_array__`` or ``__arrow_c_stream__``
            method).

        Returns
        -------
        Series

        See Also
        --------
        DataFrame.from_arrow : Construct a DataFrame from an Arrow object.

        Examples
        --------
        >>> import pyarrow as pa
        >>> arrow_array = pa.array([1, 2, 3])
        >>> pd.Series.from_arrow(arrow_array)
        0    1
        1    2
        2    3
        dtype: int64
        r   z14.0.0r   __arrow_c_array__r   zxExpected an Arrow-compatible array-like object (i.e. having an '_arrow_c_array__' or '__arrow_c_stream__' method), got 'z
' instead.)
r   r   Arrayr   r  r,  r   r   r   	to_pandas)clsr   r   pa_arrayr   s        r   
from_arrowzSeries.from_arrow8  s    R (	xHHH$2? ;<< 	122
4!566
  8T

+8 8 8   ''--HHH  ""
r   c                h    t          |d          }|r| n|                     d          }||_        |S )z
        Set the Series name.

        Parameters
        ----------
        name : str
        inplace : bool
            Whether to modify `self` directly or return a copy.
        r   Fr   )r%   r   r   )r   r   r   r   s       r   	_set_namezSeries._set_namev  s;     &gy998dd499%9#8#8
r   a  
        Examples
        --------
        >>> ser = pd.Series([390., 350., 30., 20.],
        ...                 index=['Falcon', 'Falcon', 'Parrot', 'Parrot'],
        ...                 name="Max Speed")
        >>> ser
        Falcon    390.0
        Falcon    350.0
        Parrot     30.0
        Parrot     20.0
        Name: Max Speed, dtype: float64

        We can pass a list of values to group the Series data by custom labels:

        >>> ser.groupby(["a", "b", "a", "b"]).mean()
        a    210.0
        b    185.0
        Name: Max Speed, dtype: float64

        Grouping by numeric labels yields similar results:

        >>> ser.groupby([0, 1, 0, 1]).mean()
        0    210.0
        1    185.0
        Name: Max Speed, dtype: float64

        We can group by a level of the index:

        >>> ser.groupby(level=0).mean()
        Falcon    370.0
        Parrot     25.0
        Name: Max Speed, dtype: float64

        We can group by a condition applied to the Series values:

        >>> ser.groupby(ser > 100).mean()
        Max Speed
        False     25.0
        True     370.0
        Name: Max Speed, dtype: float64

        **Grouping by Indexes**

        We can groupby different levels of a hierarchical index
        using the `level` parameter:

        >>> arrays = [['Falcon', 'Falcon', 'Parrot', 'Parrot'],
        ...           ['Captive', 'Wild', 'Captive', 'Wild']]
        >>> index = pd.MultiIndex.from_arrays(arrays, names=('Animal', 'Type'))
        >>> ser = pd.Series([390., 350., 30., 20.], index=index, name="Max Speed")
        >>> ser
        Animal  Type
        Falcon  Captive    390.0
                Wild       350.0
        Parrot  Captive     30.0
                Wild        20.0
        Name: Max Speed, dtype: float64

        >>> ser.groupby(level=0).mean()
        Animal
        Falcon    370.0
        Parrot     25.0
        Name: Max Speed, dtype: float64

        We can also group by the 'Type' level of the hierarchical index
        to get the mean speed for each type:

        >>> ser.groupby(level="Type").mean()
        Type
        Captive    210.0
        Wild       185.0
        Name: Max Speed, dtype: float64

        We can also choose to include `NA` in group keys or not by defining
        `dropna` parameter, the default setting is `True`.

        >>> ser = pd.Series([1, 2, 3, 3], index=["a", 'a', 'b', np.nan])
        >>> ser.groupby(level=0).sum()
        a    3
        b    3
        dtype: int64

        To include `NA` values in the group keys, set `dropna=False`:

        >>> ser.groupby(level=0, dropna=False).sum()
        a    3
        b    3
        NaN  3
        dtype: int64

        We can also group by a custom list with NaN values to handle
        missing group labels:

        >>> arrays = ['Falcon', 'Falcon', 'Parrot', 'Parrot']
        >>> ser = pd.Series([390., 350., 30., 20.], index=arrays, name="Max Speed")
        >>> ser.groupby(["a", "b", "a", np.nan]).mean()
        a    210.0
        b    350.0
        Name: Max Speed, dtype: float64

        >>> ser.groupby(["a", "b", "a", np.nan], dropna=False).mean()
        a    210.0
        b    350.0
        NaN   20.0
        Name: Max Speed, dtype: float64
        groupby)r   byry  as_indexsort
group_keysobserveddropnar   c           
     |    ddl m} ||t          d          |st          d           || |||||||          S )Nr   r   z*You have to supply one of 'by' and 'level'z(as_index=False only valid with DataFrame)objr   ry  r  r  r  r  r  )pandas.core.groupby.genericr   r,  )	r   r  ry  r  r  r  r  r  r   s	            r   r  zSeries.groupby  sx    z 	>======RZHIII 	HFGGG}!	
 	
 	
 		
r   c                    t          t          | j                                                                      d                    S )a  
        Return number of non-NA/null observations in the Series.

        Returns
        -------
        int
            Number of non-null values in the Series.

        See Also
        --------
        DataFrame.count : Count non-NA cells for each column or row.

        Examples
        --------
        >>> s = pd.Series([0.0, 1.0, np.nan])
        >>> s.count()
        2
        int64)r-   r=   r	  sumr   r   s    r   countzSeries.count  s6    & (dl(;(;(?(?(A(A(H(H(Q(QRRRr   c                J   | j         }t          |t          j                  rt	          j        ||          \  }}n|                    |          }|                     |t          t          |                    | j
        d| j                                      | d          S )ac  
        Return the mode(s) of the Series.

        The mode is the value that appears most often. There can be multiple modes.

        Always returns Series even if only one value is returned.

        Parameters
        ----------
        dropna : bool, default True
            Don't consider counts of NaN/NaT.

        Returns
        -------
        Series
            Modes of the Series in sorted order.

        See Also
        --------
        numpy.mode : Equivalent numpy function for computing median.
        Series.sum : Sum of the values.
        Series.median : Median of the values.
        Series.std : Standard deviation of the values.
        Series.var : Variance of the values.
        Series.min : Minimum value.
        Series.max : Maximum value.

        Examples
        --------
        >>> s = pd.Series([2, 4, 2, 2, 4, None])
        >>> s.mode()
        0    2.0
        dtype: float64

        More than one mode:

        >>> s = pd.Series([2, 4, 8, 2, 4, None])
        >>> s.mode()
        0    2.0
        1    4.0
        dtype: float64

        With and without considering null value:

        >>> s = pd.Series([2, 4, None, None, 4, None])
        >>> s.mode(dropna=False)
        0   NaN
        dtype: float64
        >>> s = pd.Series([2, 4, None, None, 4, None])
        >>> s.mode()
        0    4.0
        dtype: float64
        )r  F)r   r   r   r   r  rs  )r	  r   r   r   r?   r  _moder   ranger   r   r   r#  )r   r  r   
res_values_s        r   r  zSeries.mode-  s    n fbj)) 	5&OF6BBBMJV44J   J((* ! 
 
 ,tF,
+
+	,r   ri   c                D    t                                                      S )a  
        Return unique values of Series object.

        Uniques are returned in order of appearance. Hash table-based unique,
        therefore does NOT sort.

        Returns
        -------
        ndarray or ExtensionArray
            The unique values returned as a NumPy array. See Notes.

        See Also
        --------
        Series.drop_duplicates : Return Series with duplicate values removed.
        unique : Top-level unique method for any 1-d array-like object.
        Index.unique : Return Index with unique values from an Index object.

        Notes
        -----
        Returns the unique values as a NumPy array. In case of an
        extension-array backed Series, a new
        :class:`~api.extensions.ExtensionArray` of that type with just
        the unique values is returned. This includes

            * Categorical
            * Period
            * Datetime with Timezone
            * Datetime without Timezone
            * Timedelta
            * Interval
            * Sparse
            * IntegerNA

        See Examples section.

        Examples
        --------
        >>> pd.Series([2, 1, 3, 3], name="A").unique()
        array([2, 1, 3])

        >>> pd.Series([pd.Timestamp("2016-01-01") for _ in range(3)]).unique()
        <DatetimeArray>
        ['2016-01-01 00:00:00']
        Length: 1, dtype: datetime64[us]

        >>> pd.Series(
        ...     [pd.Timestamp("2016-01-01", tz="US/Eastern") for _ in range(3)]
        ... ).unique()
        <DatetimeArray>
        ['2016-01-01 00:00:00-05:00']
        Length: 1, dtype: datetime64[us, US/Eastern]

        A Categorical will return categories in the order of
        appearance and with the same dtype.

        >>> pd.Series(pd.Categorical(list("baabc"))).unique()
        ['b', 'a', 'c']
        Categories (3, str): ['a', 'b', 'c']
        >>> pd.Series(
        ...     pd.Categorical(list("baabc"), categories=list("abc"), ordered=True)
        ... ).unique()
        ['b', 'a', 'c']
        Categories (3, str): ['a' < 'b' < 'c']
        )superr   r   	__class__s    r   r   zSeries.uniques  s    B ww~~r   )keepr   ignore_indexr  ro   r  c                   d S r   rq  r   r  r   r  s       r   drop_duplicateszSeries.drop_duplicates  s	     r   )r  r  c                   d S r   rq  r  s       r   r  zSeries.drop_duplicates  s	     sr   Series | Nonec                   d S r   rq  r  s       r   r  zSeries.drop_duplicates  s	     r   firstc                   t          |d          }t                                          |          }|r!t          t	          |                    |_        |r|                     |           dS |S )u]	  
        Return Series with duplicate values removed.

        Parameters
        ----------
        keep : {'first', 'last', ``False``}, default 'first'
            Method to handle dropping duplicates:

            - 'first' : Drop duplicates except for the first occurrence.
            - 'last' : Drop duplicates except for the last occurrence.
            - ``False`` : Drop all duplicates.

        inplace : bool, default ``False``
            If ``True``, performs operation inplace and returns None.

        ignore_index : bool, default ``False``
            If ``True``, the resulting axis will be labeled 0, 1, …, n - 1.

            .. versionadded:: 2.0.0

        Returns
        -------
        Series or None
            Series with duplicates dropped or None if ``inplace=True``.

        See Also
        --------
        Index.drop_duplicates : Equivalent method on Index.
        DataFrame.drop_duplicates : Equivalent method on DataFrame.
        Series.duplicated : Related method on Series, indicating duplicate
            Series values.
        Series.unique : Return unique values as an array.

        Examples
        --------
        Generate a Series with duplicated entries.

        >>> s = pd.Series(
        ...     ["llama", "cow", "llama", "beetle", "llama", "hippo"], name="animal"
        ... )
        >>> s
        0     llama
        1       cow
        2     llama
        3    beetle
        4     llama
        5     hippo
        Name: animal, dtype: str

        With the 'keep' parameter, the selection behavior of duplicated values
        can be changed. The value 'first' keeps the first occurrence for each
        set of duplicated entries. The default value of keep is 'first'.

        >>> s.drop_duplicates()
        0     llama
        1       cow
        3    beetle
        5     hippo
        Name: animal, dtype: str

        The value 'last' for parameter 'keep' keeps the last occurrence for
        each set of duplicated entries.

        >>> s.drop_duplicates(keep="last")
        1       cow
        3    beetle
        4     llama
        5     hippo
        Name: animal, dtype: str

        The value ``False`` for parameter 'keep' discards all sets of
        duplicated entries.

        >>> s.drop_duplicates(keep=False)
        1       cow
        3    beetle
        5     hippo
        Name: animal, dtype: str
        r   r  N)r%   r  r  rW   r   r   _update_inplace)r   r  r   r  r4  r  s        r   r  zSeries.drop_duplicates  sr    l &gy99((d(33 	6(V55FL 	  (((4Mr   c                    |                      |          }|                     || j        d          }|                    | d          S )a_  
        Indicate duplicate Series values.

        Duplicated values are indicated as ``True`` values in the resulting
        Series. Either all duplicates, all except the first or all except the
        last occurrence of duplicates can be indicated.

        Parameters
        ----------
        keep : {'first', 'last', False}, default 'first'
            Method to handle dropping duplicates:

            - '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
        -------
        Series[bool]
            Series indicating whether each value has occurred in the
            preceding values.

        See Also
        --------
        Index.duplicated : Equivalent method on pandas.Index.
        DataFrame.duplicated : Equivalent method on pandas.DataFrame.
        Series.drop_duplicates : Remove duplicate values from Series.

        Examples
        --------
        By default, for each set of duplicated values, the first occurrence is
        set on False and all others on True:

        >>> animals = pd.Series(["llama", "cow", "llama", "beetle", "llama"])
        >>> animals.duplicated()
        0    False
        1    False
        2     True
        3    False
        4     True
        dtype: bool

        which is equivalent to

        >>> animals.duplicated(keep="first")
        0    False
        1    False
        2     True
        3    False
        4     True
        dtype: bool

        By using 'last', the last occurrence of each set of duplicated values
        is set on False and all others on True:

        >>> animals.duplicated(keep="last")
        0     True
        1    False
        2     True
        3    False
        4    False
        dtype: bool

        By setting keep on ``False``, all duplicates are True:

        >>> animals.duplicated(keep=False)
        0     True
        1    False
        2     True
        3    False
        4     True
        dtype: bool
        r   Fr:  r   rs  )_duplicatedr   r   r#  )r   r  resr4  s       r   r   zSeries.duplicated+	  sP    X D))""3dju"EE""4"===r   rl   skipnac                j    |                      |          } | j        ||g|R i |}| j        |         S )a  
        Return the row label of the minimum value.

        If multiple values equal the minimum, the first row label with that
        value is returned.

        Parameters
        ----------
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        skipna : bool, default True
            Exclude NA/null values. If the entire Series is NA, or if ``skipna=False``
            and there is an NA value, this method will raise a ``ValueError``.
        *args, **kwargs
            Additional arguments and keywords have no effect but might be
            accepted for compatibility with NumPy.

        Returns
        -------
        Index
            Label of the minimum value.

        Raises
        ------
        ValueError
            If the Series is empty.

        See Also
        --------
        numpy.argmin : Return indices of the minimum values
            along the given axis.
        DataFrame.idxmin : Return index of first occurrence of minimum
            over requested axis.
        Series.idxmax : Return index *label* of the first occurrence
            of maximum of values.

        Notes
        -----
        This method is the Series version of ``ndarray.argmin``. This method
        returns the label of the minimum, while ``ndarray.argmin`` returns
        the position. To get the position, use ``series.values.argmin()``.

        Examples
        --------
        >>> s = pd.Series(data=[1, None, 4, 1], index=["A", "B", "C", "D"])
        >>> s
        A    1.0
        B    NaN
        C    4.0
        D    1.0
        dtype: float64

        >>> s.idxmin()
        'A'
        )_get_axis_numberargminr   r   r   r  argsr  rK  s         r   idxminzSeries.idxmin{	  sH    p $$T**t{49$999&99z$r   c                j    |                      |          } | j        ||g|R i |}| j        |         S )a  
        Return the row label of the maximum value.

        If multiple values equal the maximum, the first row label with that
        value is returned.

        Parameters
        ----------
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        skipna : bool, default True
            Exclude NA/null values. If the entire Series is NA, or if ``skipna=False``
            and there is an NA value, this method will raise a ``ValueError``.
        *args, **kwargs
            Additional arguments and keywords have no effect but might be
            accepted for compatibility with NumPy.

        Returns
        -------
        Index
            Label of the maximum value.

        Raises
        ------
        ValueError
            If the Series is empty.

        See Also
        --------
        numpy.argmax : Return indices of the maximum values
            along the given axis.
        DataFrame.idxmax : Return index of first occurrence of maximum
            over requested axis.
        Series.idxmin : Return index *label* of the first occurrence
            of minimum of values.

        Notes
        -----
        This method is the Series version of ``ndarray.argmax``. This method
        returns the label of the maximum, while ``ndarray.argmax`` returns
        the position. To get the position, use ``series.values.argmax()``.

        Examples
        --------
        >>> s = pd.Series(data=[1, None, 4, 3, 4], index=["A", "B", "C", "D", "E"])
        >>> s
        A    1.0
        B    NaN
        C    4.0
        D    3.0
        E    4.0
        dtype: float64

        >>> s.idxmax()
        'C'
        )r  argmaxr   r	  s         r   idxmaxzSeries.idxmax	  sH    r $$T**t{49$999&99z$r   decimalsc                   t          j        ||           t          |           dk    r|                                 S t	          | j                  rS| j        }t          j        |fdd          }| 	                    || j
        d                              | d          S | j                                      }|                     ||j        	                              | d          S )
a  
        Round each value in a Series to the given number of decimals.

        Parameters
        ----------
        decimals : int, default 0
            Number of decimal places to round to. If decimals is negative,
            it specifies the number of positions to the left of the decimal point.
        *args, **kwargs
            Additional arguments and keywords have no effect but might be
            accepted for compatibility with NumPy.

        Returns
        -------
        Series
            Rounded values of the Series.

        See Also
        --------
        numpy.around : Round values of an np.array.
        DataFrame.round : Round values of a DataFrame.
        Series.dt.round : Round values of data to the specified freq.

        Notes
        -----
        For values exactly halfway between rounded decimal values, pandas rounds
        to the nearest even value (e.g. -0.5 and 0.5 round to 0.0, 1.5 and 2.5
        round to 2.0, etc.).

        Examples
        --------
        >>> s = pd.Series([-0.5, 0.1, 2.5, 1.3, 2.7])
        >>> s.round()
        0   -0.0
        1    0.0
        2    2.0
        3    1.0
        4    3.0
        dtype: float64
        r   c                $    t          |           S r   )round)xr  s    r   <lambda>zSeries.round.<locals>.<lambda>%
  s    U1h5G5G r   F)convertr:  r  rs  )r  r   )ru  validate_roundr   r   r3   r   r	  r   	map_inferr   r   r#  r   r  r   r   )r   r  r
  r  r   r4  rD  s    `     r   r  zSeries.round	  s    T 	$'''t99>>99;;4:&& 	\F]6+G+G+G+GQVWWWF$$V4:E$JJWWW X    )//8/44))')EERR S 
 
 	
r   qfloatinterpolationr}   c                    d S r   rq  r   r  r  s      r   quantilezSeries.quantile.
  s	     r   Sequence[float] | AnyArrayLikec                    d S r   rq  r  s      r   r  zSeries.quantile3
  s	    
 r   &float | Sequence[float] | AnyArrayLikefloat | Seriesc                    d S r   rq  r  s      r   r  zSeries.quantile:
  s	    
 r         ?linearc                   t          |           |                                 }|                    ||d          }|j        dk    r|j        dddf         }t          |          rD| j        |_        t          |t          j	                  }| 
                    ||| j                  S t          |j        d                   S )a  
        Return value at the given quantile.

        Parameters
        ----------
        q : float or array-like, default 0.5 (50% quantile)
            The quantile(s) to compute, which can lie in range: 0 <= q <= 1.
        interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
            This optional parameter specifies the interpolation method to use,
            when the desired quantile lies between two data points `i` and `j`:

                * linear: `i + (j - i) * (x-i)/(j-i)`, where `(x-i)/(j-i)` is
                  the fractional part of the index surrounded by `i > j`.
                * lower: `i`.
                * higher: `j`.
                * nearest: `i` or `j` whichever is nearest.
                * midpoint: (`i` + `j`) / 2.

        Returns
        -------
        float or Series
            If ``q`` is an array, a Series will be returned where the
            index is ``q`` and the values are the quantiles, otherwise
            a float will be returned.

        See Also
        --------
        core.window.Rolling.quantile : Calculate the rolling quantile.
        numpy.percentile : Returns the q-th percentile(s) of the array elements.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3, 4])
        >>> s.quantile(0.5)
        2.5
        >>> s.quantile([0.25, 0.5, 0.75])
        0.25    1.75
        0.50    2.50
        0.75    3.25
        dtype: float64
        F)r  r  numeric_onlyr   Nr   r   r   r   )r&   r  r  ndimrK  r2   r   rT   r   float64r   r-   )r   r  r  r   r4  idxs         r   r  zSeries.quantileA
  s    \ 	A ]]__qERR;![A&F?? 	<)FK,,,C$$V3TY$GGG ,FKN;;;r   pearsonotherrt  rn   min_periodsc                   |                      |d          \  }}t          |          dk    rt          j        S |                    t
          t          j        d          }|                    t
          t          j        d          }|dv st          |          r)t          j        ||||          }t          |          }|S t          d| d	          )
a
  
        Compute correlation with `other` Series, excluding missing values.

        The two `Series` objects are not required to be the same length and will be
        aligned internally before the correlation function is applied.

        Parameters
        ----------
        other : Series
            Series with which to compute the correlation.
        method : {'pearson', 'kendall', 'spearman'} or callable
            Method used to compute correlation:

            - pearson : Standard correlation coefficient
            - kendall : Kendall Tau correlation coefficient
            - spearman : Spearman rank correlation
            - callable: Callable with input two 1d ndarrays and returning a float.

            .. warning::
                Note that the returned matrix from corr will have 1 along the
                diagonals and will be symmetric regardless of the callable's
                behavior.
        min_periods : int, optional
            Minimum number of observations needed to have a valid result.

        Returns
        -------
        float
            Correlation with other.

        See Also
        --------
        DataFrame.corr : Compute pairwise correlation between columns.
        DataFrame.corrwith : Compute pairwise correlation with another
            DataFrame or Series.

        Notes
        -----
        Pearson, Kendall and Spearman correlation are currently computed using pairwise complete observations.

        * `Pearson correlation coefficient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_
        * `Kendall rank correlation coefficient <https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient>`_
        * `Spearman's rank correlation coefficient <https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient>`_

        Automatic data alignment: as with all pandas operations, automatic data alignment is performed for this method.
        ``corr()`` automatically considers values with matching indices.

        Examples
        --------
        >>> def histogram_intersection(a, b):
        ...     v = np.minimum(a, b).sum().round(decimals=1)
        ...     return v
        >>> s1 = pd.Series([0.2, 0.0, 0.6, 0.2])
        >>> s2 = pd.Series([0.3, 0.6, 0.0, 0.1])
        >>> s1.corr(s2, method=histogram_intersection)
        0.3

        Pandas auto-aligns the values with matching indices

        >>> s1 = pd.Series([1, 2, 3], index=[0, 1, 2])
        >>> s2 = pd.Series([1, 2, 3], index=[2, 1, 0])
        >>> s1.corr(s2)
        -1.0

        If the input is a constant array, the correlation is not defined in this case,
        and ``np.nan`` is returned.

        >>> s1 = pd.Series([0.45, 0.45])
        >>> s1.corr(s1)
        nan
        innerjoinr   Fr   na_valuer   )r+  spearmankendall)rt  r-  zHmethod must be either 'pearson', 'spearman', 'kendall', or a callable, 'z' was supplied)alignr   r   nanto_numpyr  callablerB   nancorrr-   r   )r   r,  rt  r-  thisthis_valuesother_valuesr4  s           r   corrzSeries.corr
  s    Z jjWj55et99>>6Mmm%"&umMM~~EBF~OO7778F;K;K7^\&k  F .f55FM'' ' '
 
 	
r   rG  ddofc                b   |                      |d          \  }}t          |          dk    rt          j        S |                    t
          t          j        d          }|                    t
          t          j        d          }t          j        ||||          }t          |          }|S )aF  
        Compute covariance with Series, excluding missing values.

        The two `Series` objects are not required to be the same length and
        will be aligned internally before the covariance is calculated.

        Parameters
        ----------
        other : Series
            Series with which to compute the covariance.
        min_periods : int, optional
            Minimum number of observations needed to have a valid result.
        ddof : int, default 1
            Delta degrees of freedom.  The divisor used in calculations
            is ``N - ddof``, where ``N`` represents the number of elements.

        Returns
        -------
        float
            Covariance between Series and other normalized by N-1
            (unbiased estimator).

        See Also
        --------
        DataFrame.cov : Compute pairwise covariance of columns.

        Examples
        --------
        >>> s1 = pd.Series([0.90010907, 0.13484424, 0.62036035])
        >>> s2 = pd.Series([0.12528585, 0.26962463, 0.51111198])
        >>> s1.cov(s2)
        -0.01685762652715874
        r/  r0  r   Fr2  )r-  r?  )	r6  r   r   r7  r8  r  rB   nancovr-   )r   r,  r-  r?  r;  r<  r=  r4  s           r   covz
Series.cov
  s    N jjWj55et99>>6Mmm%"&umMM~~EBF~OO;T
 
 
 *&11r   periodsc                J   t          j        |          s2t          |          r|                                st          d          t	          j        | j        |          }|                     || j        	                                d          
                    | d          S )a  
        First discrete difference of Series elements.

        Calculates the difference of a Series element compared with another
        element in the Series (default is element in previous row).

        Parameters
        ----------
        periods : int, default 1
            Periods to shift for calculating difference, accepts negative
            values.

        Returns
        -------
        Series
            First differences of the Series.

        See Also
        --------
        Series.pct_change: Percent change over given number of periods.
        Series.shift: Shift index by desired number of periods with an
            optional time freq.
        DataFrame.diff: First discrete difference of object.

        Notes
        -----
        For boolean dtypes, this uses :meth:`operator.xor` rather than
        :meth:`operator.sub`.
        The result is calculated according to current dtype in Series,
        however dtype of the result is always float64.

        Examples
        --------

        Difference with previous row

        >>> s = pd.Series([1, 1, 2, 3, 5, 8])
        >>> s.diff()
        0    NaN
        1    0.0
        2    1.0
        3    1.0
        4    2.0
        5    3.0
        dtype: float64

        Difference with 3rd previous row

        >>> s.diff(periods=3)
        0    NaN
        1    NaN
        2    NaN
        3    2.0
        4    4.0
        5    6.0
        dtype: float64

        Difference with following row

        >>> s.diff(periods=-1)
        0    0.0
        1   -1.0
        2   -1.0
        3   -2.0
        4   -3.0
        5    NaN
        dtype: float64

        Overflow in input dtype

        >>> s = pd.Series([1, 0], dtype=np.uint8)
        >>> s.diff()
        0      NaN
        1    255.0
        dtype: float64
        zperiods must be an integerFr:  diffrs  )r   r0   r/   r   r?   rE  r	  r   r   r  r#  )r   rC  r4  s      r   rE  zSeries.diff  s    Z ~g&& 	?W%% ?'*<*<*>*> ? !=>>>w77  $*//++% ! 
 

,tF,
+
+	,r   lagc                x    |                      t          t          |                     |                              S )a  
        Compute the lag-N autocorrelation.

        This method computes the Pearson correlation between
        the Series and its shifted self.

        Parameters
        ----------
        lag : int, default 1
            Number of lags to apply before performing autocorrelation.

        Returns
        -------
        float
            The Pearson correlation between self and self.shift(lag).

        See Also
        --------
        Series.corr : Compute the correlation between two Series.
        Series.shift : Shift index by desired number of periods.
        DataFrame.corr : Compute pairwise correlation of columns.
        DataFrame.corrwith : Compute pairwise correlation between rows or
            columns of two DataFrame objects.

        Notes
        -----
        If the Pearson correlation is not well defined return 'NaN'.

        Examples
        --------
        >>> s = pd.Series([0.25, 0.5, 0.2, -0.05])
        >>> s.autocorr()  # doctest: +ELLIPSIS
        0.10355...
        >>> s.autocorr(lag=2)  # doctest: +ELLIPSIS
        -0.99999...

        If the Pearson correlation is not well defined, then 'NaN' is returned.

        >>> s = pd.Series([1, 0, 0, 0])
        >>> s.autocorr()
        nan
        )r>  r   r   shift)r   rF  s     r   autocorrzSeries.autocorri  s+    V yyfdjjoo66777r   AnyArrayLike | DataFrameSeries | np.ndarrayc                f   t          |t          t          f          r| j                            |j                  }t          |          t          | j                  k    s%t          |          t          |j                  k    rt          d          |                     |          }|                    |          }|j        }|j        }nV| j        }t          j
        |          }|j        d         |j        d         k    rt          d|j         d|j                   t          |t                    rot          | j        gt          |j                            }|                     t          j        ||          |j        d|                              | d	          S t          |t                    rt          j        ||          }nOt          |t          j                  rt          j        ||          }nt+          d
t-          |                     t/          |          S )a2  
        Compute the dot product between the Series and the columns of other.

        This method computes the dot product between the Series and another
        one, or the Series and each columns of a DataFrame, or the Series and
        each columns of an array.

        It can also be called using `self @ other`.

        Parameters
        ----------
        other : Series, DataFrame or array-like
            The other object to compute the dot product with its columns.

        Returns
        -------
        scalar, Series or numpy.ndarray
            Return the dot product of the Series and other if other is a
            Series, the Series of the dot product of Series and each rows of
            other if other is a DataFrame or a numpy.ndarray between the Series
            and each columns of the numpy array.

        See Also
        --------
        DataFrame.dot: Compute the matrix product with the DataFrame.
        Series.mul: Multiplication of series and other, element-wise.

        Notes
        -----
        The Series and other has to share the same index if other is a Series
        or a DataFrame.

        Examples
        --------
        >>> s = pd.Series([0, 1, 2, 3])
        >>> other = pd.Series([-1, 2, -3, 4])
        >>> s.dot(other)
        8
        >>> s @ other
        8
        >>> df = pd.DataFrame([[0, 1], [-2, 3], [4, -5], [6, 7]])
        >>> s.dot(df)
        0    24
        1    14
        dtype: int64
        >>> arr = np.array([[0, 1], [-2, 3], [4, -5], [6, 7]])
        >>> s.dot(arr)
        array([24, 14])
        zmatrices are not alignedr  r   zDot product shape mismatch, z vs F)r   r   r   dotrs  zunsupported type: )r   r   r8   r   unionr   r   r   r   r   r  shape	Exceptionr*   r   r   r   rM  r  r#  r   r,  r   r-   )	r   r,  rA   leftrightlvalsrvalscommon_typer4  s	            r   rM  z
Series.dot  s   d efl344 	Z%%ek22F6{{S__,,Fc%+>N>N0N0N !;<<<<<f<--DMMM//EKELEEKEJu%%E{1~Q//Q5;QQEKQQ   e\** 
	@*DK+M$u|:L:L+MNNK$$ue$$EM[ %  l4l../ v&& 	@VE5))FFrz** 	@VE5))FF>e>>???'///r   c                ,    |                      |          S zB
        Matrix multiplication using binary `@` operator.
        )rM  r   r,  s     r   
__matmul__zSeries.__matmul__  s     xxr   c                P    |                      t          j        |                    S rW  )rM  r   	transposerX  s     r   __rmatmul__zSeries.__rmatmul__  s      xxU++,,,r   rQ  $NumpyValueArrayLike | ExtensionArraysideLiteral['left', 'right']sorterNumpySorter | Nonenpt.NDArray[np.intp] | np.intpc                H    t           j                            | |||          S )a  
        Find indices where elements should be inserted to maintain order.

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

        .. note::
            The Series *must* be monotonically sorted, otherwise
            wrong locations will likely be returned. Pandas does *not*
            check this for you.

        Parameters
        ----------
        value : array-like or scalar
            Values 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 `self` into ascending
            order. They are typically the result of ``np.argsort``.

        Returns
        -------
        int or array of int
            A scalar or array of insertion points with the
            same shape as `value`.

        See Also
        --------
        sort_values : Sort by the values along either axis.
        numpy.searchsorted : Similar method from NumPy.

        Notes
        -----
        Binary search is used to find the required insertion points.

        Examples
        --------
        >>> ser = pd.Series([1, 2, 3])
        >>> ser
        0    1
        1    2
        2    3
        dtype: int64
        >>> ser.searchsorted(4)
        np.int64(3)
        >>> ser.searchsorted([0, 4])
        array([0, 3])
        >>> ser.searchsorted([1, 3], side="left")
        array([0, 2])
        >>> ser.searchsorted([1, 3], side="right")
        array([1, 3])
        >>> ser = pd.Series(pd.to_datetime(["3/11/2000", "3/12/2000", "3/13/2000"]))
        >>> ser
        0   2000-03-11
        1   2000-03-12
        2   2000-03-13
        dtype: datetime64[us]
        >>> ser.searchsorted("3/14/2000")
        np.int64(3)
        >>> ser = pd.Categorical(
        ...     ["apple", "bread", "bread", "cheese", "milk"], ordered=True
        ... )
        >>> ser
        ['apple', 'bread', 'bread', 'cheese', 'milk']
        Categories (4, str): ['apple' < 'bread' < 'cheese' < 'milk']
        >>> ser.searchsorted("bread")
        np.int64(1)
        >>> ser.searchsorted(["bread"], side="right")
        array([3])

        If the values are not monotonically sorted, wrong locations
        may be returned:

        >>> ser = pd.Series([2, 1, 3])
        >>> ser
        0    2
        1    1
        2    3
        dtype: int64
        >>> ser.searchsorted(1)  # doctest: +SKIP
        0  # wrong result, correct would be 1
        )r^  r`  )r@   IndexOpsMixinsearchsorted)r   r  r^  r`  s       r   re  zSeries.searchsorted  s%    x !..tUf.UUUr   	to_appendc                ,    ddl m}  || |g|          S )Nr   concat)r  )pandas.core.reshape.concatri  )r   rf  r  ri  s       r   _append_internalzSeries._append_internalT  s.    555555vtY'lCCCCr   rX  
align_axis
keep_shape
keep_equalresult_namesr   DataFrame | Seriesc                P    t                                          |||||          S )a	  
        Compare to another Series and show the differences.

        Parameters
        ----------
        other : Series
            Object to compare with.

        align_axis : {{0 or 'index', 1 or 'columns'}}, default 1
            Determine which axis to align the comparison on.

            * 0, or 'index' : Resulting differences are stacked vertically
              with rows drawn alternately from self and other.
            * 1, or 'columns' : Resulting differences are aligned horizontally
              with columns drawn alternately from self and other.

        keep_shape : bool, default False
            If true, all rows and columns are kept.
            Otherwise, only the ones with different values are kept.

        keep_equal : bool, default False
            If true, the result keeps values that are equal.
            Otherwise, equal values are shown as NaNs.

        result_names : tuple, default ('self', 'other')
            Set the dataframes names in the comparison.

        Returns
        -------
        Series or DataFrame
            If axis is 0 or 'index' the result will be a Series.
            The resulting index will be a MultiIndex with 'self' and 'other'
            stacked alternately at the inner level.

            If axis is 1 or 'columns' the result will be a DataFrame.
            It will have two columns namely 'self' and 'other'.

        See Also
        --------
        DataFrame.compare : Compare with another DataFrame and show differences.

        Notes
        -----
        Matching NaNs will not appear as a difference.

        Examples
        --------
        >>> s1 = pd.Series(["a", "b", "c", "d", "e"])
        >>> s2 = pd.Series(["a", "a", "c", "b", "e"])

        Align the differences on columns

        >>> s1.compare(s2)
          self other
        1    b     a
        3    d     b

        Stack the differences on indices

        >>> s1.compare(s2, align_axis=0)
        1  self     b
           other    a
        3  self     d
           other    b
        dtype: str

        Keep all original rows

        >>> s1.compare(s2, keep_shape=True)
          self other
        0  NaN   NaN
        1    b     a
        2  NaN   NaN
        3    d     b
        4  NaN   NaN

        Keep all original rows and also all original values

        >>> s1.compare(s2, keep_shape=True, keep_equal=True)
          self other
        0    a     a
        1    b     a
        2    c     c
        3    d     b
        4    e     e
        )r,  rl  rm  rn  ro  )r  compare)r   r,  rl  rm  rn  ro  r  s         r   rr  zSeries.compareY  s4    ~ ww!!!%  
 
 	
r   Series | Hashablefunc(Callable[[Hashable, Hashable], Hashable]
fill_valueHashable | Nonec                   |t          | j        d          }t          t                    r| j                            j                  }t          j        |           }t          j	        t          |          t                    }t          j        d          5  t          |          D ]@\  }}|                     ||          }	                    ||          }
 |	|
          ||<   A	 ddd           n# 1 swxY w Y   n|| j        }t          j	        t          |          t                    }t          j        d          5  fd| j        D             |dd<   ddd           n# 1 swxY w Y   | j        }| j                            |          }|                     ||j        ||d          S )	a  
        Combine the Series with a Series or scalar according to `func`.

        Combine the Series and `other` using `func` to perform elementwise
        selection for combined Series.
        `fill_value` is assumed when value is not present at some index
        from one of the two Series being combined.

        Parameters
        ----------
        other : Series or scalar
            The value(s) to be combined with the `Series`.
        func : function
            Function that takes two scalars as inputs and returns an element.
        fill_value : scalar, optional
            The value to assume when an index is missing from
            one Series or the other. The default specifies to use the
            appropriate NaN value for the underlying dtype of the Series.

        Returns
        -------
        Series
            The result of combining the Series with the other object.

        See Also
        --------
        Series.combine_first : Combine Series values, choosing the calling
            Series' values first.

        Examples
        --------
        Consider 2 Datasets ``s1`` and ``s2`` containing
        highest clocked speeds of different birds.

        >>> s1 = pd.Series({"falcon": 330.0, "eagle": 160.0})
        >>> s1
        falcon    330.0
        eagle     160.0
        dtype: float64
        >>> s2 = pd.Series({"falcon": 345.0, "eagle": 200.0, "duck": 30.0})
        >>> s2
        falcon    345.0
        eagle     200.0
        duck       30.0
        dtype: float64

        Now, to combine the two datasets and view the highest speeds
        of the birds across the two datasets

        >>> s1.combine(s2, max)
        duck        NaN
        eagle     200.0
        falcon    345.0
        dtype: float64

        In the previous example, the resulting value for duck is missing,
        because the maximum of a NaN and a float is a NaN.
        So, in the example, we set ``fill_value=0``,
        so the maximum value returned will be the value from some dataset.

        >>> s1.combine(s2, max, fill_value=0)
        duck       30.0
        eagle     200.0
        falcon    345.0
        dtype: float64
        NFr   r   ignoreallc                (    g | ]} |          S rq  rq  )r  lvrt  r,  s     r   r  z"Series.combine.<locals>.<listcomp>  s#     H H HRb% H H Hr   )r   r   r   r   )r<   r   r   r   r   rN  rC   get_op_result_namer   emptyr   r   errstate	enumerategetr	  r   rL   _cast_pointwise_resultr   )r   r,  rt  rv  r?  new_namerN  r  r*  r}  rvr  s    ``         r   combinezSeries.combine  sI   P +DJuEEEJeV$$ 	! 
((55I-dE::H#i..???J*** 1 1'	22 1 1FAs#z22B3
33B$(DRLLJqMM11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
I#i..???J*** I I H H H H H4< H H H
111I I I I I I I I I I I I I I IyHZ66zBB
  " ! 
 
 	
s%   !AC??DDE55E9<E9c                
   ddl m} | j        |j        k    rG| j                            |j                  r(|                     |                                 |          S | j                            |j                  }| }|j                            |j        t          |                             }|j                            |          }|
                    |          }|
                    |          }|j        j        dk    rG|j        j        dk    r7t          |          }t          j        dt          t!                                  |||g          }|
                    |          }|                    | d          S )a  
        Update null elements with value in the same location in 'other'.

        Combine two Series objects by filling null values in one Series with
        non-null values from the other Series. Result index will be the union
        of the two indexes.

        Parameters
        ----------
        other : Series
            The value(s) to be used for filling null values.

        Returns
        -------
        Series
            The result of combining the provided Series with the other object.

        See Also
        --------
        Series.combine : Perform element-wise operation on two Series
            using a given function.

        Examples
        --------
        >>> s1 = pd.Series([1, np.nan])
        >>> s2 = pd.Series([3, 4, 5])
        >>> s1.combine_first(s2)
        0    1.0
        1    4.0
        2    5.0
        dtype: float64

        Null values still persist if the location of that null value
        does not exist in `other`

        >>> s1 = pd.Series({"falcon": np.nan, "eagle": 160.0})
        >>> s2 = pd.Series({"eagle": 200.0, "duck": 30.0})
        >>> s1.combine_first(s2)
        duck       30.0
        eagle     160.0
        falcon      NaN
        dtype: float64
        r   rh  MzSilently casting non-datetime 'other' to datetime in Series.combine_first is deprecated and will be removed in a future version. Explicitly cast before calling combine_first instead.r   combine_firstrs  )rj  ri  r   r   r   ri  r;   rN  
differencer=   r   rR  rc   r   r   r   r#   r#  )r   r,  ri  r?  r;  
keep_other	keep_thiscombineds           r   r  zSeries.combine_first(  si   X 	655555:$$z  -- 5yye444J$$U[11	[++DJuT{{,CDD
J))*55	||I&&j)):?c!!ek&6#&=&=&&EM) +--    64-((##I..$$T/$BBBr   Series | Sequence | Mappingc                   t           sRt          j        |           t          k    r5t	          j        |           s!t          j        t          t          d           t          |t                    st          |          }|                    |           }t          |          }| j                            ||          | _        dS )a  
        Modify Series in place using values from passed Series.

        Uses non-NA values from passed Series to make updates. Aligns
        on index.

        Parameters
        ----------
        other : Series, or object coercible into Series
            Other Series that provides values to update the current Series.

        See Also
        --------
        Series.combine : Perform element-wise operation on two Series
            using a given function.
        Series.transform: Modify a Series using a function.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.update(pd.Series([4, 5, 6]))
        >>> s
        0    4
        1    5
        2    6
        dtype: int64

        >>> s = pd.Series(["a", "b", "c"])
        >>> s.update(pd.Series(["d", "e"], index=[0, 2]))
        >>> s
        0    d
        1    b
        2    e
        dtype: str

        >>> s = pd.Series([1, 2, 3])
        >>> s.update(pd.Series([4, 5, 6, 7, 8]))
        >>> s
        0    4
        1    5
        2    6
        dtype: int64

        If ``other`` contains NaNs the corresponding values are not updated
        in the original Series.

        >>> s = pd.Series([1, 2, 3])
        >>> s.update(pd.Series([4, np.nan, 6]))
        >>> s
        0    4
        1    2
        2    6
        dtype: int64

        ``other`` can also be a non-Series object type
        that is coercible into a Series

        >>> s = pd.Series([1, 2, 3])
        >>> s.update([4, np.nan, 6])
        >>> s
        0    4
        1    2
        2    6
        dtype: int64

        >>> s = pd.Series([1, 2, 3])
        >>> s.update({1: 9})
        >>> s
        0    1
        1    9
        2    3
        dtype: int64
        r   r   )ri  newN)r   rT  rU  r   r   rV  r   r   r   r   r   r   reindex_liker=   r   putmask)r   r,  ri  s      r   updatezSeries.updateu  s    T ( 	 !" "*-*Ft*L*L" 9*     %(( 	"5MME""4((U||I%%4U%;;			r   )r   	ascendingr   rR  na_positionr  r2  r  bool | Sequence[bool]rR  r   r  rz   r   c                   d S r   rq  r   r   r  r   rR  r  r  r2  s           r   sort_valueszSeries.sort_values  	     r   )r   r  rR  r  r  r2  c                   d S r   rq  r  s           r   r  zSeries.sort_values  	     sr   c                   d S r   rq  r  s           r   r  zSeries.sort_values  	     r   	quicksortlastValueKeyFunc | Nonec                  t          |d          }|                     |           t          |          r[t          t          t
                   |          }t          |          dk    r t          dt          |           d          |d         }t          |          }|dvrt          d|           |r)t          t          t          | |                    j        }n| j        }t          ||t          |          |          }	t          |	t          |	                    r-|r|                     |           S |                     d	          S |                     | j        |	         | j        |	         d
          }
|r!t%          t          |	                    |
_        |s|
                    | d          S |                     |
           dS )u1  
        Sort by the values.

        Sort a Series in ascending or descending order by some
        criterion.

        Parameters
        ----------
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        ascending : bool or list of bools, default True
            If True, sort values in ascending order, otherwise descending.
        inplace : bool, default False
            If True, perform operation in-place.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, default 'quicksort'
            Choice of sorting algorithm. See also :func:`numpy.sort` for more
            information. 'mergesort' and 'stable' are the only stable  algorithms.
        na_position : {'first' or 'last'}, default 'last'
            Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at
            the end.
        ignore_index : bool, default False
            If True, the resulting axis will be labeled 0, 1, …, n - 1.
        key : callable, optional
            If not None, apply the key function to the series values
            before sorting. This is similar to the `key` argument in the
            builtin :meth:`sorted` function, with the notable difference that
            this `key` function should be *vectorized*. It should expect a
            ``Series`` and return an array-like.

        Returns
        -------
        Series or None
            Series ordered by values or None if ``inplace=True``.

        See Also
        --------
        Series.sort_index : Sort by the Series indices.
        DataFrame.sort_values : Sort DataFrame by the values along either axis.
        DataFrame.sort_index : Sort DataFrame by indices.

        Examples
        --------
        >>> s = pd.Series([np.nan, 1, 3, 10, 5])
        >>> s
        0     NaN
        1     1.0
        2     3.0
        3     10.0
        4     5.0
        dtype: float64

        Sort values ascending order (default behavior)

        >>> s.sort_values(ascending=True)
        1     1.0
        2     3.0
        4     5.0
        3    10.0
        0     NaN
        dtype: float64

        Sort values descending order

        >>> s.sort_values(ascending=False)
        3    10.0
        4     5.0
        2     3.0
        1     1.0
        0     NaN
        dtype: float64

        Sort values putting NAs first

        >>> s.sort_values(na_position="first")
        0     NaN
        1     1.0
        2     3.0
        4     5.0
        3    10.0
        dtype: float64

        Sort a series of strings

        >>> s = pd.Series(["z", "b", "d", "a", "c"])
        >>> s
        0    z
        1    b
        2    d
        3    a
        4    c
        dtype: str

        >>> s.sort_values()
        3    a
        1    b
        4    c
        2    d
        0    z
        dtype: str

        Sort using a key function. Your `key` function will be
        given the ``Series`` of values and should return an array-like.

        >>> s = pd.Series(["a", "B", "c", "D", "e"])
        >>> s.sort_values()
        1    B
        3    D
        0    a
        2    c
        4    e
        dtype: str
        >>> s.sort_values(key=lambda x: x.str.lower())
        0    a
        1    B
        2    c
        3    D
        4    e
        dtype: str

        NumPy ufuncs work well here. For example, we can
        sort by the ``sin`` of the value

        >>> s = pd.Series([-4, -2, 0, 2, 4])
        >>> s.sort_values(key=np.sin)
        1   -2
        4    4
        2    0
        0   -4
        3    2
        dtype: int64

        More complicated user-defined functions can be used,
        as long as they expect a Series and return an array-like

        >>> s.sort_values(key=lambda x: (np.tan(x.cumsum())))
        0   -4
        3    2
        4    4
        1   -2
        2    0
        dtype: int64
        r   rG  zLength of ascending (z) must be 1 for Seriesr   )r  r  zinvalid na_position: Fr   r:  r  rs  N)r%   r  r2   r   r   r   r   r   r$   r   r`   r	  ra   r   r  r   r   r   rW   r#  )r   r   r  r   rR  r  r  r2  values_to_sortsorted_indexr4  s              r   r  zSeries.sort_values  s   r &gy99d###	"" 	%Xd^Y77I9~~"" RC	NNRRR   "!I&y11	///B[BBCCC  	*!&*;D#*F*FGGONN!\Nd9oo{SSL#l*;*;<< 	) 2++D11199%9(((""L&dj.FU # 
 
  	<(\):):;;FL 	C&&tM&BBBV$$$tr   )r   ry  r  rR  r  sort_remainingr  r2  r  ru   c       	            d S r   rq  
r   r   ry  r  r   rR  r  r  r  r2  s
             r   
sort_indexzSeries.sort_index  s	     sr   	r   ry  r  r   rR  r  r  r  r2  c       	            d S r   rq  r  s
             r   r  zSeries.sort_index  s	     r   c       	            d S r   rq  r  s
             r   r  zSeries.sort_index  s	     r   IndexKeyFunc | Nonec       	        X    t                                          |||||||||		  	        S )u  
        Sort Series by index labels.

        Returns a new Series sorted by label if `inplace` argument is
        ``False``, otherwise updates the original series and returns None.

        Parameters
        ----------
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        level : int, optional
            If not None, sort on values in specified index level(s).
        ascending : bool or list-like of bools, default True
            Sort ascending vs. descending. When the index is a MultiIndex the
            sort direction can be controlled for each level individually.
        inplace : bool, default False
            If True, perform operation in-place.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, default 'quicksort'
            Choice of sorting algorithm. See also :func:`numpy.sort` for more
            information. 'mergesort' and 'stable' are the only stable algorithms. For
            DataFrames, this option is only applied when sorting on a single
            column or label.
        na_position : {'first', 'last'}, default 'last'
            If 'first' puts NaNs at the beginning, 'last' puts NaNs at the end.
            Not implemented for MultiIndex.
        sort_remaining : bool, default True
            If True and sorting by level and index is multilevel, sort by other
            levels too (in order) after sorting by specified level.
        ignore_index : bool, default False
            If True, the resulting axis will be labeled 0, 1, …, n - 1.
        key : callable, optional
            If not None, apply the key function to the index values
            before sorting. This is similar to the `key` argument in the
            builtin :meth:`sorted` function, with the notable difference that
            this `key` function should be *vectorized*. It should expect an
            ``Index`` and return an ``Index`` of the same shape.

        Returns
        -------
        Series or None
            The original Series sorted by the labels or None if ``inplace=True``.

        See Also
        --------
        DataFrame.sort_index: Sort DataFrame by the index.
        DataFrame.sort_values: Sort DataFrame by the value.
        Series.sort_values : Sort Series by the value.

        Examples
        --------
        >>> s = pd.Series(["a", "b", "c", "d"], index=[3, 2, 1, 4])
        >>> s.sort_index()
        1    c
        2    b
        3    a
        4    d
        dtype: str

        Sort Descending

        >>> s.sort_index(ascending=False)
        4    d
        3    a
        2    b
        1    c
        dtype: str

        By default NaNs are put at the end, but use `na_position` to place
        them at the beginning

        >>> s = pd.Series(["a", "b", "c", "d"], index=[3, 2, 1, np.nan])
        >>> s.sort_index(na_position="first")
        NaN     d
         1.0    c
         2.0    b
         3.0    a
        dtype: str

        Specify index level to sort

        >>> arrays = [
        ...     np.array(["qux", "qux", "foo", "foo", "baz", "baz", "bar", "bar"]),
        ...     np.array(["two", "one", "two", "one", "two", "one", "two", "one"]),
        ... ]
        >>> s = pd.Series([1, 2, 3, 4, 5, 6, 7, 8], index=arrays)
        >>> s.sort_index(level=1)
        bar  one    8
        baz  one    6
        foo  one    4
        qux  one    2
        bar  two    7
        baz  two    5
        foo  two    3
        qux  two    1
        dtype: int64

        Does not sort by remaining levels when sorting by levels

        >>> s.sort_index(level=1, sort_remaining=False)
        qux  one    2
        foo  one    4
        baz  one    6
        bar  one    8
        qux  two    1
        foo  two    3
        baz  two    5
        bar  two    7
        dtype: int64

        Apply a key function before sorting

        >>> s = pd.Series([1, 2, 3, 4], index=["A", "b", "C", "d"])
        >>> s.sort_index(key=lambda x: x.str.lower())
        A    1
        b    2
        C    3
        d    4
        dtype: int64
        r  )r  r  )r   r   ry  r  r   rR  r  r  r  r2  r  s             r   r  zSeries.sort_index  sB    J ww!!#)% " 

 

 
	
r   orderstablec                    |dk    r|                      |           | j                            |          }|                     || j        | j        t          j        d          }|                    | d          S )a  
        Return the integer indices that would sort the Series values.

        Override ndarray.argsort. Argsorts the value, omitting NA/null values,
        and places the result in the same locations as the non-NA values.

        Parameters
        ----------
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        kind : {'mergesort', 'quicksort', 'heapsort', 'stable'}, default 'quicksort'
            Choice of sorting algorithm. See :func:`numpy.sort` for more
            information. 'mergesort' and 'stable' are the only stable algorithms.
        order : None
            Has no effect but is accepted for compatibility with numpy.
        stable : None
            Has no effect but is accepted for compatibility with numpy.

        Returns
        -------
        Series[np.intp]
            Positions of values within the sort order with -1 indicating
            nan values.

        See Also
        --------
        numpy.ndarray.argsort : Returns the indices that would sort this array.

        Examples
        --------
        >>> s = pd.Series([3, 2, 1])
        >>> s.argsort()
        0    2
        1    1
        2    0
        dtype: int64
        re  rQ  F)r   r   r   r   argsortrs  )	r  rL   r  r   r   r   r   intpr#  )r   r   rR  r  r  r4  r  s          r   r  zSeries.argsort{  s    X 2::!!$'''###..$*49BG%   
 
 Y777r      nLiteral['first', 'last', 'all']c                T    t          j        | ||                                          S )a+  
        Return the largest `n` elements.

        Parameters
        ----------
        n : int, default 5
            Return this many descending sorted values.
        keep : {'first', 'last', 'all'}, default 'first'
            When there are duplicate values that cannot all fit in a
            Series of `n` elements:

            - ``first`` : return the first `n` occurrences in order
              of appearance.
            - ``last`` : return the last `n` occurrences in reverse
              order of appearance.
            - ``all`` : keep all occurrences. This can result in a Series of
              size larger than `n`.

        Returns
        -------
        Series
            The `n` largest values in the Series, sorted in decreasing order.

        See Also
        --------
        Series.nsmallest: Get the `n` smallest elements.
        Series.sort_values: Sort Series by values.
        Series.head: Return the first `n` rows.

        Notes
        -----
        Faster than ``.sort_values(ascending=False).head(n)`` for small `n`
        relative to the size of the ``Series`` object.

        Examples
        --------
        >>> countries_population = {
        ...     "Italy": 59000000,
        ...     "France": 65000000,
        ...     "Malta": 434000,
        ...     "Maldives": 434000,
        ...     "Brunei": 434000,
        ...     "Iceland": 337000,
        ...     "Nauru": 11300,
        ...     "Tuvalu": 11300,
        ...     "Anguilla": 11300,
        ...     "Montserrat": 5200,
        ... }
        >>> s = pd.Series(countries_population)
        >>> s
        Italy       59000000
        France      65000000
        Malta         434000
        Maldives      434000
        Brunei        434000
        Iceland       337000
        Nauru          11300
        Tuvalu         11300
        Anguilla       11300
        Montserrat      5200
        dtype: int64

        The `n` largest elements where ``n=5`` by default.

        >>> s.nlargest()
        France      65000000
        Italy       59000000
        Malta         434000
        Maldives      434000
        Brunei        434000
        dtype: int64

        The `n` largest elements where ``n=3``. Default `keep` value is 'first'
        so Malta will be kept.

        >>> s.nlargest(3)
        France    65000000
        Italy     59000000
        Malta       434000
        dtype: int64

        The `n` largest elements where ``n=3`` and keeping the last duplicates.
        Brunei will be kept since it is the last with value 434000 based on
        the index order.

        >>> s.nlargest(3, keep="last")
        France      65000000
        Italy       59000000
        Brunei        434000
        dtype: int64

        The `n` largest elements where ``n=3`` with all duplicates kept. Note
        that the returned Series has five elements due to the three duplicates.

        >>> s.nlargest(3, keep="all")
        France      65000000
        Italy       59000000
        Malta         434000
        Maldives      434000
        Brunei        434000
        dtype: int64
        r  r  )r^   SelectNSeriesnlargestr   r  r  s      r   r  zSeries.nlargest  s)    R $TQT:::CCEEEr   c                T    t          j        | ||                                          S )a  
        Return the smallest `n` elements.

        Parameters
        ----------
        n : int, default 5
            Return this many ascending sorted values.
        keep : {'first', 'last', 'all'}, default 'first'
            When there are duplicate values that cannot all fit in a
            Series of `n` elements:

            - ``first`` : return the first `n` occurrences in order
              of appearance.
            - ``last`` : return the last `n` occurrences in reverse
              order of appearance.
            - ``all`` : keep all occurrences. This can result in a Series of
              size larger than `n`.

        Returns
        -------
        Series
            The `n` smallest values in the Series, sorted in increasing order.

        See Also
        --------
        Series.nlargest: Get the `n` largest elements.
        Series.sort_values: Sort Series by values.
        Series.head: Return the first `n` rows.

        Notes
        -----
        Faster than ``.sort_values().head(n)`` for small `n` relative to
        the size of the ``Series`` object.

        Examples
        --------
        >>> countries_population = {
        ...     "Italy": 59000000,
        ...     "France": 65000000,
        ...     "Brunei": 434000,
        ...     "Malta": 434000,
        ...     "Maldives": 434000,
        ...     "Iceland": 337000,
        ...     "Nauru": 11300,
        ...     "Tuvalu": 11300,
        ...     "Anguilla": 11300,
        ...     "Montserrat": 5200,
        ... }
        >>> s = pd.Series(countries_population)
        >>> s
        Italy       59000000
        France      65000000
        Brunei        434000
        Malta         434000
        Maldives      434000
        Iceland       337000
        Nauru          11300
        Tuvalu         11300
        Anguilla       11300
        Montserrat      5200
        dtype: int64

        The `n` smallest elements where ``n=5`` by default.

        >>> s.nsmallest()
        Montserrat    5200
        Nauru        11300
        Tuvalu       11300
        Anguilla     11300
        Iceland     337000
        dtype: int64

        The `n` smallest elements where ``n=3``. Default `keep` value is
        'first' so Nauru and Tuvalu will be kept.

        >>> s.nsmallest(3)
        Montserrat   5200
        Nauru       11300
        Tuvalu      11300
        dtype: int64

        The `n` smallest elements where ``n=3`` and keeping the last
        duplicates. Anguilla and Tuvalu will be kept since they are the last
        with value 11300 based on the index order.

        >>> s.nsmallest(3, keep="last")
        Montserrat   5200
        Anguilla    11300
        Tuvalu      11300
        dtype: int64

        The `n` smallest elements where ``n=3`` with all duplicates kept. Note
        that the returned Series has four elements due to the three duplicates.

        >>> s.nsmallest(3, keep="all")
        Montserrat   5200
        Nauru       11300
        Tuvalu      11300
        Anguilla    11300
        dtype: int64
        r  )r^   r  	nsmallestr  s      r   r  zSeries.nsmallest  s)    P $TQT:::DDFFFr   re  jbool | lib.NoDefaultc                    |                      |           t          | j        t                    sJ |                     d          }| j                            ||          |_        |S )a  
        Swap levels i and j in a :class:`MultiIndex`.

        Default is to swap the two innermost levels of the index.

        Parameters
        ----------
        i, j : int or str
            Levels of the indices to be swapped. Can pass level name as string.
        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

            .. deprecated:: 3.0.0

                This keyword is ignored and will be removed in pandas 4.0. Since
                pandas 3.0, this method always returns a new object using a lazy
                copy mechanism that defers copies until necessary
                (Copy-on-Write). See the `user guide on Copy-on-Write
                <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
                for more details.

        Returns
        -------
        Series
            Series with levels swapped in MultiIndex.

        See Also
        --------
        DataFrame.swaplevel : Swap levels i and j in a :class:`DataFrame`.
        Series.reorder_levels : Rearrange index levels using input order.
        MultiIndex.swaplevel : Swap levels i and j in a :class:`MultiIndex`.

        Examples
        --------
        >>> s = pd.Series(
        ...     ["A", "B", "A", "C"],
        ...     index=[
        ...         ["Final exam", "Final exam", "Coursework", "Coursework"],
        ...         ["History", "Geography", "History", "Geography"],
        ...         ["January", "February", "March", "April"],
        ...     ],
        ... )
        >>> s
        Final exam  History    January     A
                    Geography  February    B
        Coursework  History    March       A
                    Geography  April       C
        dtype: str

        In the following example, we will swap the levels of the indices.
        Here, we will swap the levels column-wise, but levels can be swapped row-wise
        in a similar manner. Note that column-wise is the default behavior.
        By not supplying any arguments for i and j, we swap the last and second to
        last indices.

        >>> s.swaplevel()
        Final exam  January   History       A
                    February  Geography     B
        Coursework  March     History       A
                    April     Geography     C
        dtype: str

        By supplying one argument, we can choose which index to swap the last
        index with. We can for example swap the first index with the last one as
        follows.

        >>> s.swaplevel(0)
        January     History     Final exam      A
        February    Geography   Final exam      B
        March       History     Coursework      A
        April       Geography   Coursework      C
        dtype: str

        We can also define explicitly which indices we want to swap by supplying values
        for both i and j. Here, we for example swap the first and second indices.

        >>> s.swaplevel(0, 1)
        History     Final exam  January         A
        Geography   Final exam  February        B
        History     Coursework  March           A
        Geography   Coursework  April           C
        dtype: str
        Fr   )_check_copy_deprecationr   r   rU   r   	swaplevel)r   r  r  r   r4  s        r   r  zSeries.swaplevel  sb    n 	$$T***$*j11111&&z++Aq11r   Sequence[Level]c                    t          | j        t                    st          d          |                     d          }t          |j        t                    sJ |j                            |          |_        |S )a  
        Rearrange index levels using input order.

        May not drop or duplicate levels.

        Parameters
        ----------
        order : list of int representing new level order
            Reference level by number or key.

        Returns
        -------
        Series
            Type of caller with index as MultiIndex (new object).

        See Also
        --------
        DataFrame.reorder_levels : Rearrange index or column levels using
            input ``order``.

        Examples
        --------
        >>> arrays = [
        ...     np.array(["dog", "dog", "cat", "cat", "bird", "bird"]),
        ...     np.array(["white", "black", "white", "black", "white", "black"]),
        ... ]
        >>> s = pd.Series([1, 2, 3, 3, 5, 2], index=arrays)
        >>> s
        dog   white    1
              black    2
        cat   white    3
              black    3
        bird  white    5
              black    2
        dtype: int64
        >>> s.reorder_levels([1, 0])
        white  dog     1
        black  dog     2
        white  cat     3
        black  cat     3
        white  bird    5
        black  bird    2
        dtype: int64
        z/Can only reorder levels on a hierarchical axis.Fr   )r   r   rU   rP  r   reorder_levels)r   r  r4  s      r   r  zSeries.reorder_levels  sp    Z $*j11 	OMNNN&&&,
33333|22599r   c                   t          | j        t                    r| j                                        \  }}nt          |           rCt          | j                  r/t          j        t          j
        | j                            \  }}n.|                                 }|r|                    d          n|S |rt          t          |                    }n| j                            |          }|                     ||| j        d          S )uJ  
        Transform each element of a list-like to a row.

        Parameters
        ----------
        ignore_index : bool, default False
            If True, the resulting index will be labeled 0, 1, …, n - 1.

        Returns
        -------
        Series
            Exploded lists to rows; index will be duplicated for these rows.

        See Also
        --------
        Series.str.split : Split string values on specified separator.
        Series.unstack : Unstack, a.k.a. pivot, Series with MultiIndex
            to produce DataFrame.
        DataFrame.melt : Unpivot a DataFrame from wide format to long format.
        DataFrame.explode : Explode a DataFrame from list-like
            columns to long format.

        Notes
        -----
        This routine will explode list-likes including lists, tuples, sets,
        Series, and np.ndarray. The result dtype of the subset rows will
        be object. Scalars will be returned unchanged, and empty list-likes will
        result in an np.nan for that row. In addition, the ordering of elements in
        the output will be non-deterministic when exploding sets.

        Reference :ref:`the user guide <reshaping.explode>` for more examples.

        Examples
        --------
        >>> s = pd.Series([[1, 2, 3], "foo", [], [3, 4]])
        >>> s
        0    [1, 2, 3]
        1          foo
        2           []
        3       [3, 4]
        dtype: object

        >>> s.explode()
        0      1
        0      2
        0      3
        1    foo
        2    NaN
        3      3
        3      4
        dtype: object
        T)rw  FrH  )r   r   r7   r	  _exploder   r3   r   exploder   r  r   r}  rW   r   rr  r   r   )r   r  r   countsr4  r   s         r   r  zSeries.explode  s    j dj.11 	M!\2244NFFFYY 	M?4:66 	M$_RZ-E-EFFNFFFYY[[F4@L6%%4%000fL 	.(V55EEJ%%f--E  u495 QQQr   c                *    ddl m}  || |||          S )a  
        Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.

        Parameters
        ----------
        level : int, str, or list of these, default last level
            Level(s) to unstack, can pass level name.
        fill_value : scalar value, default None
            Value to use when replacing NaN values.
        sort : bool, default True
            Sort the level(s) in the resulting MultiIndex columns.

        Returns
        -------
        DataFrame
            Unstacked Series.

        See Also
        --------
        DataFrame.unstack : Pivot the MultiIndex of a DataFrame.

        Notes
        -----
        Reference :ref:`the user guide <reshaping.stacking>` for more examples.

        Examples
        --------
        >>> s = pd.Series(
        ...     [1, 2, 3, 4],
        ...     index=pd.MultiIndex.from_product([["one", "two"], ["a", "b"]]),
        ... )
        >>> s
        one  a    1
             b    2
        two  a    3
             b    4
        dtype: int64

        >>> s.unstack(level=-1)
             a  b
        one  1  2
        two  3  4

        >>> s.unstack(level=0)
           one  two
        a    1    3
        b    2    4
        r   )unstack)pandas.core.reshape.reshaper  )r   ry  rv  r  r  s        r   r  zSeries.unstack]  s-    l 	877777wtUJ555r   "Callable | Mapping | Series | None	na_actionLiteral['ignore'] | NoneengineCallable | Nonec           	        |Qd|v r>|                     d          }t          j        dt          t	                                 nt          d          |t          |          st          d          t          |d          st          d|          |j        	                    | |d	|||d
k              }t          |t                    st          || j        | j                  }|                    | d          S t          |          rt          j        |fi |}|                     ||          }|                     || j        d                              | d          S )aH  
        Map values of Series according to an input mapping or function.

        Used for substituting each value in a Series with another value,
        that may be derived from a function, a ``dict`` or
        a :class:`Series`.

        Parameters
        ----------
        func : function, collections.abc.Mapping subclass or Series
            Function or mapping correspondence.
        na_action : {None, 'ignore'}, default None
            If 'ignore', propagate NaN values, without passing them to the
            mapping correspondence.
        engine : decorator, optional
            Choose the execution engine to use to run the function. Only used for
            functions. If ``map`` is called with a mapping or ``Series``, an
            exception will be raised. If ``engine`` is not provided the function will
            be executed by the regular Python interpreter.

            Options include JIT compilers such as Numba, Bodo or Blosc2, which in some
            cases can speed up the execution. To use an executor you can provide the
            decorators ``numba.jit``, ``numba.njit``, ``bodo.jit`` or ``blosc2.jit``.
            You can also provide the decorator with parameters, like
            ``numba.jit(nogit=True)``.

            Not all functions can be executed with all execution engines. In general,
            JIT compilers will require type stability in the function (no variable
            should change data type during the execution). And not all pandas and
            NumPy APIs are supported. Check the engine documentation for limitations.

            .. versionadded:: 3.0.0

        **kwargs
            Additional keyword arguments to pass as keywords arguments to
            `arg`.

            .. versionadded:: 3.0.0

        Returns
        -------
        Series
            Same index as caller.

        See Also
        --------
        Series.apply : For applying more complex functions on a Series.
        Series.replace: Replace values given in `to_replace` with `value`.
        DataFrame.apply : Apply a function row-/column-wise.
        DataFrame.map : Apply a function elementwise on a whole DataFrame.

        Notes
        -----
        When ``arg`` is a dictionary, values in Series that are not in the
        dictionary (as keys) are converted to ``NaN``. However, if the
        dictionary is a ``dict`` subclass that defines ``__missing__`` (i.e.
        provides a method for default values), then this default is used
        rather than ``NaN``.

        Examples
        --------
        >>> s = pd.Series(["cat", "dog", np.nan, "rabbit"])
        >>> s
        0      cat
        1      dog
        2      NaN
        3   rabbit
        dtype: str

        ``map`` accepts a ``dict`` or a ``Series``. Values that are not found
        in the ``dict`` are converted to ``NaN``, unless the dict has a default
        value (e.g. ``defaultdict``):

        >>> s.map({"cat": "kitten", "dog": "puppy"})
        0   kitten
        1    puppy
        2      NaN
        3      NaN
        dtype: str

        It also accepts a function:

        >>> s.map("I am a {}".format)
        0       I am a cat
        1       I am a dog
        2       I am a nan
        3    I am a rabbit
        dtype: str

        To avoid applying the function to missing values (and keep them as
        ``NaN``) ``na_action='ignore'`` can be used:

        >>> s.map("I am a {}".format, na_action="ignore")
        0     I am a cat
        1     I am a dog
        2            NaN
        3  I am a rabbit
        dtype: str

        For categorical data, the function is only applied to the categories:

        >>> s = pd.Series(list("cabaa"))
        >>> s.map(print)
        c
        a
        b
        a
        a
        0    None
        1    None
        2    None
        3    None
        4    None
        dtype: object

        >>> s_cat = s.astype("category")
        >>> s_cat.map(print)  # function called once per unique category
        a
        b
        c
        0    None
        1    None
        2    None
        3    None
        4    None
        dtype: object
        NargzoThe parameter `arg` has been renamed to `func`, and it will stop being supported in a future version of pandas.r   z The `func` parameter is requiredzAThe engine argument can only be specified when func is a function__pandas_udf__zNot a valid engine: rq  ry  )r   rt  r
  r  	decoratorskip_nar'  maprs  )r  Fr:  )popr   r   r   r#   r   r9  r  r  r  r   r   r   r   r#  	functoolspartial_map_valuesr   )r   rt  r  r  r  r4  rN  s          r   r  z
Series.map  s   L <zz%((O"/11	     !!CDDDD>>  W   6#344 D !B!B!BCCC*.. !X- /  F ff-- JdjtyIII&&tE&:::D>> 	5$T44V44D%%di%@@
  4:E JJWW X 
 
 	
r   r   c                    | S )a  
        Sub-classes to define. Return a sliced object.

        Parameters
        ----------
        key : string / list of selections
        ndim : {1, 2}
            Requested ndim of result.
        subset : object, default None
            Subset to act on.
        rq  )r   r2  r(  subsets       r   _gotitemzSeries._gotitemH  s	     r   z
    See Also
    --------
    Series.apply : Invoke function on a Series.
    Series.transform : Transform function producing a Series with like indexes.
    z
    Examples
    --------
    >>> s = pd.Series([1, 2, 3, 4])
    >>> s
    0    1
    1    2
    2    3
    3    4
    dtype: int64

    >>> s.agg('min')
    1

    >>> s.agg(['min', 'max'])
    min   1
    max   4
    dtype: int64
    c                    |                      |           |!t          |                                          }t          | |||          }|                                }|S )a	  
        Aggregate using one or more operations over the specified axis.

        Parameters
        ----------
        func : function, str, list or dict
            Function to use for aggregating the data. If a function, must either
            work when passed a Series or when passed to Series.apply.

            Accepted combinations are:

            - function
            - string function name
            - list of functions and/or function names, e.g. ``[np.sum, 'mean']``
            - dict of axis labels -> functions, function names or list of such.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        *args
            Positional arguments to pass to `func`.
        **kwargs
            Keyword arguments to pass to `func`.

        Returns
        -------
        scalar, Series or DataFrame
            The return can be:

            * scalar : when Series.agg is called with single function
            * Series : when DataFrame.agg is called with a single function
            * DataFrame : when DataFrame.agg is called with several functions

        See Also
        --------
        Series.apply : Invoke function on a Series.
        Series.transform : Transform function producing a Series with like indexes.

        Notes
        -----
        The aggregation operations are always performed over an axis, either the
        index (default) or the column axis. This behavior is different from
        `numpy` aggregation functions (`mean`, `median`, `prod`, `sum`, `std`,
        `var`), where the default is to compute the aggregation of the flattened
        array, e.g., ``numpy.mean(arr_2d)`` as opposed to
        ``numpy.mean(arr_2d, axis=0)``.

        `agg` is an alias for `aggregate`. Use the alias.

        Functions that mutate the passed object can produce unexpected
        behavior or errors and are not supported. See :ref:`gotchas.udf-mutation`
        for more details.

        A passed user-defined-function will be passed a Series for evaluation.

        If ``func`` defines an index relabeling, ``axis`` must be ``0`` or ``index``.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3, 4])
        >>> s
        0    1
        1    2
        2    3
        3    4
        dtype: int64

        >>> s.agg("min")
        1

        >>> s.agg(["min", "max"])
        min   1
        max   4
        dtype: int64
        N)r
  r  )r  r  r  rF   agg)r   rt  r   r
  r  opr4  s          r   	aggregatezSeries.aggregateu  s]    X 	d### <''Dt$v>>>r   rf   c                    |                      |           |                     d          }t          ||||                                          }|S )a!  
        Call ``func`` on self producing a Series with the same axis shape as self.

        Parameters
        ----------
        func : function, str, list-like or dict-like
            Function to use for transforming the data. If a function, must either
            work when passed a Series or when passed to Series.apply. If func
            is both list-like and dict-like, dict-like behavior takes precedence.

            Accepted combinations are:

            - function
            - string function name
            - list-like of functions and/or function names, e.g. ``[np.exp, 'sqrt']``
            - dict-like of axis labels -> functions, function names or list-like of such

        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        *args
            Positional arguments to pass to `func`.
        **kwargs
            Keyword arguments to pass to `func`.

        Returns
        -------
        Series
            A Series that must have the same length as self.

        Raises
        ------
        ValueError : If the returned Series has a different length than self.

        See Also
        --------
        Series.agg : Only perform aggregating type operations.
        Series.apply : Invoke function on a Series.

        Notes
        -----
        Functions that mutate the passed object can produce unexpected
        behavior or errors and are not supported. See :ref:`gotchas.udf-mutation`
        for more details.

        Examples
        --------
        >>> df = pd.DataFrame({"A": range(3), "B": range(1, 4)})
        >>> df
        A  B
        0  0  1
        1  1  2
        2  2  3
        >>> df.transform(lambda x: x + 1)
        A  B
        0  1  2
        1  2  3
        2  3  4

        Even though the resulting Series must have the same length as the
        input Series, it is possible to provide several input functions:

        >>> s = pd.Series(range(3))
        >>> s
        0    0
        1    1
        2    2
        dtype: int64
        >>> s.transform([np.sqrt, np.exp])
            sqrt        exp
        0  0.000000   1.000000
        1  1.000000   2.718282
        2  1.414214   7.389056

        You can call transform on a GroupBy object:

        >>> df = pd.DataFrame(
        ...     {
        ...         "Date": [
        ...             "2015-05-08",
        ...             "2015-05-07",
        ...             "2015-05-06",
        ...             "2015-05-05",
        ...             "2015-05-08",
        ...             "2015-05-07",
        ...             "2015-05-06",
        ...             "2015-05-05",
        ...         ],
        ...         "Data": [5, 8, 6, 1, 50, 100, 60, 120],
        ...     }
        ... )
        >>> df
                Date  Data
        0  2015-05-08     5
        1  2015-05-07     8
        2  2015-05-06     6
        3  2015-05-05     1
        4  2015-05-08    50
        5  2015-05-07   100
        6  2015-05-06    60
        7  2015-05-05   120
        >>> df.groupby("Date")["Data"].transform("sum")
        0     55
        1    108
        2     66
        3    121
        4     55
        5    108
        6     66
        7    121
        Name: Data, dtype: int64

        >>> df = pd.DataFrame(
        ...     {
        ...         "c": [1, 1, 1, 2, 2, 2, 2],
        ...         "type": ["m", "n", "o", "m", "m", "n", "n"],
        ...     }
        ... )
        >>> df
        c type
        0  1    m
        1  1    n
        2  1    o
        3  2    m
        4  2    m
        5  2    n
        6  2    n
        >>> df["size"] = df.groupby("c")["type"].transform(len)
        >>> df
        c type size
        0  1    m    3
        1  1    n    3
        2  1    o    3
        3  2    m    4
        4  2    m    4
        5  2    n    4
        6  2    n    4
        Fr   )rt  r
  r  )r  r   rF   	transform)r   rt  r   r
  r  r   r4  s          r   r  zSeries.transform  sS    \ 	d###iiUi##St$vFFFPPRRr   rq  r   )by_rowr
  tuple[Any, ...]r  Literal[False, 'compat']c               N    t          | ||||                                          S )a  
        Invoke function on values of Series.

        Can be ufunc (a NumPy function that applies to the entire Series)
        or a Python function that only works on single values.

        Parameters
        ----------
        func : function
            Python function or NumPy ufunc to apply.
        args : tuple
            Positional arguments passed to func after the series value.
        by_row : False or "compat", default "compat"
            If ``"compat"`` and func is a callable, func will be passed each element of
            the Series, like ``Series.map``. If func is a list or dict of
            callables, will first try to translate each func into pandas methods. If
            that doesn't work, will try call to apply again with ``by_row="compat"``
            and if that fails, will call apply again with ``by_row=False``
            (backward compatible).
            If False, the func will be passed the whole Series at once.

            ``by_row`` has no effect when ``func`` is a string.

            .. versionadded:: 2.1.0
        **kwargs
            Additional keyword arguments passed to func.

        Returns
        -------
        Series or DataFrame
            If func returns a Series object the result will be a DataFrame.

        See Also
        --------
        Series.map: For element-wise operations.
        Series.agg: Only perform aggregating type operations.
        Series.transform: Only perform transforming type operations.

        Notes
        -----
        Functions that mutate the passed object can produce unexpected
        behavior or errors and are not supported. See :ref:`gotchas.udf-mutation`
        for more details.

        Examples
        --------
        Create a series with typical summer temperatures for each city.

        >>> s = pd.Series([20, 21, 12], index=["London", "New York", "Helsinki"])
        >>> s
        London      20
        New York    21
        Helsinki    12
        dtype: int64

        Square the values by defining a function and passing it as an
        argument to ``apply()``.

        >>> def square(x):
        ...     return x**2
        >>> s.apply(square)
        London      400
        New York    441
        Helsinki    144
        dtype: int64

        Square the values by passing an anonymous function as an
        argument to ``apply()``.

        >>> s.apply(lambda x: x**2)
        London      400
        New York    441
        Helsinki    144
        dtype: int64

        Define a custom function that needs additional positional
        arguments and pass these additional arguments using the
        ``args`` keyword.

        >>> def subtract_custom_value(x, custom_value):
        ...     return x - custom_value

        >>> s.apply(subtract_custom_value, args=(5,))
        London      15
        New York    16
        Helsinki     7
        dtype: int64

        Define a custom function that takes keyword arguments
        and pass these arguments to ``apply``.

        >>> def add_custom_values(x, **kwargs):
        ...     for month in kwargs:
        ...         x += kwargs[month]
        ...     return x

        >>> s.apply(add_custom_values, june=30, july=20, august=25)
        London      95
        New York    96
        Helsinki    87
        dtype: int64

        Use a function from the Numpy library.

        >>> s.apply(np.log)
        London      2.995732
        New York    3.044522
        Helsinki    2.484907
        dtype: float64
        )r  r
  r  )rF   apply)r   rt  r
  r  r  s        r   r  zSeries.apply`  s6    l 
 
 
 %''	r   r?  npt.NDArray[np.intp] | Nonec                    |-||j         | j        j         k    r|                     d          S t          j        | j        |dd           }|                     ||d          S )NFr   T)
allow_fillrv  r:  )namesr   r   r?   take_ndr	  r   )r   r?  r>  rN  s       r   _reindex_indexerzSeries._reindex_indexer  ss     ?DJ4D!D!D99%9((('L'dt
 
 

   95 IIIr   c                    dS )zc
        Check if we do need a multi reindex; this is for compat with
        higher dims.
        Frq  )r   r   rt  ry  s       r   _needs_reindex_multizSeries._needs_reindex_multi  s	    
 ur   )r   r   ry  errorsRenamer | Hashable | NoneAxis | NoneLevel | Noner  rt   c                   d S r   rq  r   r   r   r   r   ry  r  s          r   renamezSeries.rename  s	     r   )r   r   r   ry  r  c                   d S r   rq  r  s          r   r  zSeries.rename  s	     r   ry  c                  |                      |           ||                     |          }t          |          st          |          r%t	                                          ||||          S |                     ||          S )a
  
        Alter Series index labels or name.

        Function / dict values must be unique (1-to-1). Labels not contained in
        a dict / Series will be left as-is. Extra labels listed don't throw an
        error.

        Alternatively, change ``Series.name`` with a scalar value.

        See the :ref:`user guide <basics.rename>` for more.

        Parameters
        ----------
        index : scalar, hashable sequence, dict-like or function optional
            Functions or dict-like are transformations to apply to
            the index.
            Scalar or hashable sequence-like will alter the ``Series.name``
            attribute.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

            .. deprecated:: 3.0.0

                This keyword is ignored and will be removed in pandas 4.0. Since
                pandas 3.0, this method always returns a new object using a lazy
                copy mechanism that defers copies until necessary
                (Copy-on-Write). See the `user guide on Copy-on-Write
                <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
                for more details.

        inplace : bool, default False
            Whether to return a new Series. If True the value of copy is ignored.
        level : int or level name, default None
            In case of MultiIndex, only rename labels in the specified level.
        errors : {'ignore', 'raise'}, default 'ignore'
            If 'raise', raise `KeyError` when a `dict-like mapper` or
            `index` contains labels that are not present in the index being transformed.
            If 'ignore', existing keys will be renamed and extra keys will be ignored.

        Returns
        -------
        Series
            A shallow copy with index labels or name altered, or the same object
            if ``inplace=True`` and index is not a dict or callable else None.

        See Also
        --------
        DataFrame.rename : Corresponding DataFrame method.
        Series.rename_axis : Set the name of the axis.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s
        0    1
        1    2
        2    3
        dtype: int64
        >>> s.rename("my_name")  # scalar, changes Series.name
        0    1
        1    2
        2    3
        Name: my_name, dtype: int64
        >>> s.rename(lambda x: x**2)  # function, changes labels
        0    1
        1    2
        4    3
        dtype: int64
        >>> s.rename({1: 3, 2: 5})  # mapping, changes labels
        0    1
        3    2
        5    3
        dtype: int64
        N)r   ry  r  rS  )r  r  r9  r.   r  _renamer  )r   r   r   r   r   ry  r  r  s          r   r  zSeries.rename  s    n 	$$T***((..DE?? 	:l511 	:
 77??	 #    >>%>999r   r   r   c               L    t                                          |||          S )a  
        Assign desired index to given axis.

        .. deprecated:: 3.0.0
            This keyword is ignored and will be removed in pandas 4.0. Since
            pandas 3.0, this method always returns a new object using a lazy
            copy mechanism that defers copies until necessary
            (Copy-on-Write). See the `user guide on Copy-on-Write
            <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
            for more details.

        Indexes for row labels can be changed by assigning a list-like or Index.

        Parameters
        ----------
        labels : list-like or Index
            The values for the new index.
        axis : {0 or 'index'}, default 0
            The axis to update. The value 0 identifies the rows. For `Series`
            this parameter is unused and defaults to 0.
        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

        Returns
        -------
        Series
            A shallow copy of the object with axis altered to the given index.

        See Also
        --------
        Series.rename_axis : Alter the name of the index.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s
        0    1
        1    2
        2    3
        dtype: int64
        >>> s.set_axis(["a", "b", "c"], axis=0)
        a    1
        b    2
        c    3
        dtype: int64
        r  )r  set_axis)r   labelsr   r   r  s       r   r  zSeries.set_axisx  s%    n wwT===r   )r   rt  r   ry  rv  limit	toleranceReindexMethod | NoneScalar | Noner   c          	     T    t                                          |||||||          S )a
"  
        Conform Series to new index with optional filling logic.

        Places NA/NaN in locations having no value in the previous index. A new object
        is produced unless the new index is equivalent to the current one and
        ``copy=False``.

        Parameters
        ----------
        index : scalar, list-like, dict-like or function, optional
            A scalar, list-like, dict-like or functions transformations to
            apply to that axis' values.
        axis : {0 or 'index'}, default 0
            The axis to rename. For `Series` this parameter is unused and defaults to 0.
        method : {{None, 'backfill'/'bfill', 'pad'/'ffill', 'nearest'}}
            Method to use for filling holes in reindexed DataFrame.
            Please note: this is only applicable to DataFrames/Series with a
            monotonically increasing/decreasing index.

            * None (default): don't fill gaps
            * pad / ffill: Propagate last valid observation forward to next
              valid.
            * backfill / bfill: Use next valid observation to fill gap.
            * nearest: Use nearest valid observations to fill gap.

        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

            .. deprecated:: 3.0.0

                This keyword is ignored and will be removed in pandas 4.0. Since
                pandas 3.0, this method always returns a new object using a lazy
                copy mechanism that defers copies until necessary
                (Copy-on-Write). See the `user guide on Copy-on-Write
                <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
                for more details.

        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : scalar, default np.nan
            Value to use for missing values. Defaults to NaN, but can be any
            "compatible" value.
        limit : int, default None
            Maximum number of consecutive elements to forward or backward fill.
        tolerance : optional
            Maximum distance between original and new labels for inexact
            matches. The values of the index at the matching locations most
            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.

            Tolerance may be a scalar value, which applies the same tolerance
            to all values, or list-like, which applies variable tolerance per
            element. List-like includes list, tuple, array, Series, and must be
            the same size as the index and its dtype must exactly match the
            index's type.

        Returns
        -------
        Series
            Series with changed index.

        See Also
        --------
        DataFrame.set_index : Set row labels.
        DataFrame.reset_index : Remove row labels or move them to new columns.
        DataFrame.reindex_like : Change to same indices as other DataFrame.

        Examples
        --------
        ``DataFrame.reindex`` supports two calling conventions

        * ``(index=index_labels, columns=column_labels, ...)``
        * ``(labels, axis={{'index', 'columns'}}, ...)``

        We *highly* recommend using keyword arguments to clarify your
        intent.

        Create a DataFrame with some fictional data.

        >>> index = ["Firefox", "Chrome", "Safari", "IE10", "Konqueror"]
        >>> columns = ["http_status", "response_time"]
        >>> df = pd.DataFrame(
        ...     [[200, 0.04], [200, 0.02], [404, 0.07], [404, 0.08], [301, 1.0]],
        ...     columns=columns,
        ...     index=index,
        ... )
        >>> df
                   http_status  response_time
        Firefox            200           0.04
        Chrome             200           0.02
        Safari             404           0.07
        IE10               404           0.08
        Konqueror          301           1.00

        Create a new index and reindex the DataFrame. By default
        values in the new index that do not have corresponding
        records in the DataFrame are assigned ``NaN``.

        >>> new_index = ["Safari", "Iceweasel", "Comodo Dragon", "IE10", "Chrome"]
        >>> df.reindex(new_index)
                       http_status  response_time
        Safari               404.0           0.07
        Iceweasel              NaN            NaN
        Comodo Dragon          NaN            NaN
        IE10                 404.0           0.08
        Chrome               200.0           0.02

        We can fill in the missing values by passing a value to
        the keyword ``fill_value``. Because the index is not monotonically
        increasing or decreasing, we cannot use arguments to the keyword
        ``method`` to fill the ``NaN`` values.

        >>> df.reindex(new_index, fill_value=0)
                       http_status  response_time
        Safari                 404           0.07
        Iceweasel                0           0.00
        Comodo Dragon            0           0.00
        IE10                   404           0.08
        Chrome                 200           0.02

        >>> df.reindex(new_index, fill_value="missing")
                      http_status response_time
        Safari                404          0.07
        Iceweasel         missing       missing
        Comodo Dragon     missing       missing
        IE10                  404          0.08
        Chrome                200          0.02

        We can also reindex the columns.

        >>> df.reindex(columns=["http_status", "user_agent"])
                   http_status  user_agent
        Firefox            200         NaN
        Chrome             200         NaN
        Safari             404         NaN
        IE10               404         NaN
        Konqueror          301         NaN

        Or we can use "axis-style" keyword arguments

        >>> df.reindex(["http_status", "user_agent"], axis="columns")
                   http_status  user_agent
        Firefox            200         NaN
        Chrome             200         NaN
        Safari             404         NaN
        IE10               404         NaN
        Konqueror          301         NaN

        To further illustrate the filling functionality in
        ``reindex``, we will create a DataFrame with a
        monotonically increasing index (for example, a sequence
        of dates).

        >>> date_index = pd.date_range("1/1/2010", periods=6, freq="D")
        >>> df2 = pd.DataFrame(
        ...     {"prices": [100, 101, np.nan, 100, 89, 88]}, index=date_index
        ... )
        >>> df2
                    prices
        2010-01-01   100.0
        2010-01-02   101.0
        2010-01-03     NaN
        2010-01-04   100.0
        2010-01-05    89.0
        2010-01-06    88.0

        Suppose we decide to expand the DataFrame to cover a wider
        date range.

        >>> date_index2 = pd.date_range("12/29/2009", periods=10, freq="D")
        >>> df2.reindex(date_index2)
                    prices
        2009-12-29     NaN
        2009-12-30     NaN
        2009-12-31     NaN
        2010-01-01   100.0
        2010-01-02   101.0
        2010-01-03     NaN
        2010-01-04   100.0
        2010-01-05    89.0
        2010-01-06    88.0
        2010-01-07     NaN

        The index entries that did not have a value in the original data frame
        (for example, '2009-12-29') are by default filled with ``NaN``.
        If desired, we can fill in the missing values using one of several
        options.

        For example, to back-propagate the last valid value to fill the ``NaN``
        values, pass ``bfill`` as an argument to the ``method`` keyword.

        >>> df2.reindex(date_index2, method="bfill")
                    prices
        2009-12-29   100.0
        2009-12-30   100.0
        2009-12-31   100.0
        2010-01-01   100.0
        2010-01-02   101.0
        2010-01-03     NaN
        2010-01-04   100.0
        2010-01-05    89.0
        2010-01-06    88.0
        2010-01-07     NaN

        Please note that the ``NaN`` value present in the original DataFrame
        (at index value 2010-01-03) will not be filled by any of the
        value propagation schemes. This is because filling while reindexing
        does not look at DataFrame values, but only compares the original and
        desired indexes. If you do want to fill in the ``NaN`` values present
        in the original DataFrame, use the ``fillna()`` method.

        See the :ref:`user guide <basics.reindexing>` for more.
        )r   rt  ry  rv  r   r  r   )r  r   )
r   r   r   rt  r   ry  rv  r   r  r  s
            r   r   zSeries.reindex  s:    D ww!  
 
 	
r   )r   r   r   mapperIndexLabel | lib.NoDefaultc                   d S r   rq  r   r  r   r   r   r   s         r   rename_axiszSeries.rename_axis  r  r   )r   r   r   r   c                   d S r   rq  r  s         r   r	  zSeries.rename_axis  r  r   Self | Nonec                   d S r   rq  r  s         r   r	  zSeries.rename_axis  s	     cr   c               P    t                                          |||||          S )a  
        Set the name of the axis for the index.

        Parameters
        ----------
        mapper : scalar, list-like, optional
            Value to set the axis name attribute.

            Use either ``mapper`` and ``axis`` to
            specify the axis to target with ``mapper``, or ``index``.

        index : scalar, list-like, dict-like or function, optional
            A scalar, list-like, dict-like or functions transformations to
            apply to that axis' values.
        axis : {0 or 'index'}, default 0
            The axis to rename. For `Series` this parameter is unused and defaults to 0.
        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

            .. deprecated:: 3.0.0

                This keyword is ignored and will be removed in pandas 4.0. Since
                pandas 3.0, this method always returns a new object using a lazy
                copy mechanism that defers copies until necessary
                (Copy-on-Write). See the `user guide on Copy-on-Write
                <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
                for more details.

        inplace : bool, default False
            Modifies the object directly, instead of creating a new Series
            or DataFrame.

        Returns
        -------
        Series, or None
            The same type as the caller or None if ``inplace=True``.

        See Also
        --------
        Series.rename : Alter Series index labels or name.
        DataFrame.rename : Alter DataFrame index labels or name.
        Index.rename : Set new names on index.

        Examples
        --------

        >>> s = pd.Series(["dog", "cat", "monkey"])
        >>> s
        0       dog
        1       cat
        2    monkey
        dtype: str
        >>> s.rename_axis("animal")
        animal
        0    dog
        1    cat
        2    monkey
        dtype: str
        )r  r   r   r   r   )r  r	  )r   r  r   r   r   r   r  s         r   r	  zSeries.rename_axis  s6    J ww"" # 
 
 	
r   )r   r   r  ry  r  r  IndexLabel | ListLiker  c                   d S r   rq  r   r  r   r   r  ry  r   r  s           r   rw  zSeries.drop  r  r   )r   r   r  ry  r   r  c                   d S r   rq  r  s           r   rw  zSeries.drop  r  r   c                   d S r   rq  r  s           r   rw  zSeries.drop'  r  r   raisec          	     T    t                                          |||||||          S )a&  
        Return Series with specified index labels removed.

        Remove elements of a Series based on specifying the index labels.
        When using a multi-index, labels on different levels can be removed
        by specifying the level.

        Parameters
        ----------
        labels : single label or list-like
            Index labels to drop.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        index : single label or list-like
            Redundant for application on Series, but 'index' can be used instead
            of 'labels'.
        columns : single label or list-like
            No change is made to the Series; use 'index' or 'labels' instead.
        level : int or level name, optional
            For MultiIndex, level for which the labels will be removed.
        inplace : bool, default False
            If True, do operation inplace and return None.
        errors : {'ignore', 'raise'}, default 'raise'
            If 'ignore', suppress error and only existing labels are dropped.

        Returns
        -------
        Series or None
            Series with specified index labels removed or None if ``inplace=True``.

        Raises
        ------
        KeyError
            If none of the labels are found in the index.

        See Also
        --------
        Series.reindex : Return only specified index labels of Series.
        Series.dropna : Return series without null values.
        Series.drop_duplicates : Return Series with duplicate values removed.
        DataFrame.drop : Drop specified labels from rows or columns.

        Examples
        --------
        >>> s = pd.Series(data=np.arange(3), index=["A", "B", "C"])
        >>> s
        A  0
        B  1
        C  2
        dtype: int64

        Drop labels B and C

        >>> s.drop(labels=["B", "C"])
        A  0
        dtype: int64

        Drop 2nd level label in MultiIndex Series

        >>> midx = pd.MultiIndex(
        ...     levels=[["llama", "cow", "falcon"], ["speed", "weight", "length"]],
        ...     codes=[[0, 0, 0, 1, 1, 1, 2, 2, 2], [0, 1, 2, 0, 1, 2, 0, 1, 2]],
        ... )
        >>> s = pd.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3], index=midx)
        >>> s
        llama   speed      45.0
                weight    200.0
                length      1.2
        cow     speed      30.0
                weight    250.0
                length      1.5
        falcon  speed     320.0
                weight      1.0
                length      0.3
        dtype: float64

        >>> s.drop(labels="weight", level=1)
        llama   speed      45.0
                length      1.2
        cow     speed      30.0
                length      1.5
        falcon  speed     320.0
                length      0.3
        dtype: float64
        )r  r   r   r  ry  r   r  )r  rw  )	r   r  r   r   r  ry  r   r  r  s	           r   rw  zSeries.drop4  s:    @ ww||  
 
 	
r   itemc                b    t          t                                          |                    S )a~  
        Return item and drops from series. Raise KeyError if not found.

        Parameters
        ----------
        item : label
            Index of the element that needs to be removed.

        Returns
        -------
        scalar
            Value that is popped from series.

        See Also
        --------
        Series.drop: Drop specified values from Series.
        Series.drop_duplicates: Return Series with duplicate values removed.

        Examples
        --------
        >>> ser = pd.Series([1, 2, 3])

        >>> ser.pop(0)
        1

        >>> ser
        1    2
        2    3
        dtype: int64
        )r  )r-   r  r  )r   r  r  s     r   r  z
Series.pop  s%    > ((>(>???r   verbosemax_colsmemory_usagebool | str | Noneshow_countsc                P    t          | |                              ||||          S )a}  
        Print a concise summary of a Series.

        This method prints information about a Series including
        the index dtype, non-NA values and memory usage.

        Parameters
        ----------
        verbose : bool, optional
            Whether to print the full summary. By default, the setting in
            ``pandas.options.display.max_info_columns`` is followed.
        buf : writable buffer, defaults to sys.stdout
            Where to send the output. By default, the output is printed to
            sys.stdout. Pass a writable buffer if you need to further process
            the output.
        max_cols : int, optional
            Unused, exists only for compatibility with DataFrame.info.
        memory_usage : bool, str, optional
            Specifies whether total memory usage of the Series
            elements (including the index) should be displayed. By default,
            this follows the ``pandas.options.display.memory_usage`` setting.

            True always show memory usage. False never shows memory usage.
            A value of 'deep' is equivalent to "True with deep introspection".
            Memory usage is shown in human-readable units (base-2
            representation). Without deep introspection a memory estimation is
            made based in column dtype and number of rows assuming values
            consume the same memory amount for corresponding dtypes. With deep
            memory introspection, a real memory usage calculation is performed
            at the cost of computational resources. See the
            :ref:`Frequently Asked Questions <df-memory-usage>` for more
            details.
        show_counts : bool, optional
            Whether to show the non-null counts. By default, this is shown
            only if the DataFrame is smaller than
            ``pandas.options.display.max_info_rows`` and
            ``pandas.options.display.max_info_columns``. A value of True always
            shows the counts, and False never shows the counts.

        Returns
        -------
        None
            This method prints a summary of a Series and returns None.

        See Also
        --------
        Series.describe: Generate descriptive statistics of Series.
        Series.memory_usage: Memory usage of Series.

        Examples
        --------
        >>> int_values = [1, 2, 3, 4, 5]
        >>> text_values = ["alpha", "beta", "gamma", "delta", "epsilon"]
        >>> s = pd.Series(text_values, index=int_values)
        >>> s.info()
        <class 'pandas.Series'>
        Index: 5 entries, 1 to 5
        Series name: None
        Non-Null Count  Dtype
        --------------  -----
        5 non-null      str
        dtypes: str(1)
        memory usage: 106.0 bytes

        Prints a summary excluding information about its values:

        >>> s.info(verbose=False)
        <class 'pandas.Series'>
        Index: 5 entries, 1 to 5
        dtypes: str(1)
        memory usage: 106.0 bytes

        Pipe output of Series.info to buffer instead of sys.stdout, get
        buffer content and writes to a text file:

        >>> import io
        >>> buffer = io.StringIO()
        >>> s.info(buf=buffer)
        >>> s = buffer.getvalue()
        >>> with open("df_info.txt", "w", encoding="utf-8") as f:  # doctest: +SKIP
        ...     f.write(s)
        260

        The `memory_usage` parameter allows deep introspection mode, specially
        useful for big Series and fine-tune memory optimization:

        >>> random_strings_array = np.random.choice(["a", "b", "c"], 10**6)
        >>> s = pd.Series(np.random.choice(["a", "b", "c"], 10**6))
        >>> s.info()
        <class 'pandas.Series'>
        RangeIndex: 1000000 entries, 0 to 999999
        Series name: None
        Non-Null Count    Dtype
        --------------    -----
        1000000 non-null  str
        dtypes: str(1)
        memory usage: 8.6 MB

        >>> s.info(memory_usage="deep")
        <class 'pandas.Series'>
        RangeIndex: 1000000 entries, 0 to 999999
        Series name: None
        Non-Null Count    Dtype
        --------------    -----
        1000000 non-null  str
        dtypes: str(1)
        memory usage: 8.6 MB
        )r  r  r  r  )rd   render)r   r  r  r  r  r  s         r   infozSeries.info  s8    h $--44#	 5 
 
 	
r   r   c                r    |                      |          }|r|| j                            |          z  }|S )at  
        Return the memory usage of the Series.

        The memory usage can optionally include the contribution of
        the index and of elements of `object` dtype.

        Parameters
        ----------
        index : bool, default True
            Specifies whether to include the memory usage of the Series index.
        deep : bool, default False
            If True, introspect the data deeply by interrogating
            `object` dtypes for system-level memory consumption, and include
            it in the returned value.

        Returns
        -------
        int
            Bytes of memory consumed.

        See Also
        --------
        numpy.ndarray.nbytes : Total bytes consumed by the elements of the
            array.
        DataFrame.memory_usage : Bytes consumed by a DataFrame.

        Examples
        --------
        >>> s = pd.Series(range(3))
        >>> s.memory_usage()
        156

        Not including the index gives the size of the rest of the data, which
        is necessarily smaller:

        >>> s.memory_usage(index=False)
        24

        The memory footprint of `object` values is ignored by default:

        >>> s = pd.Series(["a", "b"])
        >>> s.values
        <ArrowStringArray>
        ['a', 'b']
        Length: 2, dtype: str
        >>> s.memory_usage()
        150
        >>> s.memory_usage(deep=True)
        150
        r   )_memory_usager   r  )r   r   r   r  s       r   r  zSeries.memory_usage:  sE    f D)) 	4((d(333Ar   c                    t          j        | j        |          }|                     || j        d                              | d          S )an  
        Whether elements in Series are contained in `values`.

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

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

        Returns
        -------
        Series
            Series of booleans indicating if each element is in values.

        Raises
        ------
        TypeError
          * If `values` is a string

        See Also
        --------
        DataFrame.isin : Equivalent method on DataFrame.

        Examples
        --------
        >>> s = pd.Series(
        ...     ["llama", "cow", "llama", "beetle", "llama", "hippo"], name="animal"
        ... )
        >>> s.isin(["cow", "llama"])
        0     True
        1     True
        2     True
        3    False
        4     True
        5    False
        Name: animal, dtype: bool

        To invert the boolean values, use the ``~`` operator:

        >>> ~s.isin(["cow", "llama"])
        0    False
        1    False
        2    False
        3     True
        4    False
        5     True
        Name: animal, dtype: bool

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

        >>> s.isin(["llama"])
        0     True
        1    False
        2     True
        3    False
        4     True
        5    False
        Name: animal, dtype: bool

        Strings and integers are distinct and are therefore not comparable:

        >>> pd.Series([1]).isin(["1"])
        0    False
        dtype: bool
        >>> pd.Series([1.1]).isin(["1.1"])
        0    False
        dtype: bool
        Fr:  isinrs  )r?   r"  r	  r   r   r#  )r   r   r4  s      r   r"  zSeries.isinr  sR    T v66  tz FFSS T 
 
 	
r   both	inclusive+Literal['both', 'neither', 'left', 'right']c                    |dk    r| |k    }| |k    }nH|dk    r| |k    }| |k     }n5|dk    r| |k    }| |k    }n"|dk    r| |k    }| |k     }nt          d          ||z  S )a  
        Return boolean Series equivalent to left <= series <= right.

        This function returns a boolean vector containing `True` wherever the
        corresponding Series element is between the boundary values `left` and
        `right`. NA values are treated as `False`.

        Parameters
        ----------
        left : scalar or list-like
            Left boundary.
        right : scalar or list-like
            Right boundary.
        inclusive : {"both", "neither", "left", "right"}
            Include boundaries. Whether to set each bound as closed or open.

        Returns
        -------
        Series
            Series representing whether each element is between left and
            right (inclusive).

        See Also
        --------
        Series.gt : Greater than of series and other.
        Series.lt : Less than of series and other.

        Notes
        -----
        This function is equivalent to ``(left <= ser) & (ser <= right)``

        Examples
        --------
        >>> s = pd.Series([2, 0, 4, 8, np.nan])

        Boundary values are included by default:

        >>> s.between(1, 4)
        0     True
        1    False
        2     True
        3    False
        4    False
        dtype: bool

        With `inclusive` set to ``"neither"`` boundary values are excluded:

        >>> s.between(1, 4, inclusive="neither")
        0     True
        1    False
        2    False
        3    False
        4    False
        dtype: bool

        `left` and `right` can be any scalar value:

        >>> s = pd.Series(["Alice", "Bob", "Carol", "Eve"])
        >>> s.between("Anna", "Daniel")
        0    False
        1     True
        2     True
        3    False
        dtype: bool
        r#  rQ  rR  neitherzJInclusive has to be either string of 'both','left', 'right', or 'neither'.)r   )r   rQ  rR  r$  lmaskrmasks         r   betweenzSeries.between  s    N DLEEMEE&  DLE5LEE'!!4KEEMEE)##4KE5LEE1  
 u}r   caselistlist[tuple[ArrayLike | Callable[[Series], Series | np.ndarray | Sequence[bool]], ArrayLike | Scalar | Callable[[Series], Series | np.ndarray]],]c           	         t          |t                    st          dt          |                     |st	          d          t          |          D ]s\  }}t          |t                    s#t          d| dt          |           d          t          |          dk    r#t	          d| dt          |           d          t fd|D             }                     d	
          }t          |ddi\  }}d g ||D             }t          t          |                    dk    rt          |          }g }	t          ||d          D ]\  }
}t          |          r t          |t          |
          |          }n<t          |t                    r|                    |          }nt!          ||          }|	                    |           |	}|                    |          }t%          t          |          dz
  dd          }t          |t'          |          t'          |          d          D ]J\  }}
}	 |                    |
|dd	d          }"# t*          $ r}t	          d| d| d          |d}~ww xY w|S )a^  
        Replace values where the conditions are True.

        .. versionadded:: 2.2.0

        Parameters
        ----------
        caselist : A list of tuples of conditions and expected replacements
            Takes the form:  ``(condition0, replacement0)``,
            ``(condition1, replacement1)``, ... .
            ``condition`` should be a 1-D boolean array-like object
            or a callable. If ``condition`` is a callable,
            it is computed on the Series
            and should return a boolean Series or array.
            The callable must not change the input Series
            (though pandas doesn`t check it). ``replacement`` should be a
            1-D array-like object, a scalar or a callable.
            If ``replacement`` is a callable, it is computed on the Series
            and should return a scalar or Series. The callable
            must not change the input Series
            (though pandas doesn`t check it).

        Returns
        -------
        Series
            A new Series with values replaced based on the provided conditions.

        See Also
        --------
        Series.mask : Replace values where the condition is True.

        Examples
        --------
        >>> c = pd.Series([6, 7, 8, 9], name="c")
        >>> a = pd.Series([0, 0, 1, 2])
        >>> b = pd.Series([0, 3, 4, 5])

        >>> c.case_when(
        ...     caselist=[
        ...         (a.gt(0), a),  # condition, replacement
        ...         (b.gt(0), b),
        ...     ]
        ... )
        0    6
        1    3
        2    1
        3    2
        Name: c, dtype: int64
        z4The caselist argument should be a list; instead got zIprovide at least one boolean condition, with a corresponding replacement.z	Argument z must be a tuple; instead got .r   zE must have length 2; a condition and replacement; instead got length c                j    g | ]/\  }}t          j        |          t          j        |          f0S rq  )r   r(  )r  	conditionreplacementr   s      r   r  z$Series.case_when.<locals>.<listcomp>l  sQ     
 
 

 '	; %i66%k488
 
 
r   Fr   r  Tc                8    g | ]}t          |          d          S r   )r+   )r  r  s     r   r  z$Series.case_when.<locals>.<listcomp>u  s&    VVVc)#..q1VVVr   rG  r  )r  r  r   r   re  r   N)r,  r   r   ry  zFailed to apply conditionz and replacement)r   r   r,  r   r   r  r   r   r   r  setr*   r4   r)   r9   r   pd_arrayappendr  reversedri  rP  )r   r+  numentrydefault
conditionsreplacementscommon_dtypescommon_dtypeupdated_replacementsr0  r1  counterpositionerrors   `              r   	case_whenzSeries.case_when  sC   t (D)) 	WtH~~WW    	4  
 $H-- 
	 
	JCeU++ QQQ4;;QQQ   5zzQ 8 8 8*-e**8 8 8   
 
 
 

 +3
 
 
 )))''#&#>#>#> 
LVV=U|=UW=UVVVs=!!""Q&&+M::L#% *-j,t*T*T*T 	9 	9&	;[)) L"D)#i..# # #KK  Y77 L"-"4"4\"B"BKK"*;l"K"K"KK$++K8888/Lnn\22GJ!+R4403Xj))8L+A+A$1
 1
 1
 
	 
	,Hi!,,[q%t '       UUU(UUU  s   I
J'I>>Jc                *    t          j        |           S )a  
        Detect missing values.

        Return a boolean same-sized Series indicating if the values are NA.
        NA values, such as None or :attr:`numpy.NaN`, get mapped to True
        values.
        Everything else gets mapped to False values. Characters such as empty
        strings ``''`` or :attr:`numpy.inf` are not considered NA values.

        Returns
        -------
        Series
            Mask of bool values for each element in Series that
            indicates whether an element is an NA value.

        See Also
        --------
        DataFrame.isna : Detect missing values.
        DataFrame.isnull : Alias of isna.
        Series.notna : Boolean inverse of isna.
        DataFrame.notna : Boolean inverse of isna.
        Series.notnull : Alias of notna.
        DataFrame.notnull : Alias of notna.
        Series.dropna : Omit axes labels with missing values.
        DataFrame.dropna : Omit axes labels with missing values.
        isna : Top-level isna.

        Examples
        --------
        Show which entries in a Series are NA.

        >>> ser = pd.Series([5, 6, np.nan])
        >>> ser
        0    5.0
        1    6.0
        2    NaN
        dtype: float64
        >>> ser.isna()
        0    False
        1    False
        2     True
        dtype: bool
        )rO   r;   r   s    r   r;   zSeries.isna  s    X |D!!!r   r   )r   c                D    t                                                      S )z<
        Series.isnull is an alias for Series.isna.
        )r  isnullr  s    r   rF  zSeries.isnull  s    
 ww~~r   c                D    t                                                      S )a3  
        Detect existing (non-missing) values.

        Return a boolean same-sized Series indicating if the values are not NA.
        Non-missing values get mapped to True. Characters such as empty
        strings ``''`` or :attr:`numpy.inf` are not considered NA values.
        NA values, such as None or :attr:`numpy.NaN`, get mapped to False
        values.

        Returns
        -------
        Series
            Mask of bool values for each element in Series that
            indicates whether an element is not an NA value.

        See Also
        --------
        Series.isna : Detect missing values.
        DataFrame.isna : Detect missing values.
        Series.isnull : Alias of isna.
        DataFrame.isnull : Alias of isna.
        DataFrame.notna : Boolean inverse of isna.
        DataFrame.notnull : Alias of notna.
        Series.dropna : Omit axes labels with missing values.
        DataFrame.dropna : Omit axes labels with missing values.
        notna : Top-level notna.

        Examples
        --------
        Show which entries in a Series are not NA.

        >>> ser = pd.Series([5, 6, np.nan])
        >>> ser
        0    5.0
        1    6.0
        2    NaN
        dtype: float64
        >>> ser.notna()
        0     True
        1     True
        2    False
        dtype: bool
        )r  r=   r  s    r   r=   zSeries.notna  s    X ww}}r   c                D    t                                                      S )z>
        Series.notnull is an alias for Series.notna.
        )r  notnullr  s    r   rI  zSeries.notnull  s    
 ww   r   )r   r   howr  rJ  AnyAll | Nonec                   d S r   rq  r   r   r   rJ  r  s        r   r  zSeries.dropna  s	     r   )r   rJ  r  c                   d S r   rq  rM  s        r   r  zSeries.dropna  s	     sr   c               L   t          |d          }t          |d          }|                     |pd           | j        rt          |           }n|s|                     d          }n| }|r!t          t          |                    |_        |r|                     |          S |S )u,  
        Return a new Series with missing values removed.

        See the :ref:`User Guide <missing_data>` for more on which values are
        considered missing, and how to work with missing data.

        Parameters
        ----------
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.
        inplace : bool, default False
            If True, do operation inplace and return None.
        how : str, optional
            Not in use. Kept for compatibility.
        ignore_index : bool, default ``False``
            If ``True``, the resulting axis will be labeled 0, 1, …, n - 1.

            .. versionadded:: 2.0.0

        Returns
        -------
        Series or None
            Series with NA entries dropped from it or None if ``inplace=True``.

        See Also
        --------
        Series.isna: Indicate missing values.
        Series.notna : Indicate existing (non-missing) values.
        Series.fillna : Replace missing values.
        DataFrame.dropna : Drop rows or columns which contain NA values.
        Index.dropna : Drop missing indices.

        Examples
        --------
        >>> ser = pd.Series([1.0, 2.0, np.nan])
        >>> ser
        0    1.0
        1    2.0
        2    NaN
        dtype: float64

        Drop NA values from a Series.

        >>> ser.dropna()
        0    1.0
        1    2.0
        dtype: float64

        Empty strings are not considered NA values. ``None`` is considered an
        NA value.

        >>> ser = pd.Series([np.nan, 2, pd.NaT, "", None, "I stay"])
        >>> ser
        0       NaN
        1         2
        2       NaT
        3
        4      None
        5    I stay
        dtype: object
        >>> ser.dropna()
        1         2
        3
        5    I stay
        dtype: object
        r   r  r   Fr   )	r%   r  r   r>   r   rW   r   r   r  )r   r   r   rJ  r  r4  s         r   r  zSeries.dropna  s    T &gy99*<HHdia((( 	(..FF 	YYEY**FFF 	6(V55FL 	''///Mr   startfreqFrequency | None!Literal['s', 'e', 'start', 'end']c                <   |                      |           t          | j        t                    s)t	          dt          | j                  j                   |                     d          }| j                            ||          }t          |d|           |S )a.  
        Cast to DatetimeIndex of Timestamps, at *beginning* of period.

        This can be changed to the *end* of the period, by specifying `how="e"`.

        Parameters
        ----------
        freq : str, default frequency of PeriodIndex
            Desired frequency.
        how : {'s', 'e', 'start', 'end'}
            Convention for converting period to timestamp; start of period
            vs. end.
        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

            .. deprecated:: 3.0.0

                This keyword is ignored and will be removed in pandas 4.0. Since
                pandas 3.0, this method always returns a new object using a lazy
                copy mechanism that defers copies until necessary
                (Copy-on-Write). See the `user guide on Copy-on-Write
                <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
                for more details.

        Returns
        -------
        Series with DatetimeIndex
            Series with the PeriodIndex cast to DatetimeIndex.

        See Also
        --------
        Series.to_period: Inverse method to cast DatetimeIndex to PeriodIndex.
        DataFrame.to_timestamp: Equivalent method for DataFrame.

        Examples
        --------
        >>> idx = pd.PeriodIndex(["2023", "2024", "2025"], freq="Y")
        >>> s1 = pd.Series([1, 2, 3], index=idx)
        >>> s1
        2023    1
        2024    2
        2025    3
        Freq: Y-DEC, dtype: int64

        The resulting frequency of the Timestamps is `YearBegin`

        >>> s1 = s1.to_timestamp()
        >>> s1
        2023-01-01    1
        2024-01-01    2
        2025-01-01    3
        Freq: YS-JAN, dtype: int64

        Using `freq` which is the offset that the Timestamps will have

        >>> s2 = pd.Series([1, 2, 3], index=idx)
        >>> s2 = s2.to_timestamp(freq="M")
        >>> s2
        2023-01-31    1
        2024-01-31    2
        2025-01-31    3
        Freq: YE-JAN, dtype: int64
        unsupported Type Fr   )rQ  rJ  r   )
r  r   r   rV   r,  r   r   r   to_timestampsetattr)r   rQ  rJ  r   new_objr?  s         r   rV  zSeries.to_timestampw  s    L 	$$T***$*k22 	MKTZ0@0@0IKKLLL)))''J++3+??	),,,r   c                :   |                      |           t          | j        t                    s)t	          dt          | j                  j                   |                     d          }| j                            |          }t          |d|           |S )a  
        Convert Series from DatetimeIndex to PeriodIndex.

        Parameters
        ----------
        freq : str, default None
            Frequency associated with the PeriodIndex.
        copy : bool, default False
            This keyword is now ignored; changing its value will have no
            impact on the method.

            .. deprecated:: 3.0.0

                This keyword is ignored and will be removed in pandas 4.0. Since
                pandas 3.0, this method always returns a new object using a lazy
                copy mechanism that defers copies until necessary
                (Copy-on-Write). See the `user guide on Copy-on-Write
                <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
                for more details.

        Returns
        -------
        Series
            Series with index converted to PeriodIndex.

        See Also
        --------
        DataFrame.to_period: Equivalent method for DataFrame.
        Series.dt.to_period: Convert DateTime column values.

        Examples
        --------
        >>> idx = pd.DatetimeIndex(["2023", "2024", "2025"])
        >>> s = pd.Series([1, 2, 3], index=idx)
        >>> s = s.to_period()
        >>> s
        2023    1
        2024    2
        2025    3
        Freq: Y-DEC, dtype: int64

        Viewing the index

        >>> s.index
        PeriodIndex(['2023', '2024', '2025'], dtype='period[Y-DEC]')
        rU  Fr   )rQ  r   )
r  r   r   rS   r,  r   r   r   	to_periodrW  )r   rQ  r   rX  r?  s        r   rZ  zSeries.to_period  s    f 	$$T***$*m44 	MKTZ0@0@0IKKLLL)))''J((d(33	),,,r   z!list[Literal['index', 'columns']]_AXIS_ORDERSz
Literal[0]_info_axis_numberzLiteral['index']_info_axis_nameaG  
        The index (axis labels) of the Series.

        The index of a Series is used to label and identify each element of the
        underlying data. The index can be thought of as an immutable ordered set
        (technically a multi-set, as it may contain duplicate labels), and is
        used to index and align data in pandas.

        Returns
        -------
        Index
            The index labels of the Series.

        See Also
        --------
        Series.reindex : Conform Series to new index.
        Index : The base pandas index type.

        Notes
        -----
        For more information on pandas indexing, see the `indexing user guide
        <https://pandas.pydata.org/docs/user_guide/indexing.html>`__.

        Examples
        --------
        To create a Series with a custom index and view the index labels:

        >>> cities = ['Kolkata', 'Chicago', 'Toronto', 'Lisbon']
        >>> populations = [14.85, 2.71, 2.93, 0.51]
        >>> city_series = pd.Series(populations, index=cities)
        >>> city_series.index
        Index(['Kolkata', 'Chicago', 'Toronto', 'Lisbon'], dtype='object')

        To change the index labels of an existing Series:

        >>> city_series.index = ['KOL', 'CHI', 'TOR', 'LIS']
        >>> city_series.index
        Index(['KOL', 'CHI', 'TOR', 'LIS'], dtype='object')
        )r   r!   r   r   plotr   structr   c                ,   t          j        | |          }t          |t                    r$|                     |          st          d          | j        }t          |dd          }t          j        |||          }| 	                    |||          S )Nz3Can only compare identically-labeled Series objectsTextract_numpyextract_ranger   r,  )
rC   r~  r   r   _indexed_samer   r	  rM   comparison_op_construct_resultr   r,  r  res_namelvaluesrvaluesr  s          r   _cmp_methodzSeries._cmp_methodF  s    )$66eV$$ 	TT-?-?-F-F 	TRSSS,TNNN&w<<
%%jxu%MMMr   c                    t          j        | |          }|                     |d          \  } }| j        }t	          |dd          }t          j        |||          }|                     |||          S )NT)align_asobjectra  rd  )rC   r~  _align_for_opr	  rM   
logical_oprg  rh  s          r   _logical_methodzSeries._logical_methodS  sy    )$66((t(DDe,TNNN^GWb99
%%jxu%MMMr   c                t    |                      |          \  } }t          j                            | ||          S r   )ro  r@   rd  _arith_method)r   r,  r  s      r   rs  zSeries._arith_method]  s4    ((//e!//eR@@@r   rn  c                |   | }t          |t                    r|j                            |j                  s|ri|j        t
          t          j        fvs|j        t
          t          j        fvrn4|                    t
                    }|                    t
                    }|	                    |          \  }}||fS )zalign lhs and rhs Series)
r   r   r   r   r   r   r   bool_r   r6  )r   rR  rn  rQ  s       r   ro  zSeries._align_for_opa  s    
 eV$$ 	0:$$U[11 0! 
5z&"();;;u{S @ @   ${{622 %V 4 4"jj//eU{r   c                   | }| j                             |j                   s|                     ||d          \  }}t          j        |j        |j        |          \  }}t          j        d          5   |||          }ddd           n# 1 swxY w Y   t          j        | |          }	|	                    ||	|          }
t          t          |
          S )a6  
        Perform generic binary operation with optional fill value.

        Parameters
        ----------
        other : Series
        func : binary operator
        fill_value : float or object
            Value to substitute for NA/null values. If both Series are NA in a
            location, the result will be NA regardless of the passed fill value.
        level : int or level name, default None
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.

        Returns
        -------
        Series
        outer)ry  r1  ry  rz  N)r   r   r6  rC   
fill_binopr	  r   r  r~  rg  r   r   )r   r,  rt  ry  rv  r;  	this_vals
other_valsr4  r   r$  s              r   _binopzSeries._binop{  s   & z  -- 	G**U%g*FFKD% #t|U]J W W	:[X&&& 	1 	1T)Z00F	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 %dE22$$VT599FC   s   5BBBr4  'ArrayLike | tuple[ArrayLike, ArrayLike]Series | tuple[Series, Series]c                   t          |t                    rn|                     |d         ||          }|                     |d         ||          }t          |t                    sJ t          |t                    sJ ||fS t	          |dd          }|                     || j        |d          }|                    |           }|                    |          }||_        |S )ah  
        Construct an appropriately-labelled Series from the result of an op.

        Parameters
        ----------
        result : ndarray or ExtensionArray
        name : Label
        other : Series, DataFrame or array-like

        Returns
        -------
        Series
            In the case of __divmod__ or __rdivmod__, a 2-tuple of Series.
        r   rd  rG  r   NF)r   r   r   )	r   r   rg  r   getattrr   r   r#  r   )r   r4  r   r,  res1res2r   r$  s           r   rg  zSeries._construct_result  s    ( fe$$ 		  ))&)$e)LLD))&)$e)LLD dF+++++dF+++++$< ..djERRt$$u%% 
r   ry  rv  r   c                  ||                      |           t          j        | |          }t          |t                    r|                     ||||          S t          |t          j        t          t          t          f          rnt          |          t          |           k    rt          d          |                     || j        d          }|                     ||||          }||_        |S t          |t                     rFt#          d|j                            d           d|j                            d           d          |0t)          |          r || |          S |                     |          }  || |          S )	N)ry  rv  zLengths must be equalF)r   Series.r  z. does not support a DataFrame `other`. Use df.z(ser) instead.)r  rC   r~  r   r   r{  r   r   r   r   rG   r   r   r   r   r   r8   r,  r   stripr;   fillna)r   r,  r  ry  rv  r   ri  r4  s           r   _flex_methodzSeries._flex_method  s   !!$''')$66eV$$ 	#;;ub*;MMM
D%HII 	#5zzSYY&& !8999%%eTZe%DDE[[%J[OOF#FLM|,, 	#J"+++C00 J J#%;#4#4S#9#9J J J  
 %;; 02dJ///{{:..2dE??"r   float | Nonec                J    |                      |t          j        |||          S )a  
        Return Equal to of series and other, element-wise (binary operator `eq`).

        Equivalent to ``series == other``, but with support to substitute a fill_value
        for missing data in either one of the inputs.

        Parameters
        ----------
        other : object
            When a Series is provided, will align on indexes. For all other types,
            will behave the same as ``==`` but with possibly different results due
            to the other arguments.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.ge : Return elementwise Greater than or equal to of series and other.
        Series.le : Return elementwise Less than or equal to of series and other.
        Series.gt : Return elementwise Greater than of series and other.
        Series.lt : Return elementwise Less than of series and other.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        dtype: float64
        >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
        >>> b
        a    1.0
        b    NaN
        d    1.0
        e    NaN
        dtype: float64
        >>> a.eq(b, fill_value=0)
        a     True
        b    False
        c    False
        d    False
        e    False
        dtype: bool
        r  )r  operatoreqr   r,  ry  rv  r   s        r   r  z	Series.eq  s/    D   8;e
 ! 
 
 	
r   nec                J    |                      |t          j        |||          S Nr  )r  r  r  r  s        r   r  z	Series.ne+  ,      8;e
 ! 
 
 	
r   c                J    |                      |t          j        |||          S )aZ  
        Return Less than or equal to of series and other,         element-wise (binary operator `le`).

        Equivalent to ``series <= other``, but with support to substitute a
        fill_value for missing data in either one of the inputs.

        Parameters
        ----------
        other : object
            When a Series is provided, will align on indexes. For all other types,
            will behave the same as ``==`` but with possibly different results due
            to the other arguments.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.ge : Return elementwise Greater than or equal to of series and other.
        Series.lt : Return elementwise Less than of series and other.
        Series.gt : Return elementwise Greater than of series and other.
        Series.eq : Return elementwise equal to of series and other.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan, 1], index=['a', 'b', 'c', 'd', 'e'])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        e    1.0
        dtype: float64
        >>> b = pd.Series([0, 1, 2, np.nan, 1], index=['a', 'b', 'c', 'd', 'f'])
        >>> b
        a    0.0
        b    1.0
        c    2.0
        d    NaN
        f    1.0
        dtype: float64
        >>> a.le(b, fill_value=0)
        a    False
        b     True
        c     True
        d    False
        e    False
        f     True
        dtype: bool
        r  )r  r  ler  s        r   r  z	Series.le1  s/    @   8;e
 ! 
 
 	
r   ltc                J    |                      |t          j        |||          S r  )r  r  r  r  s        r   r  z	Series.ltu  r  r   c                J    |                      |t          j        |||          S )a]  
        Return Greater than or equal to of series and other,         element-wise (binary operator `ge`).

        Equivalent to ``series >= other``, but with support to substitute a
        fill_value for missing data in either one of the inputs.

        Parameters
        ----------
        other : object
            When a Series is provided, will align on indexes. For all other types,
            will behave the same as ``==`` but with possibly different results due
            to the other arguments.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.gt : Greater than comparison, element-wise.
        Series.le : Less than or equal to comparison, element-wise.
        Series.lt : Less than comparison, element-wise.
        Series.eq : Equal to comparison, element-wise.
        Series.ne : Not equal to comparison, element-wise.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan, 1], index=["a", "b", "c", "d", "e"])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        e    1.0
        dtype: float64
        >>> b = pd.Series([0, 1, 2, np.nan, 1], index=["a", "b", "c", "d", "f"])
        >>> b
        a    0.0
        b    1.0
        c    2.0
        d    NaN
        f    1.0
        dtype: float64
        >>> a.ge(b, fill_value=0)
        a     True
        b     True
        c    False
        d    False
        e     True
        f    False
        dtype: bool
        r  )r  r  ger  s        r   r  z	Series.ge{  s/    B   8;e
 ! 
 
 	
r   gtc                J    |                      |t          j        |||          S r  )r  r  r  r  s        r   r  z	Series.gt  r  r   c                J    |                      |t          j        |||          S )a#  
        Return Addition of series and other, element-wise (binary operator `add`).

        Equivalent to ``series + other``, but with support to substitute a fill_value
        for missing data in either one of the inputs.

        Parameters
        ----------
        other : Series or scalar value
            With which to compute the addition.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.radd : Reverse of the Addition operator, see
            `Python documentation
            <https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types>`_
            for more details.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        dtype: float64
        >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
        >>> b
        a    1.0
        b    NaN
        d    1.0
        e    NaN
        dtype: float64
        >>> a.add(b, fill_value=0)
        a    2.0
        b    1.0
        c    1.0
        d    1.0
        e    NaN
        dtype: float64
        r  )r  r  addr  s        r   r  z
Series.add  /    t   8<u$ ! 
 
 	
r   raddc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.radd  ,      9>:D ! 
 
 	
r   subc                J    |                      |t          j        |||          S r  )r  r  r  r  s        r   r  z
Series.sub
  ,      8<u$ ! 
 
 	
r   rsubc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rsub  r  r   c                J    |                      |t          j        |||          S )a  
        Return Multiplication of series and other, element-wise (binary operator `mul`).

        Equivalent to ``series * other``, but with support to substitute
        a fill_value for missing data in either one of the inputs.

        Parameters
        ----------
        other : Series or scalar value
            With which to compute the multiplication.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.rmul : Reverse of the Multiplication operator, see
            `Python documentation
            <https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types>`_
            for more details.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        dtype: float64
        >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
        >>> b
        a    1.0
        b    NaN
        d    1.0
        e    NaN
        dtype: float64
        >>> a.multiply(b, fill_value=0)
        a    1.0
        b    0.0
        c    0.0
        d    0.0
        e    NaN
        dtype: float64
        >>> a.mul(5, fill_value=0)
        a    5.0
        b    5.0
        c    5.0
        d    0.0
        dtype: float64
        r  )r  r  mulr  s        r   r  z
Series.mul  s/    L   8<u$ ! 
 
 	
r   rmulc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rmuld  r  r   c                J    |                      |t          j        |||          S )aK  
        Return Floating division of series and other,         element-wise (binary operator `truediv`).

        Equivalent to ``series / other``, but with support to substitute a
        fill_value for missing data in either one of the inputs.

        Parameters
        ----------
        other : Series or scalar value
            Series with which to compute division.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.rtruediv : Reverse of the Floating division operator, see
            `Python documentation
            <https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types>`_
            for more details.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        dtype: float64
        >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
        >>> b
        a    1.0
        b    NaN
        d    1.0
        e    NaN
        dtype: float64
        >>> a.divide(b, fill_value=0)
        a    1.0
        b    inf
        c    inf
        d    0.0
        e    NaN
        dtype: float64
        r  )r  r  truedivr  s        r   r  zSeries.truedivj  s0    v   8#5Zd ! 
 
 	
r   rtruedivc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rtruediv  s.      9%UzPT ! 
 
 	
r   floordivc                J    |                      |t          j        |||          S r  )r  r  r  r  s        r   r  zSeries.floordiv  s-      8$Ejt ! 
 
 	
r   	rfloordivc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rfloordiv  s.      9&e
QU ! 
 
 	
r   c                J    |                      |t          j        |||          S )a   
        Return Modulo of series and other, element-wise (binary operator `mod`).

        Equivalent to ``series % other``, but with support to substitute a
        fill_value for missing data in either one of the inputs.

        Parameters
        ----------
        other : Series or scalar value
            Series with which to compute modulo.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : None or float value, default None (NaN)
            Fill existing missing (NaN) values, and any new element needed for
            successful Series alignment, with this value before computation.
            If data in both corresponding Series locations is missing
            the result of filling (at that location) will be missing.
        axis : {0 or 'index'}
            Unused. Parameter needed for compatibility with DataFrame.

        Returns
        -------
        Series
            The result of the operation.

        See Also
        --------
        Series.rmod : Reverse of the Modulo operator, see
            `Python documentation
            <https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types>`_
            for more details.

        Examples
        --------
        >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
        >>> a
        a    1.0
        b    1.0
        c    1.0
        d    NaN
        dtype: float64
        >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
        >>> b
        a    1.0
        b    NaN
        d    1.0
        e    NaN
        dtype: float64
        >>> a.mod(b, fill_value=0)
        a    0.0
        b    NaN
        c    NaN
        d    0.0
        e    NaN
        dtype: float64
        r  )r  r  modr  s        r   r  z
Series.mod  r  r   rmodc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rmod  r  r   powc                J    |                      |t          j        |||          S r  )r  r  r  r  s        r   r  z
Series.pow  r  r   rpowc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rpow
  r  r   divmodc                @    |                      |t          |||          S r  )r  r  r  s        r   r  zSeries.divmod  s*      6:D ! 
 
 	
r   rdivmodc                J    |                      |t          j        |||          S r  )r  rD   r  r  s        r   r  zSeries.rdivmod  s-      9$Ejt ! 
 
 	
r   )r   r  r&  filter_typer&  c          	     $   | j         }||                     |           t          |t                    r |j        |fd|i|}	n<|r/| j        j        dvr!d}
|dv rd}
t          d| d|
 d	| d
           ||fd|i|}	t          |	          }	|	S )z
        Perform a reduction operation.

        If we have an ndarray as a value, then simply perform the operation,
        otherwise delegate to the object.
        Nr  iufcbr&  )rh  r{  	bool_onlyr  z does not allow =z with non-numeric dtypes.)	r	  r  r   rG   _reducer   rR  r,  r-   )r   r  r   r   r  r&  r  kwdsdelegater4  kwd_names              r   r  zSeries._reduce  s    $ <!!$'''h// 	9%X%dBB6BTBBFF  	
w > >)>))*H/d / /H / /| / / /   R888488F)&11r   )r   r  r  r  c                   t          j        d|d           t          |dd           |                     t          j        d|||d          S )	ak  
        Return whether any element is True, potentially over an axis.

        Returns False unless there is at least one element within a series or
        along a Dataframe axis that is True or equivalent (e.g. non-zero or
        non-empty).

        Parameters
        ----------
        axis : {0 or 'index', 1 or 'columns', None}, default 0
            Indicate which axis or axes should be reduced. For `Series` this parameter
            is unused and defaults to 0.

            * 0 / 'index' : reduce the index, return a Series whose index is the
              original column labels.
            * 1 / 'columns' : reduce the columns, return a Series whose index is the
              original index.
            * None : reduce all axes, return a scalar.

        bool_only : bool, default False
            Include only boolean columns. Not implemented for Series.
        skipna : bool, default True
            Exclude NA/null values. If the entire row/column is NA and skipna is
            True, then the result will be False, as for an empty row/column.
            If skipna is False, then NA are treated as True, because these are not
            equal to zero.
        **kwargs : any, default None
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Series or scalar
            If axis=None, then a scalar boolean is returned.
            Otherwise a Series is returned with index matching the index argument.

        See Also
        --------
        numpy.any : Numpy version of this method.
        Series.any : Return whether any element is True.
        Series.all : Return whether all elements are True.
        DataFrame.any : Return whether any element is True over requested axis.
        DataFrame.all : Return whether all elements are True over requested axis.

        Examples
        --------
        **Series**

        For Series input, the output is a scalar indicating whether any element
        is True.

        >>> pd.Series([False, False]).any()
        False
        >>> pd.Series([True, False]).any()
        True
        >>> pd.Series([], dtype="float64").any()
        False
        >>> pd.Series([np.nan]).any()
        False
        >>> pd.Series([np.nan]).any(skipna=False)
        True

        **DataFrame**

        Whether each column contains at least one True element (the default).

        >>> df = pd.DataFrame({"A": [1, 2], "B": [0, 2], "C": [0, 0]})
        >>> df
           A  B  C
        0  1  0  0
        1  2  2  0

        >>> df.any()
        A     True
        B     True
        C    False
        dtype: bool

        Aggregating over the columns.

        >>> df = pd.DataFrame({"A": [True, False], "B": [1, 2]})
        >>> df
               A  B
        0   True  1
        1  False  2

        >>> df.any(axis="columns")
        0    True
        1    True
        dtype: bool

        >>> df = pd.DataFrame({"A": [True, False], "B": [1, 0]})
        >>> df
               A  B
        0   True  1
        1  False  0

        >>> df.any(axis="columns")
        0    True
        1    False
        dtype: bool

        Aggregating over the entire DataFrame with ``axis=None``.

        >>> df.any(axis=None)
        True

        `any` for an empty DataFrame is an empty Series.

        >>> pd.DataFrame([]).any()
        Series([], dtype: bool)
        rq  rh  fnamer  Fnone_allowedr   r   r   r&  r  r  )ru  validate_logical_funcr%   r  rB   nananyr   r   r  r  r  s        r   rh  z
Series.anyL  sa    p 	 V59999FH5AAAA||M"  
 
 	
r   r{  c                    t          j        d|d           t          |dd           |                     t          j        d|||d          S )	a
  
        Return whether all elements are True, potentially over an axis.

        Returns True unless there at least one element within a series or
        along a Dataframe axis that is False or equivalent (e.g. zero or
        empty).

        Parameters
        ----------
        axis : {0 or 'index', 1 or 'columns', None}, default 0
            Indicate which axis or axes should be reduced. For `Series` this parameter
            is unused and defaults to 0.

            * 0 / 'index' : reduce the index, return a Series whose index is the
              original column labels.
            * 1 / 'columns' : reduce the columns, return a Series whose index is the
              original index.
            * None : reduce all axes, return a scalar.

        bool_only : bool, default False
            Include only boolean columns. Not implemented for Series.
        skipna : bool, default True
            Exclude NA/null values. If the entire row/column is NA and skipna is
            True, then the result will be True, as for an empty row/column.
            If skipna is False, then NA are treated as True, because these are not
            equal to zero.
        **kwargs : any, default None
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Series or scalar
            If axis=None, then a scalar boolean is returned.
            Otherwise a Series is returned with index matching the index argument.

        See Also
        --------
        Series.all : Return True if all elements are True.
        DataFrame.any : Return True if one (or more) elements are True.

        Examples
        --------
        **Series**

        >>> pd.Series([True, True]).all()
        True
        >>> pd.Series([True, False]).all()
        False
        >>> pd.Series([], dtype="float64").all()
        True
        >>> pd.Series([np.nan]).all()
        True
        >>> pd.Series([np.nan]).all(skipna=False)
        True

        **DataFrames**

        Create a DataFrame from a dictionary.

        >>> df = pd.DataFrame({"col1": [True, True], "col2": [True, False]})
        >>> df
           col1   col2
        0  True   True
        1  True  False

        Default behaviour checks if values in each column all return True.

        >>> df.all()
        col1     True
        col2    False
        dtype: bool

        Specify ``axis='columns'`` to check if values in each row all return True.

        >>> df.all(axis="columns")
        0     True
        1    False
        dtype: bool

        Or ``axis=None`` for whether every value is True.

        >>> df.all(axis=None)
        False
        rq  r{  r  r  Fr  r   r  )ru  r  r%   r  rB   nanallr  s        r   r{  z
Series.all  sa    z 	 V59999FH5AAAA||M"  
 
 	
r   minc                .    t          j        | f|||d|S )a  
        Return the minimum of the values over the requested axis.

        If you want the *index* of the minimum, use ``idxmin``.
        This is the equivalent of the ``numpy.ndarray`` method ``argmin``.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            For DataFrames, specifying ``axis=None`` will apply the aggregation
            across both axes.

            .. versionadded:: 2.0.0

        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar or Series (if level specified)
            The minimum of the values in the Series.

        See Also
        --------
        numpy.min : Equivalent numpy function for arrays.
        Series.min : Return the minimum.
        Series.max : Return the maximum.
        Series.idxmin : Return the index of the minimum.
        Series.idxmax : Return the index of the maximum.
        DataFrame.min : Return the minimum over the requested axis.
        DataFrame.max : Return the maximum over the requested axis.
        DataFrame.idxmin : Return the index of the minimum over the requested axis.
        DataFrame.idxmax : Return the index of the maximum over the requested axis.

        Examples
        --------
        >>> idx = pd.MultiIndex.from_arrays(
        ...     [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]],
        ...     names=["blooded", "animal"],
        ... )
        >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx)
        >>> s
        blooded  animal
        warm     dog       4
                 falcon    2
        cold     fish      0
                 spider    8
        Name: legs, dtype: int64

        >>> s.min()
        0
        r   r  r&  )rO   r  r   r   r  r&  r  s        r   r  z
Series.min7  5    F {
F
 
IO
 
 	
r   maxc                .    t          j        | f|||d|S )a  
        Return the maximum of the values over the requested axis.

        If you want the *index* of the maximum, use ``idxmax``.
        This is the equivalent of the ``numpy.ndarray`` method ``argmax``.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            For DataFrames, specifying ``axis=None`` will apply the aggregation
            across both axes.

            .. versionadded:: 2.0.0

        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar or Series (if level specified)
            The maximum of the values in the Series.

        See Also
        --------
        numpy.max : Equivalent numpy function for arrays.
        Series.min : Return the minimum.
        Series.max : Return the maximum.
        Series.idxmin : Return the index of the minimum.
        Series.idxmax : Return the index of the maximum.
        DataFrame.min : Return the minimum over the requested axis.
        DataFrame.max : Return the maximum over the requested axis.
        DataFrame.idxmin : Return the index of the minimum over the requested axis.
        DataFrame.idxmax : Return the index of the maximum over the requested axis.

        Examples
        --------
        >>> idx = pd.MultiIndex.from_arrays(
        ...     [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]],
        ...     names=["blooded", "animal"],
        ... )
        >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx)
        >>> s
        blooded  animal
        warm     dog       4
                 falcon    2
        cold     fish      0
                 spider    8
        Name: legs, dtype: int64

        >>> s.max()
        8
        r  )rO   r  r  s        r   r  z
Series.max~  r  r   r  	min_countc                0    t          j        | f||||d|S )a
  
        Return the sum of the values over the requested axis.

        This is equivalent to the method ``numpy.sum``.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            .. warning::

                The behavior of DataFrame.sum with ``axis=None`` is deprecated,
                in a future version this will reduce over both axes and return a scalar
                To retain the old behavior, pass axis=0 (or do not pass axis).

            .. versionadded:: 2.0.0

        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns. Not implemented for Series.

        min_count : int, default 0
            The required number of valid values to perform the operation. If fewer than
            ``min_count`` non-NA values are present the result will be NA.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar or Series (if level specified)
            Sum of the values for the requested axis.

        See Also
        --------
        numpy.sum : Equivalent numpy function for computing sum.
        Series.mean : Mean of the values.
        Series.median : Median of the values.
        Series.std : Standard deviation of the values.
        Series.var : Variance of the values.
        Series.min : Minimum value.
        Series.max : Maximum value.

        Examples
        --------
        >>> idx = pd.MultiIndex.from_arrays(
        ...     [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]],
        ...     names=["blooded", "animal"],
        ... )
        >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx)
        >>> s
        blooded  animal
        warm     dog       4
                 falcon    2
        cold     fish      0
                 spider    8
        Name: legs, dtype: int64

        >>> s.sum()
        14

        By default, the sum of an empty or all-NA Series is ``0``.

        >>> pd.Series([], dtype="float64").sum()  # min_count=0 is the default
        0.0

        This can be controlled with the ``min_count`` parameter. For example, if
        you'd like the sum of an empty series to be NaN, pass ``min_count=1``.

        >>> pd.Series([], dtype="float64").sum(min_count=1)
        nan

        Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and
        empty series identically.

        >>> pd.Series([np.nan]).sum()
        0.0

        >>> pd.Series([np.nan]).sum(min_count=1)
        nan
        r   r  r&  r  )rO   r  r   r   r  r&  r  r  s         r   r  z
Series.sum  s<    x {
%
 
 
 
 	
r   prodc                0    t          j        | f||||d|S )a	  
        Return the product of the values over the requested axis.

        By default, missing values are skipped. To include them in the calculation,
        set ``skipna`` parameter to False.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            .. warning::
                The behavior of DataFrame.prod with ``axis=None`` is deprecated,
                in a future version this will reduce over both axes and return a scalar
                To retain the old behavior, pass axis=0 (or do not pass axis).

            .. versionadded:: 2.0.0
        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns. Not implemented for Series.
        min_count : int, default 0
            The required number of valid values to perform the operation. If fewer than
            ``min_count`` non-NA values are present the result will be NA.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar
            Value containing the calculation referenced in the description.

        See Also
        --------
        Series.sum : Return the sum.
        Series.min : Return the minimum.
        Series.max : Return the maximum.
        Series.idxmin : Return the index of the minimum.
        Series.idxmax : Return the index of the maximum.

        DataFrame.sum : Return the sum over the requested axis.
        DataFrame.min : Return the minimum over the requested axis.
        DataFrame.max : Return the maximum over the requested axis.
        DataFrame.idxmin : Return the index of the minimum over the requested axis.
        DataFrame.idxmax : Return the index of the maximum over the requested axis.

        Examples
        --------
        By default, the product of an empty or all-NA Series is ``1``

        >>> pd.Series([], dtype="float64").prod()
        1.0

        This can be controlled with the ``min_count`` parameter

        >>> pd.Series([], dtype="float64").prod(min_count=1)
        nan

        Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and
        empty series identically.

        >>> pd.Series([np.nan]).prod()
        1.0
        >>> pd.Series([np.nan]).prod(min_count=1)
        nan
        r  )rO   r  r  s         r   r  zSeries.prod*  s<    X |
%
 
 
 
 	
r   meanc                .    t          j        | f|||d|S )a  
        Return the mean of the values over the requested axis.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            For DataFrames, specifying ``axis=None`` will apply the aggregation
            across both axes.

            .. versionadded:: 2.0.0

        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar or Series (if level specified)
            Mean of the values for the requested axis.

        See Also
        --------
        numpy.median : Equivalent numpy function for computing median.
        Series.sum : Sum of the values.
        Series.median : Median of the values.
        Series.std : Standard deviation of the values.
        Series.var : Variance of the values.
        Series.min : Minimum value.
        Series.max : Maximum value.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.mean()
        2.0
        r  )rO   r  r  s        r   r  zSeries.mean  s5    d |
F
 
IO
 
 	
r   medianc                .    t          j        | f|||d|S )a  
        Return the median of the values over the requested axis.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            For DataFrames, specifying ``axis=None`` will apply the aggregation
            across both axes.

            .. versionadded:: 2.0.0

        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar or Series (if level specified)
            Median of the values for the requested axis.

        See Also
        --------
        numpy.median : Equivalent numpy function for computing median.
        Series.sum : Sum of the values.
        Series.median : Median of the values.
        Series.std : Standard deviation of the values.
        Series.var : Variance of the values.
        Series.min : Minimum value.
        Series.max : Maximum value.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.median()
        2.0

        With a DataFrame

        >>> df = pd.DataFrame({"a": [1, 2], "b": [2, 3]}, index=["tiger", "zebra"])
        >>> df
               a   b
        tiger  1   2
        zebra  2   3
        >>> df.median()
        a   1.5
        b   2.5
        dtype: float64

        Using axis=1

        >>> df.median(axis=1)
        tiger   1.5
        zebra   2.5
        dtype: float64

        In this case, `numeric_only` should be set to `True`
        to avoid getting an error.

        >>> df = pd.DataFrame({"a": [1, 2], "b": ["T", "Z"]}, index=["tiger", "zebra"])
        >>> df.median(numeric_only=True)
        a   1.5
        dtype: float64
        r  )rO   r  r  s        r   r  zSeries.median  s5    ^ ~
F
 
IO
 
 	
r   semc                0    t          j        | f||||d|S )a  
        Return unbiased standard error of the mean over requested axis.

        Normalized by N-1 by default. This can be changed using the ddof argument

        Parameters
        ----------
        axis : {index (0)}
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            Exclude NA/null values. If an entire row/column is NA, the result
            will be NA.
        ddof : int, default 1
            Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
            where N represents the number of elements.
        numeric_only : bool, default False
            Include only float, int, boolean columns. Not implemented for Series.
        **kwargs :
            Additional keywords have no effect but might be accepted
            for compatibility with NumPy.

        Returns
        -------
        scalar or Series (if level specified)
            Unbiased standard error of the mean over requested axis.

        See Also
        --------
        scipy.stats.sem : Compute standard error of the mean.
        Series.std : Return sample standard deviation over requested axis.
        Series.var : Return unbiased variance over requested axis.
        Series.mean : Return the mean of the values over the requested axis.
        Series.median : Return the median of the values over the requested axis.
        Series.mode : Return the mode(s) of the Series.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> round(s.sem(), 6)
        0.57735
        r   r  r?  r&  )rO   r  r   r   r  r?  r&  r  s         r   r  z
Series.sem   s<    d {
%
 
 
 
 	
r   varc                0    t          j        | f||||d|S )a  
        Return unbiased variance over requested axis.

        Normalized by N-1 by default. This can be changed using the ddof argument.

        Parameters
        ----------
        axis : {index (0)}
            For `Series` this parameter is unused and defaults to 0.

            .. warning::

                The behavior of DataFrame.var with ``axis=None`` is deprecated,
                in a future version this will reduce over both axes and return a scalar
                To retain the old behavior, pass axis=0 (or do not pass axis).

        skipna : bool, default True
            Exclude NA/null values. If an entire row/column is NA, the result
            will be NA.
        ddof : int, default 1
            Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
            where N represents the number of elements.
        numeric_only : bool, default False
            Include only float, int, boolean columns. Not implemented for Series.
        **kwargs :
            Additional keywords passed.

        Returns
        -------
        scalar or Series (if level specified)
            Unbiased variance over requested axis.

        See Also
        --------
        numpy.var : Equivalent function in NumPy.
        Series.std : Returns the standard deviation of the Series.
        DataFrame.var : Returns the variance of the DataFrame.
        DataFrame.std : Return standard deviation of the values over
            the requested axis.

        Examples
        --------
        >>> df = pd.DataFrame(
        ...     {
        ...         "person_id": [0, 1, 2, 3],
        ...         "age": [21, 25, 62, 43],
        ...         "height": [1.61, 1.87, 1.49, 2.01],
        ...     }
        ... ).set_index("person_id")
        >>> df
                   age  height
        person_id
        0           21    1.61
        1           25    1.87
        2           62    1.49
        3           43    2.01

        >>> df.var()
        age       352.916667
        height      0.056367
        dtype: float64

        Alternatively, ``ddof=0`` can be set to normalize by N instead of N-1:

        >>> df.var(ddof=0)
        age       264.687500
        height      0.042275
        dtype: float64
        r  )rO   r  r  s         r   r  z
Series.varC   s<    \ {
%
 
 
 
 	
r   stdc                0    t          j        | f||||d|S )a8  
        Return sample standard deviation.

        Normalized by N-1 by default. This can be changed using the ddof argument.

        Parameters
        ----------
        axis : {index (0)}
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            Exclude NA/null values. If Series is NA, the result
            will be NA.
        ddof : int, default 1
            Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
            where N represents the number of elements.
        numeric_only : bool, default False
            Not implemented for Series.
        **kwargs :
            Additional keywords have no effect but might be accepted
            for compatibility with NumPy.

        Returns
        -------
        scalar
            Standard deviation over all values in the Series.

        See Also
        --------
        numpy.std : Compute the standard deviation along the specified axis.
        Series.var : Return unbiased variance over requested axis.
        Series.sem : Return unbiased standard error of the mean over requested axis.
        Series.mean : Return the mean of the values over the requested axis.
        Series.median : Return the median of the values over the requested axis.
        Series.mode : Return the mode(s) of the Series.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.std()
        1.0

        Alternatively, ``ddof=0`` can be set to normalize by $N$ instead of $N-1$:

        >>> s.std(ddof=0)
        0.816496580927726
        r  )rO   r  r  s         r   r  z
Series.std   s<    n {
%
 
 
 
 	
r   skewc                .    t          j        | f|||d|S )a@  
        Return unbiased skew over requested axis.

        Normalized by N-1.

        Parameters
        ----------
        axis : {index (0)}
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Unused.
        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar
            Unbiased skew of the Series.

        See Also
        --------

        Series.var : Return unbiased variance over requested axis.
        Series.std : Return unbiased standard deviation over requested axis.

        Examples
        --------
        >>> s = pd.Series([1, 2, 3])
        >>> s.skew()
        0.0
        r  )rO   r  r  s        r   r  zSeries.skew   s5    R |
F
 
IO
 
 	
r   kurtc                .    t          j        | f|||d|S )a_  
        Return unbiased kurtosis over requested axis.

        Kurtosis obtained using Fisher's definition of
        kurtosis (kurtosis of normal == 0.0). Normalized by N-1.

        Parameters
        ----------
        axis : {index (0)}
            Axis for the function to be applied on.
            For `Series` this parameter is unused and defaults to 0.

            For DataFrames, specifying ``axis=None`` will apply the aggregation
            across both axes.

            .. versionadded:: 2.0.0

        skipna : bool, default True
            Exclude NA/null values when computing the result.
        numeric_only : bool, default False
            Include only float, int, boolean columns.

        **kwargs
            Additional keyword arguments to be passed to the function.

        Returns
        -------
        scalar
            Unbiased kurtosis.

        See Also
        --------
        Series.skew : Return unbiased skew over requested axis.
        Series.var : Return unbiased variance over requested axis.
        Series.std : Return unbiased standard deviation over requested axis.

        Examples
        --------
        >>> s = pd.Series([1, 2, 2, 3], index=["cat", "dog", "dog", "mouse"])
        >>> s
        cat    1
        dog    2
        dog    2
        mouse  3
        dtype: int64
        >>> s.kurt()
        1.5
        r  )rO   r  r  s        r   r  zSeries.kurt!  s5    p |
F
 
IO
 
 	
r   c                0    t          j        | ||g|R i |S )a  
        Return cumulative minimum over a Series.

        Returns a Series of the same size containing the cumulative
        minimum.

        Parameters
        ----------
        axis : {0 or 'index'}, default 0
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            If the entire series is NA, the result will be NA.
        *args, **kwargs
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Series
            Return cumulative minimum of the Series.

        See Also
        --------
        core.window.expanding.Expanding.min : Similar functionality
            but ignores ``NaN`` values.
        Series.min : Return the minimum value of the Series.
        Series.cummax : Return cumulative maximum.
        Series.cumsum : Return cumulative sum.
        Series.cumprod : Return cumulative product.

        Examples
        --------
        >>> s = pd.Series([2, np.nan, 5, -1, 0])
        >>> s
        0    2.0
        1    NaN
        2    5.0
        3   -1.0
        4    0.0
        dtype: float64

        By default, NA values are ignored.

        >>> s.cummin()
        0    2.0
        1    NaN
        2    2.0
        3   -1.0
        4   -1.0
        dtype: float64

        To include NA values in the operation, use ``skipna=False``

        >>> s.cummin(skipna=False)
        0    2.0
        1    NaN
        2    NaN
        3    NaN
        4    NaN
        dtype: float64
        )rO   cumminr   r   r  r
  r  s        r   r  zSeries.cumminF!  )    | ~dD&B4BBB6BBBr   c                0    t          j        | ||g|R i |S )a  
        Return cumulative maximum over a Series.

        Returns a Series of the same size containing the cumulative
        maximum.

        Parameters
        ----------
        axis : {0 or 'index'}, default 0
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            Exclude NA/null values. If the series is NA, the result is NA.
        *args, **kwargs
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Series
            Return cumulative maximum of Series.

        See Also
        --------
        core.window.expanding.Expanding.max : Similar functionality
            but ignores ``NaN`` values.
        Series.max : Return the maximum over a Series.
        Series.cummin : Return cumulative minimum.
        Series.cumsum : Return cumulative sum.
        Series.cumprod : Return cumulative product.

        Examples
        --------
        >>> s = pd.Series([2, np.nan, 5, -1, 0])
        >>> s
        0    2.0
        1    NaN
        2    5.0
        3   -1.0
        4    0.0
        dtype: float64

        By default, NA values are ignored.

        >>> s.cummax()
        0    2.0
        1    NaN
        2    5.0
        3    5.0
        4    5.0
        dtype: float64

        To include NA values in the operation, use ``skipna=False``

        >>> s.cummax(skipna=False)
        0    2.0
        1    NaN
        2    NaN
        3    NaN
        4    NaN
        dtype: float64
        )rO   cummaxr  s        r   r  zSeries.cummax!  r  r   c                0    t          j        | ||g|R i |S )a  
        Return cumulative sum over a Series.

        Returns a Series of the same size containing the cumulative sum.

        Parameters
        ----------
        axis : {0 or 'index'}, default 0
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            Exclude NA/null values. If entire series is NA, the result will be NA.
        *args, **kwargs
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Series
            Return cumulative sum of Series.

        See Also
        --------
        core.window.expanding.Expanding.sum : Similar functionality
            but ignores ``NaN`` values.
        Series.sum : Return the sum over Series.
        Series.cummax : Return cumulative maximum.
        Series.cummin : Return cumulative minimum.
        Series.cumprod : Return cumulative product.

        Examples
        --------
        >>> s = pd.Series([2, np.nan, 5, -1, 0])
        >>> s
        0    2.0
        1    NaN
        2    5.0
        3   -1.0
        4    0.0
        dtype: float64

        By default, NA values are ignored.

        >>> s.cumsum()
        0    2.0
        1    NaN
        2    7.0
        3    6.0
        4    6.0
        dtype: float64

        To include NA values in the operation, use ``skipna=False``

        >>> s.cumsum(skipna=False)
        0    2.0
        1    NaN
        2    NaN
        3    NaN
        4    NaN
        dtype: float64
        )rO   cumsumr  s        r   r  zSeries.cumsum!  s)    z ~dD&B4BBB6BBBr   c                0    t          j        | ||g|R i |S )a,  
        Return cumulative product over a Series.

        Returns a Series of the same size containing the cumulative
        product.

        Parameters
        ----------
        axis : {0 or 'index'}, default 0
            This parameter is unused and defaults to 0.
        skipna : bool, default True
            Exclude NA/null values. If entire Series is NA, the result will be NA.
        *args, **kwargs
            Additional keywords have no effect but might be accepted for
            compatibility with NumPy.

        Returns
        -------
        Series
            Return cumulative product of Series.

        See Also
        --------
        core.window.expanding.Expanding.prod : Similar functionality
            but ignores ``NaN`` values.
        Series.prod : Return the product over Series.
        Series.cummax : Return cumulative maximum.
        Series.cummin : Return cumulative minimum.
        Series.cumsum : Return cumulative sum.

        Examples
        --------
        >>> s = pd.Series([2, np.nan, 5, -1, 0])
        >>> s
        0    2.0
        1    NaN
        2    5.0
        3   -1.0
        4    0.0
        dtype: float64

        By default, NA values are ignored.

        >>> s.cumprod()
        0     2.0
        1     NaN
        2    10.0
        3   -10.0
        4    -0.0
        dtype: float64

        To include NA values in the operation, use ``skipna=False``

        >>> s.cumprod(skipna=False)
        0    2.0
        1    NaN
        2    NaN
        3    NaN
        4    NaN
        dtype: float64
        )rO   cumprodr  s        r   r  zSeries.cumprod"  s)    | tT6CDCCCFCCCr   )NNNNN)r   r   r   r   r   r   )NN)r   r   r   r   r   r   r   )r   r   )r   r   )r   r   )r   rq   )r   r   )r  r   r   r   )r   re   )r   rG   )r   r  )r   r  r   r   r   r   )r   r  r3  )r  r  r   rm   r   r   )r  r   r   rm   r   r   )r2  r   )r>  rA  r   r   )F)rE  r   )r   r   )rE  r   r   r   )rn  ro  r   r   r   r   ).)ry  rv   rw  rz  r   rw   r   rz  rx  r   r   r   )ry  rv   rw  r~  r   rw   r   rz  rx  r   r   r   )ry  rv   rw  r   r   rw   r   r~  rx  r   r   r   )ry  r  rw  r   r   rw   r   r   rx  r   r   r  )r   r   )r  r   r  r   r  r  r  r   r   r   r  r   r  r  r  r  r   r   )r  r  r  r   r  r  r  r   r   r   r  r   r  r  r  r  r   r   )
Nr  NTTFFFNN)r  r  r  r   r  r  r  r   r   r   r  r   r   r   r   r   r  r  r  r  r   r  )
r  r   r  r   r   r   r  r  r   r   )
r  r  r  r   r   r   r  r  r   r   )
r  r  r  r   r   r   r  r  r   r  )Nr  TN)r   r  )r   rT   )r  r  r   ry   )r  r  r   r  )r   r   r   r   )r   r  r   r   )r   r   r   r   )NNTTTTT)ry  r  r  r   r  r   r  r   r  r   r  r   r   r   )T)r  r   r   r   )r   ri   )r  ro   r   rz  r  r   r   r   )r  ro   r   r~  r  r   r   r   )r  ro   r   r   r  r   r   r  )r  )r  ro   r   r   )r   T)r   rl   r  r   r   r   )r  r  r   r   )..)r  r  r  r}   r   r  )r  r  r  r}   r   r   )r  r   r  r}   r   r!  )r#  r$  )r+  N)r,  r   rt  rn   r-  r  r   r  )NrG  )r,  r   r-  r  r?  r  r   r  )rG  )rC  r  r   r   )rF  r  r   r  )r,  rJ  r   rK  )rQ  N)r  r]  r^  r_  r`  ra  r   rb  )rf  r   r  r   r   r   )rG  FFrX  )r,  r   rl  rl   rm  r   rn  r   ro  r   r   rp  )r,  rs  rt  ru  rv  rw  r   r   )r   r   )r,  r  r   r   )r   rl   r  r  r   rz  rR  r   r  rz   r  r   r2  r   r   r   )r   rl   r  r  r   r~  rR  r   r  rz   r  r   r2  r   r   r   )r   rl   r  r  r   r   rR  r   r  rz   r  r   r2  r   r   r  )r   rl   r  r  r   r   rR  r   r  rz   r  r   r2  r  r   r  )r   rl   ry  rv   r  r  r   r~  rR  r   r  rz   r  r   r  r   r2  ru   r   r   )r   rl   ry  rv   r  r  r   rz  rR  r   r  rz   r  r   r  r   r2  ru   r   r   )r   rl   ry  rv   r  r  r   r   rR  r   r  rz   r  r   r  r   r2  ru   r   r  )r   rl   ry  r  r  r  r   r   rR  r   r  rz   r  r   r  r   r2  r  r   r  )r   r  NN)
r   rl   rR  r   r  r   r  r   r   r   )r  r  )r  r  r  r  r   r   )r  rw   r  rw   r   r  r   r   )r  r  r   r   )r  r   r   r   )re  NT)ry  rv   rv  rw  r  r   r   r   )NNN)rt  r  r  r  r  r  r   r   )r   r   )Nr   )r   rl   )rt  rf   r   rl   r   rp  )rq  )rt  rf   r
  r  r  r  r   rp  )r?  r   r>  r  r   r   )r   r  r   r  r   r  r   r~  ry  r  r  rt   r   r  )r   r  r   r  r   r  r   rz  ry  r  r  rt   r   r   )r   r  r   r  r   r  r   r   ry  r  r  rt   r   r  )r   rl   r   r  r   r   )r   r  rt  r  r   r  ry  r  rv  r  r   r  r   r   )
r  r  r   rl   r   r  r   r~  r   r   )
r  r  r   rl   r   r  r   rz  r   r   )
r  r  r   rl   r   r  r   r   r   r  )r  r  r   rl   r   r  r  r  ry  r  r   r~  r  rt   r   r   )r  r  r   rl   r   r  r  r  ry  r  r   rz  r  rt   r   r   )r  r  r   rl   r   r  r  r  ry  r  r   r   r  rt   r   r  )r  r   r   r   )NNNNT)r  r   r  r  r  r  r  r  r  r   r   r   )TF)r   r   r   r   r   r  )r#  )r$  r%  r   r   )r+  r,  r   r   )
r   rl   r   rz  rJ  rK  r  r   r   r   )
r   rl   r   r~  rJ  rK  r  r   r   r   )
r   rl   r   r   rJ  rK  r  r   r   r  )rQ  rR  rJ  rS  r   r  r   r   )rQ  r  r   r  r   r   )rn  r   )r,  r   r   r   )r4  r|  r   r   r,  rJ  r   r}  )NNr   )ry  r  rv  r  r   rl   r   r   )r   rl   r   r   )r   r   r   rl   r  r   r&  r   )r   rl   r  r   r  r   r   r   )r   FT)r   TF)r   r  r  r   r&  r   )NTFr   )r   r  r  r   r&  r   r  r  )r   r  r  r   r&  r   r   r   )NTrG  F)r   r  r  r   r?  r  r&  r   )r   rl   r  r   r   r   )r   
__module____qualname____doc___typrT   rG   r   r   _HANDLED_TYPES__annotations__r   rO   _internal_names_set
_accessorsr@   rd  _hidden_attrs	frozenset__pandas_priority__propertyhasnansfgetr   r   r   r   r   r   r   r   r   r   r   setterr   r	  r   r   rL   r  r  r   r  r%  r5  r1  r-  r0  r*  r^  rY  r\  rb  rX  rm  rr  r   r}  r   r  r  r  r    r   r  r  r   r  r  r  classmethodr  r  r	   r_   _shared_doc_kwargsr  r  r  r   r  r   r  r  r  r  r>  rB  rE  rI  rM  rY  r\  re  rk  rr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  _agg_see_also_doc_agg_examples_docr  r  r  r  r  r  r  r  r   r	  rw  r  r  r  r"  r*  rC  r;   r!   rF  r=   rI  r  rV  rZ  r[  r   	_AXIS_LENr\  r]  r   AxisPropertyr   rE   rb   r   rR   r   rJ   r   r   plottingPlotAccessorr^  rK   r   rI   r_  rH   r   hist_serieshistrl  rq  rs  ro  r{  rg  r  r  rC   make_flex_docr  r  r  r  r  r  r  r  subtractr  r  multiplyr  r  divdivider  rdivr  r  r  r  r  r  r  r  r  rh  r{  r  r  r  r  r  r  r  r  r  r  r  kurtosisproductr  r  r  r  __classcell__)r  s   @r   r   r      s"        j jX D^RZ8NOOO#9I$$$$"F+g.II///J(7+@@99R==P   h"'&.  G
  " V! V! V! V! V!r SW/ / / / /f' ' ' 'B    X& & &    X/ / / & & & X&    X&    X" 0 0 0 X0d 
[1 1 1 [1 (+ (+ X(+T + + X+B % % % X% Xd &.//   X 0/    GK@ @ @ @ @J    X    & & & & &.# .# .#`
 
 
* * * *(Y Y Y Y'" '" '" '" '"RC+ C+ C+ C+J. . . .	% 	% 	% 	%) ) ) )@ @ @ @% % % % %<8
 8
 8
 8
 8
t     #"%!$     X   
 "%!$     X    !$     X $(U n!&U U U U U Ut- - - -   #&""     X 
 #&""     X $#fe_;  
 37#'##X X X X Xt   14     X 
 14     X 
 14     X $#fe_=  
 #15L
 L
 L
 L
 L
`> > > >@   *    X ,/===== X= 9=/( /( /( /( /( /(b ), )8 )8 )8 )8 )8V ; ; ; [;z     Xjl	
 l	
n n^ Xl9%(::;;##%<%<%<9  
 #'
 
 
 
  <;_n nf
@S S S S*D, D, D, D, D,LA  A  A  A  A  A F  "%      X "%TW     X "%sQT     X !"` ` ` ` ` ` ` `DN> N> N> N> N>`:  :  :  :  : x;  ;  ;  ;  ; z8
 8
 8
 8
 8
t EH    X  03    X  58/2    X 58/7>< >< >< >< ><F %."&	_
 _
 _
 _
 _
H #'	0 0 0 0 0dS, S, S, S, S,j+8 +8 +8 +8 +8ZN0 N0 N0 N0`  - - - *0%)	\V \V \V \V \VBD D D D D   !2e
 e
 e
 e
 e
 e
 e
V '+	f
 f
 f
 f
 f
PKC KC KC KCZZ< Z< Z< Z<~  +."%"% 
 
 
 
 
 X
  +."% 
 
 
 
 
 X
  +."% 
 
 
 
 
 X
 +/$"("#'@ @ @ @ @ @D  +."%"      X  +."%"%"      X  +."%"      X" #'+/$"(#"#'O
 O
 O
 O
 O
 O
 O
 O
f $58 58 58 58 58p CJiF iF iF iF iFX CJhG hG hG hG hGV [ [ [ [ [z3 3 3 3jBR BR BR BR BRL &*	86 86 86 86 86~ 48.2"&	l
 l
 l
 l
 l
\     	  	 ,T T T T Tl C /0Q Q Q Q Ql !#|
 ,4| | | | | ||J J J J"     ,/	  %(!!	 	 	 	 	 X	  ,/	  %("%!!	 	 	 	 	 X	 ,0h: !%(^"&h: h: h: h: h: h: h: h:\ %(^7> 7> 7> 7> 7> 7> 7> 7>z j
 !'+%(^"$( j
 j
 j
 j
 j
 j
 j
 j
X  .1 %(     X  .1 %("%     X  .1 %(     X .1^K
 n%(^K
 K
 K
 K
 K
 K
 K
 K
Z  ),
 '*),!!
 
 
 
 
 X
  ),
 '*),!"%!
 
 
 
 
 X
  ),
 '*),!!
 
 
 
 
 X
 )-h
 '+)-"%h
 h
 h
 h
 h
 h
 h
 h
T@ @ @ @ @ @F  $"#*. y
 y
 y
 y
 y
v6 6 6 6 6pM
 M
 M
 M
f BH	Y Y Y Y Yvv v v vr," ," ," ,"^ 	S/8999          :9 , , , , , ,^ 	S09:::! ! ! ! ! ;:!  "%       X         X !"\ \ \ \ \ \F "&18%(^	M M M M Mb  %(^: : : : :| 8?iL????L!!I$%%%%%(/O////#J#&) ) )E\ (5-
(
(C	$6	7	7B
(5-
.
.C8FFO899DXh//FXh//F8FL))D ?&D
N N NN N NA A A    4 !  !  !  !  !D) ) ) )V 04ST # # # # # #@ ##'D
 D
 D
 D
 D
L Xch//00
 
 
 
 10

B
 B
 B
 B
 B
H Xch//00
 
 
 
 10

C
 C
 C
 C
 C
J Xch//00
 
 
 
 10

<
 <
 <
 <
 <
| Xc1122
 
 
 
 32

 Xcx0011
 
 
 
 21

 HXc1122
 
 
 
 32
 ##'H
 H
 H
 H
 H
T HXc1122
 
 
 
 32

=
 =
 =
 =
 =
~ CFXc
H5566
 
 
 
 76

 DXc
H5566
 
 
 
 76

 XcX6677
 
 
 
 87

<
 <
 <
 <
 <
| Xc1122
 
 
 
 32

 Xcx0011
 
 
 
 21

 Xc1122
 
 
 
 32

 Xc(3344
 
 
 
 54

 Xc	84455
 
 
 
 65
 "* * * * * *` A
 A
 A
 A
 A
 A
F $#N&PUVVV 	e
 e
 e
 e
 WVe
N $#N&PUVVV "	D
 D
 D
 D
 WVD
L $#N&PUVVV "	D
 D
 D
 D
 WVD
L $#N&PUVVV !"b
 b
 b
 b
 WVb
H $#N&PVWWW !"R
 R
 R
 R
 XWR
h $#N&PVWWW "	3
 3
 3
 3
 XW3
j $#fXH  
 "	N
 N
 N
 N
 N
` $#N&PUVVV !"8
 8
 8
 8
 WV8
t $#N&PUVVV !"T
 T
 T
 T
 WVT
l $#N&PUVVV !"=
 =
 =
 =
 WV=
~ $#N&PVWWW "	*
 *
 *
 *
 XW*
X $#N&PVWWW "	9
 9
 9
 9
 XW9
v HG>C >C >C >C >C@>C >C >C >C >C@=C =C =C =C =C~>D >D >D >D >D >D >D >D >Dr   )r  
__future__r   collections.abcr   r   r   r   r   r  r  rT  textwrapr	   typingr
   r   r   r   r   r   r   r   numpyr   pandas._libsr   r   r   pandas._libs.libr   pandas.compatr   pandas.compat._constantsr   r   pandas.compat._optionalr   pandas.compat.numpyr   ru  pandas.errorsr   r   r   pandas.errors.cowr   r   pandas.util._decoratorsr   r    r!   r"   pandas.util._exceptionsr#   pandas.util._validatorsr$   r%   r&   pandas.core.dtypes.astyper'   pandas.core.dtypes.castr(   r)   r*   r+   r,   r-   pandas.core.dtypes.commonr.   r/   r0   r1   r2   r3   r4   r5   r6   pandas.core.dtypes.dtypesr7   pandas.core.dtypes.genericr8   r9   pandas.core.dtypes.inferencer:   pandas.core.dtypes.missingr;   r<   r=   r>   pandas.corer?   r@   rA   r   rB   rC   rD   pandas.core.accessorrE   pandas.core.applyrF   pandas.core.arraysrG   pandas.core.arrays.arrowrH   rI   pandas.core.arrays.categoricalrJ   pandas.core.arrays.sparserK   pandas.core.constructionrL   r5  rM   rN   pandas.core.genericrO   pandas.core.indexersrP   rQ   pandas.core.indexes.accessorsrR   pandas.core.indexes.apirS   rT   rU   rV   rW   rX   rY   pandas.core.indexes.basecoreindexesr   pandas.core.indexes.multirZ   pandas.core.indexingr[   r\   pandas.core.internalsr]   pandas.core.methodsr^   pandas.core.shared_docsr_   pandas.core.sortingr`   ra   pandas.core.strings.accessorrb   pandas.core.tools.datetimesrc   pandas.io.formats.formatioformatsformatr  pandas.io.formats.inford   pandas.plottingr   pandas._libs.internalsre   pandas._typingrf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r  r   __all__r  rd  r   rq  r   r   <module>rP     s/	    # " " " " "                   



                                     
 . - - - - - 2 2 2 2 2 2        ? > > > > > . . . . . .         
                                 5 4 4 4 4 4               
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
             5 4 4 4 4 4                           * ) ) ) ) ) ) ) ) ) ) ) - - - - - -        ? > > > > > 4 4 4 4 4 4         
 ( ' ' ' ' '        I H H H H H                  ) ( ( ( ( ( ( ( ( ( ( ( 6 6 6 6 6 6        5 4 4 4 4 4 ' ' ' ' ' ' 0 0 0 0 0 0        7 6 6 6 6 6 3 3 3 3 3 3 & & & & & & & & & & & &          ':666666" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "H ,+++++999999* 'FA  8 HYED YED YED YED YEDT YED YED YED YED YEDr   