
    Pi!y                       d Z ddlmZ ddlmZ ddlmZ ddlZddlm	Z	m
Z
mZmZ ddlZddlZddlmZ ddl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mZ ddl m!Z! ddl"m#Z#m$Z$ ddl%m&c m'Z( ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 e	rddl6m7Z7m8Z8m9Z9m:Z: ddl;m<Z<m=Z=m>Z> ddl?m@Z@mAZA edddddddddd	dTd*            ZBedddddddddd	dUd-            ZBedddddddddd	dVd0            ZBeddddddddd1dWd3            ZBedddddddddd	dXd5            ZB ed6          dd7d8dddd8ejC        ejC        d	dYd9            ZBdZd>ZDd[dBZEd\dDZFd]dFZGd^dGZHd_dIZId`dMZJdadNZKdbdQZLdcdddSZMdS )ez
Concat routines.
    )annotations)abc)pairwiseN)TYPE_CHECKINGLiteralcastoverload)lib)Pandas4Warning)
set_module)find_stack_level)is_bool	is_scalar)concat_compat)ABCDataFrame	ABCSeries)isna)factorize_from_iterablefactorize_from_iterables)Index
MultiIndexall_indexes_samedefault_indexensure_indexget_objs_combined_axisget_unanimous_namesunion_indexes)DatetimeIndex)concatenate_managers)CallableHashableIterableMapping)AxisAxisInt	HashableT)	DataFrameSeries.)	axisjoinignore_indexkeyslevelsnamesverify_integritysortcopyobjs3Iterable[DataFrame] | Mapping[HashableT, DataFrame]r)   Literal[0, 'index']r*   strr+   boolr,   Iterable[Hashable] | Noner.   list[HashableT] | Noner/   r0   r1   bool | lib.NoDefaultreturnr'   c       	            d S N 
r2   r)   r*   r+   r,   r-   r.   r/   r0   r1   s
             n/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/core/reshape/concat.pyconcatr@   M   	         -Iterable[Series] | Mapping[HashableT, Series]r(   c       	            d S r<   r=   r>   s
             r?   r@   r@   ]   s	     SrB   EIterable[Series | DataFrame] | Mapping[HashableT, Series | DataFrame]DataFrame | Seriesc       	            d S r<   r=   r>   s
             r?   r@   r@   m   	     rB   )r*   r+   r,   r-   r.   r/   r0   r1   Literal[1, 'columns']c       	            d S r<   r=   r>   s
             r?   r@   r@   }   rA   rB   r$   c       	            d S r<   r=   r>   s
             r?   r@   r@      rH   rB   pandasouterFc       	        d   |r|t          d|d          |	t          j        ur(t          j        dt
          t                                 |dk    rd}
n|dk    rd	}
nt          d
          t          | |          \  } }}|t          j        u r|dk    rd | D             }nd | D             }|
srt          d |D                       sYt          d t          |          D                       s3t          d t          |          D                       r|d         j        rd}n1t          |          st          d| d          t          |          }t          | |||||
          \  }} |j        dk    rddlm}  |j        |          }d}d	}n.|                    |          }d	}d}|                    |          }t)          |          dk    rt+          | |||          } |}|rd|z
  nd}|pt-          |dd          }t/          | ||||
||||||          }|t          j        u r|dk    rd | D             }nd | D             }t1          |d          }|dk    r|j        n|j        }|                    |          s*d}t          j        |t
          t                                 |S )a  
    Concatenate pandas objects along a particular axis.

    Allows optional set logic along the other axes.

    Can also add a layer of hierarchical indexing on the concatenation axis,
    which may be useful if the labels are the same (or overlapping) on
    the passed axis number.

    Parameters
    ----------
    objs : an iterable or mapping of Series or DataFrame objects
        If a mapping is passed, the keys will be used as the `keys`
        argument, unless it is passed, in which case the values will be
        selected (see below). Any None objects will be dropped silently unless
        they are all None in which case a ValueError will be raised.
    axis : {0/'index', 1/'columns'}, default 0
        The axis to concatenate along.
    join : {'inner', 'outer'}, default 'outer'
        How to handle indexes on other axis (or axes).
    ignore_index : bool, default False
        If True, do not use the index values along the concatenation axis. The
        resulting axis will be labeled 0, ..., n - 1. This is useful if you are
        concatenating objects where the concatenation axis does not have
        meaningful indexing information. Note the index values on the other
        axes are still respected in the join.
    keys : sequence, default None
        If multiple levels passed, should contain tuples. Construct
        hierarchical index using the passed keys as the outermost level.
    levels : list of sequences, default None
        Specific levels (unique values) to use for constructing a
        MultiIndex. Otherwise they will be inferred from the keys.
    names : list, default None
        Names for the levels in the resulting hierarchical index.
    verify_integrity : bool, default False
        Check whether the new concatenated axis contains duplicates. This can
        be very expensive relative to the actual data concatenation.
    sort : bool, default False
        Sort non-concatenation axis. One exception to this is when the
        non-concatenation axis is a DatetimeIndex and join='outer' and the axis is
        not already aligned. In that case, the non-concatenation axis is always
        sorted lexicographically.
    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
    -------
    object, type of objs
        When concatenating all ``Series`` along the index (axis=0), a
        ``Series`` is returned. When ``objs`` contains at least one
        ``DataFrame``, a ``DataFrame`` is returned. When concatenating along
        the columns (axis=1), a ``DataFrame`` is returned.

    See Also
    --------
    DataFrame.join : Join DataFrames using indexes.
    DataFrame.merge : Merge DataFrames by indexes or columns.

    Notes
    -----
    The keys, levels, and names arguments are all optional.

    A walkthrough of how this method fits in with other tools for combining
    pandas objects can be found `here
    <https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html>`__.

    It is not recommended to build DataFrames by adding single rows in a
    for loop. Build a list of rows and make a DataFrame in a single concat.

    Examples
    --------
    Combine two ``Series``.

    >>> s1 = pd.Series(["a", "b"])
    >>> s2 = pd.Series(["c", "d"])
    >>> pd.concat([s1, s2])
    0    a
    1    b
    0    c
    1    d
    dtype: str

    Clear the existing index and reset it in the result
    by setting the ``ignore_index`` option to ``True``.

    >>> pd.concat([s1, s2], ignore_index=True)
    0    a
    1    b
    2    c
    3    d
    dtype: str

    Add a hierarchical index at the outermost level of
    the data with the ``keys`` option.

    >>> pd.concat([s1, s2], keys=["s1", "s2"])
    s1  0    a
        1    b
    s2  0    c
        1    d
    dtype: str

    Label the index keys you create with the ``names`` option.

    >>> pd.concat([s1, s2], keys=["s1", "s2"], names=["Series name", "Row ID"])
    Series name  Row ID
    s1           0         a
                 1         b
    s2           0         c
                 1         d
    dtype: str

    Combine two ``DataFrame`` objects with identical columns.

    >>> df1 = pd.DataFrame([["a", 1], ["b", 2]], columns=["letter", "number"])
    >>> df1
      letter  number
    0      a       1
    1      b       2
    >>> df2 = pd.DataFrame([["c", 3], ["d", 4]], columns=["letter", "number"])
    >>> df2
      letter  number
    0      c       3
    1      d       4
    >>> pd.concat([df1, df2])
      letter  number
    0      a       1
    1      b       2
    0      c       3
    1      d       4

    Combine ``DataFrame`` objects with overlapping columns
    and return everything. Columns outside the intersection will
    be filled with ``NaN`` values.

    >>> df3 = pd.DataFrame(
    ...     [["c", 3, "cat"], ["d", 4, "dog"]], columns=["letter", "number", "animal"]
    ... )
    >>> df3
      letter  number animal
    0      c       3    cat
    1      d       4    dog
    >>> pd.concat([df1, df3], sort=False)
      letter  number animal
    0      a       1    NaN
    1      b       2    NaN
    0      c       3    cat
    1      d       4    dog

    Combine ``DataFrame`` objects with overlapping columns
    and return only those that are shared by passing ``inner`` to
    the ``join`` keyword argument.

    >>> pd.concat([df1, df3], join="inner")
      letter  number
    0      a       1
    1      b       2
    0      c       3
    1      d       4

    Combine ``DataFrame`` objects horizontally along the x axis by
    passing in ``axis=1``.

    >>> df4 = pd.DataFrame(
    ...     [["bird", "polly"], ["monkey", "george"]], columns=["animal", "name"]
    ... )
    >>> pd.concat([df1, df4], axis=1)
      letter  number  animal    name
    0      a       1    bird   polly
    1      b       2  monkey  george

    Prevent the result from including duplicate index values with the
    ``verify_integrity`` option.

    >>> df5 = pd.DataFrame([1], index=["a"])
    >>> df5
       0
    a  1
    >>> df6 = pd.DataFrame([2], index=["a"])
    >>> df6
       0
    a  2
    >>> pd.concat([df5, df6], verify_integrity=True)
    Traceback (most recent call last):
        ...
    ValueError: Indexes have overlapping values: ['a']

    Append a single row to the end of a ``DataFrame`` object.

    >>> df7 = pd.DataFrame({"a": 1, "b": 2}, index=[0])
    >>> df7
        a   b
    0   1   2
    >>> new_row = pd.Series({"a": 3, "b": 4})
    >>> new_row
    a    3
    b    4
    dtype: int64
    >>> pd.concat([df7, new_row.to_frame().T], ignore_index=True)
        a   b
    0   1   2
    1   3   4
    NzCannot set ignore_index=z) and specify keys. Either should be used.zThe copy keyword is deprecated and will be removed in a future version. Copy-on-Write is active in pandas since 3.0 which utilizes a lazy copy mechanism that defers copies until necessary. Use .copy() to make an eager copy if necessary.)
stacklevelrM   FinnerTz?Only can inner (intersect) or outer (union) join the other axisr   c                p    g | ]3}t          |t                    r|j        nt          |j        g          4S r=   
isinstancer   columnsr   name.0objs     r?   
<listcomp>zconcat.<locals>.<listcomp>  I         *#|<<S%
BSBS  rB   c                    g | ]	}|j         
S r=   indexrV   s     r?   rY   zconcat.<locals>.<listcomp>      999Ssy999rB   c              3  B   K   | ]}t          |t                     V  d S r<   )rS   r   )rW   r]   s     r?   	<genexpr>zconcat.<locals>.<genexpr>  s/      UUEz%777UUUUUUrB   c              3  $   K   | ]\  }}||u V  d S r<   r=   rW   prevcurrs      r?   r`   zconcat.<locals>.<genexpr>  s*      LLJD$44<LLLLLLrB   c              3  j   K   | ].\  }}|j         |j         |d          |d         k    o|j        V  /dS )r   N)emptyis_monotonic_increasingrb   s      r?   r`   zconcat.<locals>.<genexpr>  sc        "d: /3jHQ'HD,H     rB   rf   z0The 'sort' keyword only accepts boolean values; z was passed.   )r'   r.   c                p    g | ]3}t          |t                    r|j        nt          |j        g          4S r=   rR   rV   s     r?   rY   zconcat.<locals>.<listcomp>  rZ   rB   c                    g | ]	}|j         
S r=   r\   rV   s     r?   rY   zconcat.<locals>.<listcomp>  r^   rB   )r0   a  Sorting by default when concatenating all DatetimeIndex is deprecated.  In the future, pandas will respect the default of `sort=False`. Specify `sort=True` or `sort=False` to silence this message. If you see this warnings when not directly calling concat, report a bug to pandas.)
ValueErrorr
   
no_defaultwarningswarnr   r   _clean_keys_and_objsanyallr   rh   r   r6   _get_sample_objectndimrL   r'   _get_axis_number_get_block_manager_axislen_sanitize_mixed_ndimgetattr_get_resultr   r]   rT   equals)r2   r)   r*   r+   r,   r-   r.   r/   r0   r1   	intersectndimsnon_concat_axissampler'   bm_axisis_frame	is_series	orig_axisresultno_sort_result_indexorigmsgs                          r?   r@   r@      s   F  
(R,RRR
 
 	
 3>!!: '))	
 	
 	
 	
 w					M
 
 	
 -T488D$s~199   OO
 :9D999O 	UU_UUUUU	 LL(?2K2KLLLLL	
   &.&?&?    	 $B'?	 DT]] QtQQQ
 
 	
 Dzz &dE4	RRLFD {a$$$$$$,),T22		))$//	 0099 5zzA~~#D&,HHI")1w;;D1WT7D11E F s~>>   OO
 :9D999O,_5III(A~~v||6>#**400 	NC  M#~:J:L:LMMMMMrB   list[Series | DataFrame]r   Series | DataFramer%   c                   g }d}|j         }| D ]}|j         }||k    rn||dz
  k    rt          d          t          |dd           }	d}
|s|	`|dk    r|	d}	d}
n|		d}
|}	|dz  }|                    |d          }t	          |t
                    r|
rt          |	|	dz   d          |_        n|                    |	|id          }|                    |           |S )Nr   ri   z>cannot concatenate unaligned mixed dimensional NDFrame objectsrU   FT)r1   )	rt   rl   ry   _constructorrS   r   rangerT   append)r2   r   r+   r)   new_objscurrent_columnmax_ndimrX   rt   rU   rename_columnss              r?   rx   rx     s7    HN{H    x8X\!!P  
 3--D"N Ct|199 | )- \%)N)D"a'N))#E)::c<00 ;^ ;"'dQh":":CK))4+E)BBOrB   r   r   r|   c                Z   |rt          d| d                   }|dk    rt          j        |           }|j        }d | D             }t	          |d          }|rt          t          |                    }nt          | ||||||	          }t          |j	                  
                    ||          }|                    ||j                  }||_        |                    t          j        | |           d	          S t#          t%          |                     }|j        }t)          | | d                             d          ||
          }t          | ||||||	          } |||d          }||_        |                    t          j        | |           d	          S t          d| d                   }g }t/          | |||||	|
|||
  
        }| D ]y}i }t%          |          D ]I\  }}||k    r|j        d|z
           }|                    |          s|                    |          ||<   J|                    |j	        |f           zt7          |||d          }|                    ||j                  }|                    t          j        | |           d	          S )Nr(   r   c                    g | ]	}|j         
S r=   )_values)rW   sers     r?   rY   z_get_result.<locals>.<listcomp>B  s    000CCK000rB   )r)   r\   axes)
input_objsr2   r@   )methodr)   r|   r0   F)r]   r1   r'   ri   )concat_axisr1   )r   comconsensus_name_attrr   r   r   rw   _get_concat_axis_seriestype_mgr
from_array_constructor_from_mgrr   _name__finalize__typesSimpleNamespacedict	enumerate_constructor_expanddimr   rv   rT   new_axesr{   get_indexerr   r   ) r2   r   r   r+   r|   r0   r,   r-   r/   r.   r)   r   rU   consarrsres	new_indexmgrr   datar]   rT   dfmgrs_indexersresult_axesrX   indexersax
new_labels
obj_labelsnew_dataouts                                    r?   rz   rz   )  s1   "  ^
hQ(( a<<*400D&D004000D1---C #0S#:#:		3 $ 	 v{##..s).DDC11#CH1EEFFL&&%DAAA( '    	$((D 0D*!W44Q77#	  E .lGT6;KU G d%e444B BJ??%DAAA( #    k47++
 
  	7 	7CH"+K"8"8 	F 	FJ== !Xa"f-
!((44 F#-#9#9*#E#EHRL  #(H!56666';G%
 
 
 **8(-*HH!T===h   
 
 	
rB   list[Index]c
           
     ^    	 	 f
dt          d          D             S )z1Return the new [index, column] result for concat.c                   
 g | ]I}|k    rt          	          n+t          		d                              |          
          JS )r   r   )_get_concat_axis_dataframer   rv   )rW   ir)   r   r+   r|   r,   r-   r.   r2   r0   r/   s     r?   rY   znew_axes.<locals>.<listcomp>  s       "  << 	#	
 	
 	
 $a0033	
 
 
  rB      )r   )
r2   r   r|   r0   r,   r.   r)   r-   r/   r+   s
   ``````````r?   r   r     sl                " q#   rB   r   c                   |rt          t          |                     S |dk    rd | D             }|!|t          d          t          |          }nt	          ||||          }|rE|j        s>||                                                                         }	t          d|	           |S |dgt          |           z  }
d}d}t          |           D ]S\  }}|j	        dk    r%t          dt          |          j         d	          |j        |j        |
|<   d
}I||
|<   |dz  }T|rt          |
          S t          t          |                     S t          |                              |          S )z<Return result concat axis when concatenating Series objects.r   c                    g | ]	}|j         
S r=   r\   rW   xs     r?   rY   z+_get_concat_axis_series.<locals>.<listcomp>  s    )))q17)))rB   N+levels supported only when keys is not None!Indexes have overlapping values: Fri   z6Cannot concatenate type 'Series' with object of type ''T)r   rw   rl   _concat_indexes_make_concat_multiindex	is_unique
duplicateduniquer   rt   	TypeErrorr   __name__rU   r   r   	set_names)r2   r+   r   r,   r-   r/   r.   indexesr   overlapresult_namesnum	has_namesr   r   s                  r?   r   r     s     #3SYY'''	A))D)))<! !NOOO)'22KK1'4OOK 	LK$9 	L!+"8"8":":;BBDDGJJJKKK	(,vD		'9	dOO 	 	DAqv{{;'+Aww'7; ; ;   v!"#&Q 		"%Qq 	,&&& T+++D!!++E222rB   c                   fd| D             }|r&t          t          d |D                                 S t          |          }|!|t          d          t	          |          }	nt          ||||          }	|rE|	j        s>|	|	                                                                         }
t          d|
           |	S )z?Return result concat axis when concatenating DataFrame objects.c              3  2   K   | ]}|j                  V  d S r<   r   )rW   r   r)   s     r?   r`   z-_get_concat_axis_dataframe.<locals>.<genexpr>  s)      ..A16$<......rB   c              3  4   K   | ]}t          |          V  d S r<   rw   )rW   r   s     r?   r`   z-_get_concat_axis_dataframe.<locals>.<genexpr>  s(       = =AQ = = = = = =rB   Nr   r   )	r   sumlistrl   r   r   r   r   r   )r2   r)   r+   r,   r.   r-   r/   indexes_genr   r   r   s    `         r?   r   r     s     /......K $S = = = = ===>>>{##|JKKK%g..-gtVUKK H 5 Hk44667>>@@FWFFGGGrB   7tuple[list[Series | DataFrame], Index | None, set[int]]c                    t           t          j                  r%|                                 } fd|D              nyt           t          t
          f          st                     r%t          dt                     j	         d          t           t          j
                  st                      t                     dk    rt          d          |tt          |t                    st          |          }t          |          t                     k    r0t          dt          |           dt                      d	          g }g }t                      }t!                     D ]\  }}|t          |t          t
          f          rE|                    |           |                    |           |                    |j                   id
t          |           d}t          |          |5t          |          t          |          k     r|                    |          }t          |          dk    rt          d          |||fS )aU  
    Returns
    -------
    clean_objs : list[Series | DataFrame]
        List of DataFrame and Series with Nones removed.
    keys : Index | None
        None if keys was None
        Index if objs was a Mapping or keys was not None. Filtered where objs was None.
    ndim : set[int]
        Unique .ndim attribute of obj encountered.
    Nc                     g | ]
}|         S r=   r=   )rW   kr2   s     r?   rY   z(_clean_keys_and_objs.<locals>.<listcomp>  s    &&&AQ&&&rB   zTfirst argument must be an iterable of pandas objects, you passed an object of type ""r   zNo objects to concatenatezThe length of the keys (z7) must match the length of the objects to concatenate ()z#cannot concatenate object of type 'z+'; only Series and DataFrame objs are validzAll objects passed were None)rS   r   r#   r,   r   r   r   r   r   r   Sizedr   rw   rl   r   setr   r   addrt   take)r2   r,   key_indices
clean_objsr}   r   rX   r   s   `       r?   rp   rp     sw    $$$ 
<99;;D&&&&&&&	D9l3	4	4 	$ M6:4jj6IM M M
 
 	
 ci(( Dzz
4yyA~~4555$&& 	;;Dt99D		!!J3t99 J J=@YYJ J J   KJEEED// ! !3;i677 		!q!!!c"""IIch;d3ii ; ; ;  C.. C,,s4yy88yy%%
:!7888tU""rB   r}   set[int]3tuple[Series | DataFrame, list[Series | DataFrame]]c                @   t          |          dk    r:t          |          }| D ]'}|j        |k    rt          |j                  r|| fc S (nH|F|D|B|s@|                                dk    rd | D             }n| }t          |          r
|d         |fS | d         | fS )Nri   r   c                :    g | ]}t          |j                  |S r=   )r   shaperV   s     r?   rY   z&_get_sample_object.<locals>.<listcomp>c  s%    AAA3#ci..A3AAArB   r   )rw   maxrt   r   r   pop)	r2   r}   r,   r.   r-   r|   r   rX   non_emptiess	            r?   rs   rs   O  s     5zzA~~u:: 	! 	!Cx8##CI#Dy   	! 
%-FN9N 99;;!AA$AAAKKK{ 	/q>;..7D=rB   c                H    | d                              | dd                    S )Nr   ri   )r   )r   s    r?   r   r   m  s"    1:WQRR[)))rB   r-   Nonec                f    | D ]-}|j         s$t          d|                                           .d S )NzLevel values not unique: )r   rl   tolist)r-   levels     r?   validate_unique_levelsr   q  sO     K K 	KIIIJJJ	KK KrB   r   c           
        |t          |d         t                    s|rt          |          dk    r_t          t	          |ddi          }|d gt          |          z  }|t          |          \  }}ndd |D             }t          |           nH|g}|d g}|#t          |                                          g}nd |D             }t          |           t          |           sg }t	          ||d          D ]i\  }}g }	t          |t                    ri|                    |          rTd | D             }
|                    t          j        t          j        t          |                    |
                     t	          || d          D ]\  }}t!          |          t!          |          z  ||k    z  }|                                st%          d	| d
|           t          j        |          d         d         }|	                    t          j        |t          |                               |                    t          j        |	                     kt+          |           }t          |t,                    r5|                    |j                   |                    |j                   n<t5          |          \  }}|                    |           |                    |           t          |          t          |          k    rt          |          }nRt          d | D                       dk    st7          d          t          |          t          t9          |            z   }t-          |||d          S | d         }t          |          }t          |           t          |          }t          |          }g }t	          ||d          D ]\  }}t          |          }|                    |          }|dk    }|                                rt%          d||                   |                    t          j        ||                     t          |t,                    rA|                    |j                   |                    fd|j        D                        nv|                    |                                           |                                                    |          }|                    t          j        |                     t          |          t          |          k     r|                    |j                   t-          |||d          S )Nr   ri   strictTc                ,    g | ]}t          |          S r=   r   r   s     r?   rY   z+_make_concat_multiindex.<locals>.<listcomp>      666!l1oo666rB   c                ,    g | ]}t          |          S r=   r   r   s     r?   rY   z+_make_concat_multiindex.<locals>.<listcomp>  r   rB   )r   c                ,    g | ]}t          |          S r=   r   rW   idxs     r?   rY   z+_make_concat_multiindex.<locals>.<listcomp>  s    444SC444rB   zKey z not in level c                    h | ]	}|j         
S r=   )nlevelsr   s     r?   	<setcomp>z*_make_concat_multiindex.<locals>.<setcomp>  s    777777rB   z@Cannot concat indices that do not have the same number of levelsF)r-   codesr.   r/   rf   z"Values not found in passed level: c              3  B   K   | ]}t          j        |          V  d S r<   )nptile)rW   labkpiecess     r?   r`   z*_make_concat_multiindex.<locals>.<genexpr>  s/      JJ3g..JJJJJJrB   ) rS   tuplerw   r   zipr   r   r   r   r   r   r{   r   r  repeataranger   rq   rl   nonzeroconcatenater   r   extendr-   r  r   AssertionErrorr   r   r  r.   )r   r,   r-   r.   zipped_
codes_listhlevelr   	to_concatlenskeyr]   maskr   concat_indexr  
categoriesr   n	new_names
new_levels	new_codeshlevel_indexmappedsingle_codesr  s                             @r?   r   r   w  s{   :d1gu55s6{{Qc4---..=FS[[(E>088IAvv66v666F"6****=FE>"4((//112FF66v666F"6***G$$ /


 !=== 	= 	=MFEI&%(( =V]]5-A-A =44G444!!")BIc&kk,B,BD"I"IJJJJ"%fgd"C"C"C ? ?JC KK$s))3ED88:: L()J)J)J5)J)JKKK
4((+A.A$$RYq#e**%=%=>>>>!!".";";<<<<&w// lJ// 	%MM,-...l01111 7 E EE:MM*%%%e$$$u::V$$KKEE 77w77788A==$V  
 KK$':G'D"E"EEE55
 
 
 	
 
IIA'llG UIfJ I VVD999 
/ 
/#F++""<00|88:: 	K\$5GKK   	61--....)Z(( 9)*+++JJJJ)/JJJJJJJ)**,,--- ''))55i@@w77888
9~~J''))))e   rB   )r2   r3   r)   r4   r*   r5   r+   r6   r,   r7   r.   r8   r/   r6   r0   r6   r1   r9   r:   r'   )r2   rC   r)   r4   r*   r5   r+   r6   r,   r7   r.   r8   r/   r6   r0   r6   r1   r9   r:   r(   )r2   rE   r)   r4   r*   r5   r+   r6   r,   r7   r.   r8   r/   r6   r0   r6   r1   r9   r:   rF   )r2   rE   r)   rI   r*   r5   r+   r6   r,   r7   r.   r8   r/   r6   r0   r6   r1   r9   r:   r'   )r2   rE   r)   r$   r*   r5   r+   r6   r,   r7   r.   r8   r/   r6   r0   r6   r1   r9   r:   rF   )r2   rE   r)   r$   r*   r5   r+   r6   r,   r7   r.   r8   r/   r6   r0   r9   r1   r9   r:   rF   )
r2   r   r   r   r+   r6   r)   r%   r:   r   )r2   r   r   r6   r   r%   r+   r6   r|   r6   r0   r9   r,   r7   r/   r6   r.   r8   r)   r%   )r2   r   r   r%   r|   r6   r0   r9   r,   r7   r.   r8   r)   r%   r/   r6   r+   r6   r:   r   )r2   r   r+   r6   r   r%   r,   r7   r/   r6   r.   r8   r:   r   )r2   r   r)   r%   r+   r6   r,   r7   r.   r8   r/   r6   r:   r   )r2   rE   r:   r   )r2   r   r}   r   r|   r6   r:   r   )r:   r   )r-   r   r:   r   )NN)r:   r   )N__doc__
__future__r   collectionsr   	itertoolsr   r   typingr   r   r   r	   rn   numpyr  pandas._libsr
   pandas.errorsr   pandas.util._decoratorsr   pandas.util._exceptionsr   pandas.core.dtypes.commonr   r   pandas.core.dtypes.concatr   pandas.core.dtypes.genericr   r   pandas.core.dtypes.missingr   pandas.core.arrays.categoricalr   r   pandas.core.commoncorecommonr   pandas.core.indexes.apir   r   r   r   r   r   r   r   pandas.core.indexes.datetimesr   pandas.core.internalsr   collections.abcr    r!   r"   r#   pandas._typingr$   r%   r&   rL   r'   r(   r@   rm   rx   rz   r   r   r   rp   rs   r   r   r   r=   rB   r?   <module>r8     s|    # " " " " "                                    ( ( ( ( ( ( . . . . . . 4 4 4 4 4 4        4 3 3 3 3 3        , + + + + +        !                	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 8 7 7 7 7 7 6 6 6 6 6 6                             
 !$&)$' !$     
 
 !$&)$' !$     
 
 !$&)$' !$     
 

 &)$' !$     
 
 &)$' !$     
 H &*$("!$!$V V V V V Vr
/ / / /do
 o
 o
 o
d   D-3 -3 -3 -3`   >@# @# @# @#F   <* * * *K K K Ko o o o o o orB   