+
    xȇiQ                      R t ^ RIHt ^ RIHtHt ^ RIt^ RIHt ^ RI	t	^ RI
HtHtHtHt ^ RIt^ RIt^ RIt^ RIHtHtHtHt ^ RIHt ^ RIHtHtHtH t H!t!H"t"H#t#H$t$ ^ R	I%H&t& ^ R
I'H(t(H)t) ^ RI*H+t+ ^ RI,H-t- ^ RI.H/t/ ^ RI0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t= ^ RI>H?t?H@t@ ^ RIAHBtBHCtC ^ RIDHEtEHFtF ^ RIGHHtHHItIHJtJHKtKHLtL ^ RIMHNu HOtP ^ RIQHRtRHStSHTtT ^ RIUHVtV ^ RIWHNu HXtY ^ RIZH[t[H\t\ ^ RI]H^t^ ^ RI_H`t`Hata ]'       d   ^ RIGHbtb ^ RIcHdtd ^ RIQHete ^ RIfHgtg ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]P                  ]EP                   ]EP                  ]EP                  ]EP                  /t]EP
                  ]P                  Jdd   ]EP                  ! ]EP
                  4      EP                  ^8X  d   ]P                  ]]EP
                  &   M]P                  ]]EP
                  &   ]EP                  ]P                  Jdd   ]EP                  ! ]EP                  4      EP                  ^8X  d   ]P                  ]]EP                  &   M]P                  ]]EP                  &   ]EP                  ]T]J]C3t])! R4      RRRRRRRRO]EP                  RR3R R  ll4       tRPR! R" lltR# R$ lt])! R4      RQR% R& ll4       t])! R4      RRR' R( ll4       t ! R) R*4      tRSR+ R, lltRSR- R. lltR/ R0 lt ! R1 R2]4      tR3 R4 lt ! R5 R6]4      tR7 R8 ltR9 R: ltR; R< ltRTR= R> lltRUR? R@ lltRA RB ltRC RD ltRE RF ltRG RH ltRI RJ ltRK RL ltRM RN ltR# )Vz
SQL-style merge routines
)annotations)HashableSequenceN)partial)TYPE_CHECKINGLiteralcastfinal)	Timedelta	hashtablejoinlib)is_range_indexer)AnyArrayLike	ArrayLike
IndexLabelJoinHowMergeHowShapeSuffixesnpt)
MergeError)cache_readonly
set_module)find_stack_level)ExtensionDtype)find_common_type)ensure_int64ensure_objectis_boolis_bool_dtypeis_float_dtype
is_integeris_integer_dtypeis_list_like	is_numberis_numeric_dtypeis_object_dtypeis_string_dtypeneeds_i8_conversion)CategoricalDtypeDatetimeTZDtype)ABCDataFrame	ABCSeries)isnana_value_for_dtype)
ArrowDtypeCategoricalIndex
MultiIndexSeries)ArrowExtensionArrayBaseMaskedArrayExtensionArray)StringDtype)ensure_wrapped_if_datetimelikeextract_array)default_index)get_group_indexis_int64_overflow_possible)	DataFrame)groupby)DatetimeArray)
FrozenListpandasinnerFc               P    V ^8  d   Qh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/# )   leftDataFrame | Seriesrighthowr   on IndexLabel | AnyArrayLike | Noneleft_onright_on
left_indexboolright_indexsortsuffixesr   copyzbool | lib.NoDefault	indicator
str | boolvalidate
str | Nonereturnr>    )formats   "i/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/core/reshape/merge.py__annotate__r\      s     } }
}} 
} 	)	}
 .} /} } } } } } } } }    c                    \        V 4      pV P                  V
4       \        V4      pVR8X  d   \        VVVVVVVVV	VVR7      # \        VVVVVVVVVV	VVR7      pVP	                  4       # )a  
Merge DataFrame or named Series objects with a database-style join.

A named Series object is treated as a DataFrame with a single named column.

The join is done on columns or indexes. If joining columns on
columns, the DataFrame indexes *will be ignored*. Otherwise if joining indexes
on indexes or indexes on a column or columns, the index will be passed on.
When performing a cross merge, no column specifications to merge on are
allowed.

.. warning::

    If both key columns contain rows where the key is a null value, those
    rows will be matched against each other. This is different from usual SQL
    join behaviour and can lead to unexpected results.

Parameters
----------
left : DataFrame or named Series
    First pandas object to merge.
right : DataFrame or named Series
    Second pandas object to merge.
how : {'left', 'right', 'outer', 'inner', 'cross', 'left_anti', 'right_anti},
    default 'inner'
    Type of merge to be performed.

    * left: use only keys from left frame, similar to a SQL left outer join;
      preserve key order.
    * right: use only keys from right frame, similar to a SQL right outer join;
      preserve key order.
    * outer: use union of keys from both frames, similar to a SQL full outer
      join; sort keys lexicographically.
    * inner: use intersection of keys from both frames, similar to a SQL inner
      join; preserve the order of the left keys.
    * cross: creates the cartesian product from both frames, preserves the order
      of the left keys.
    * left_anti: use only keys from left frame that are not in right frame, similar
      to SQL left anti join; preserve key order.
    * right_anti: use only keys from right frame that are not in left frame, similar
      to SQL right anti join; preserve key order.
on : Hashable or a sequence of the previous
    Column or index level names to join on. These must be found in both
    DataFrames. If `on` is None and not merging on indexes then this defaults
    to the intersection of the columns in both DataFrames.
left_on : Hashable or a sequence of the previous, or array-like
    Column or index level names to join on in the left DataFrame. Can also
    be an array or list of arrays of the length of the left DataFrame.
    These arrays are treated as if they are columns.
right_on : Hashable or a sequence of the previous, or array-like
    Column or index level names to join on in the right DataFrame. Can also
    be an array or list of arrays of the length of the right DataFrame.
    These arrays are treated as if they are columns.
left_index : bool, default False
    Use the index from the left DataFrame as the join key(s). If it is a
    MultiIndex, the number of keys in the other DataFrame (either the index
    or a number of columns) must match the number of levels.
right_index : bool, default False
    Use the index from the right DataFrame as the join key. Same caveats as
    left_index.
sort : bool, default False
    Sort the join keys lexicographically in the result DataFrame. If False,
    the order of the join keys depends on the join type (how keyword).
suffixes : list-like, default is ("_x", "_y")
    A length-2 sequence where each element is optionally a string
    indicating the suffix to add to overlapping column names in
    `left` and `right` respectively. Pass a value of `None` instead
    of a string to indicate that the column name from `left` or
    `right` should be left as-is, with no suffix. At least one of the
    values must not be None.
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.

indicator : bool or str, default False
    If True, adds a column to the output DataFrame called "_merge" with
    information on the source of each row. The column can be given a different
    name by providing a string argument. The column will have a Categorical
    type with the value of "left_only" for observations whose merge key only
    appears in the left DataFrame, "right_only" for observations
    whose merge key only appears in the right DataFrame, and "both"
    if the observation's merge key is found in both DataFrames.

validate : str, optional
    If specified, checks if merge is of specified type.

    * "one_to_one" or "1:1": check if merge keys are unique in both
      left and right datasets.
    * "one_to_many" or "1:m": check if merge keys are unique in left
      dataset.
    * "many_to_one" or "m:1": check if merge keys are unique in right
      dataset.
    * "many_to_many" or "m:m": allowed, but does not result in checks.

Returns
-------
DataFrame
    A DataFrame of the two merged objects.

See Also
--------
merge_ordered : Merge with optional filling/interpolation.
merge_asof : Merge on nearest keys.
DataFrame.join : Similar method using indices.

Examples
--------
>>> df1 = pd.DataFrame(
...     {"lkey": ["foo", "bar", "baz", "foo"], "value": [1, 2, 3, 5]}
... )
>>> df2 = pd.DataFrame(
...     {"rkey": ["foo", "bar", "baz", "foo"], "value": [5, 6, 7, 8]}
... )
>>> df1
    lkey value
0   foo      1
1   bar      2
2   baz      3
3   foo      5
>>> df2
    rkey value
0   foo      5
1   bar      6
2   baz      7
3   foo      8

Merge df1 and df2 on the lkey and rkey columns. The value columns have
the default suffixes, _x and _y, appended.

>>> df1.merge(df2, left_on="lkey", right_on="rkey")
  lkey  value_x rkey  value_y
0  foo        1  foo        5
1  foo        1  foo        8
2  bar        2  bar        6
3  baz        3  baz        7
4  foo        5  foo        5
5  foo        5  foo        8

Merge DataFrames df1 and df2 with specified left and right suffixes
appended to any overlapping columns.

>>> df1.merge(df2, left_on="lkey", right_on="rkey", suffixes=("_left", "_right"))
  lkey  value_left rkey  value_right
0  foo           1  foo            5
1  foo           1  foo            8
2  bar           2  bar            6
3  baz           3  baz            7
4  foo           5  foo            5
5  foo           5  foo            8

Merge DataFrames df1 and df2, but raise an exception if the DataFrames have
any overlapping columns.

>>> df1.merge(df2, left_on="lkey", right_on="rkey", suffixes=(False, False))
Traceback (most recent call last):
...
ValueError: columns overlap but no suffix specified:
    Index(['value'], dtype='str')

>>> df1 = pd.DataFrame({"a": ["foo", "bar"], "b": [1, 2]})
>>> df2 = pd.DataFrame({"a": ["foo", "baz"], "c": [3, 4]})
>>> df1
      a  b
0   foo  1
1   bar  2
>>> df2
      a  c
0   foo  3
1   baz  4

>>> df1.merge(df2, how="inner", on="a")
      a  b  c
0   foo  1  3

>>> df1.merge(df2, how="left", on="a")
      a  b  c
0   foo  1  3.0
1   bar  2  NaN

>>> df1 = pd.DataFrame({"left": ["foo", "bar"]})
>>> df2 = pd.DataFrame({"right": [7, 8]})
>>> df1
    left
0   foo
1   bar
>>> df2
    right
0   7
1   8

>>> df1.merge(df2, how="cross")
   left  right
0   foo      7
1   foo      8
2   bar      7
3   bar      8
cross)	rJ   rL   rM   rN   rP   rQ   rR   rT   rV   
rI   rJ   rL   rM   rN   rP   rQ   rR   rT   rV   )_validate_operand_check_copy_deprecation_cross_merge_MergeOperation
get_result)rF   rH   rI   rJ   rL   rM   rN   rP   rQ   rR   rS   rT   rV   left_dfright_dfops   &&&&&&&&&&&&&   r[   mergeri      s    |  %G  & 'H
g~!#
 	
 !#
 }}r]   c               H    V ^8  d   QhRRRRRRRRRRRR	R
R	RR	RRRRRRRR/# )rE   rF   r>   rH   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   r   rT   rU   rV   rW   rX   rY   )rZ   s   "r[   r\   r\     s     2 2
22 	)2 .	2
 /2 2 2 2 2 2 2 2r]   c                   V'       g   V'       g   Vf	   Vf   Ve   \        R4      hR\        P                  ! 4        2pV P                  ! R/ V^/B p VP                  ! R/ V^/B pV.;r4\	        V VRVVVVVVVV	V
R7      pW V# )z$
See merge.__doc__ with how='cross'
zMCan not pass on, right_on, left_on or set right_index=True or left_index=True_cross_rC   r`   rY   )r   uuiduuid4assignri   )rF   rH   rJ   rL   rM   rN   rP   rQ   rR   rT   rV   	cross_colress   &&&&&&&&&&&  r[   rc   rc     s    $ 	>
 	

 $**,(I;;()Q(DLL*Iq>*E#$G
C 	Jr]   c                    V ^8  d   QhRRRR/# )rE   rF   rG   rH   rY   )rZ   s   "r[   r\   r\     s     6 6 6);6r]   c           
       a . p\        V \        \        34      '       g   V .p VP                  V RR7      pRp\        ;QJ d    V3R lV  4       F  '       d   K   RM	  RM! V3R lV  4       4      '       d   SP                  V RR7      pVP
                  P                  VP                  4       FL  w  rxVf   Sp	M# SP                  VP                  V,          4      p	V! W4      pW}V &   VP%                  V4       KN  	  ^ RIHp V! VRR7      pVP                  V^ ,          P                  R7      pW3#   \         d    TP                  P                  4       p
T
SP                   Uu. uF  q\        T
4      9  g   K  TNK  	  Mu upi up,           pTP                  TR7      p\        \!        T4      4      Tn        TP%                  T4        EK%  i ; i)	z
groupby & merge; we are always performing a left-by type operation

Parameters
----------
by: field to group
left: DataFrame
right: DataFrame
merge_pieces: function for merging
FrQ   Nc              3  @   <"   T F  qSP                   9   x  K  	  R # 5iNcolumns).0itemrH   s   & r[   	<genexpr>%_groupby_and_merge.<locals>.<genexpr>  s     
0RT5== Rs   Trw   concat)ignore_index)
isinstancelisttupler?   all_grouperget_iterator_selected_objtakeindicesKeyErrorrx   tolistsetreindexrangelenindexappendpandas.core.reshape.concatr~   )byrF   rH   merge_piecespieceslbyrbykeylhsrhslcolsrcolsmergedr~   results   &&f&            r[   _groupby_and_merger     s    Fb4-((T
,,r,
&CCGC s
0R
0sss
0R
000mmBUm+LL--c.?.?@;C	jjS!12 c' r
f+ A2 2F.F^^F1I$5$5^6F;/  **,5==P=aSZ<O=PPT2$S[1f%s%   ="D664G*F
 F
AGGc               <    V ^8  d   QhRRRRRRRRRRRR	R
RRRRR/	# )rE   rF   rG   rH   rJ   IndexLabel | NonerL   rM   fill_methodrW   rR   r   rI   r   rX   r>   rY   )rZ   s   "r[   r\   r\     sm     L L
LL 	L 	L
  L L L 
L Lr]   c
                6  aaaaaa	a R VV	VVVV3R lloVe   Ve   \        R4      hVeq   \        V\        4      '       d   V.p\        V4      P	                  V P
                  4      p
\        V
4      ^ 8w  d   \        V
 R24      h\        WPVV3R l4      w  rV# Veq   \        V\        4      '       d   V.p\        V4      P	                  VP
                  4      p
\        V
4      ^ 8w  d   \        V
 R24      h\        WaV V3R l4      w  rV# S! W4      pV# )ar  
Perform a merge for ordered data with optional filling/interpolation.

Designed for ordered data like time series data. Optionally
perform group-wise merge (see examples).

Parameters
----------
left : DataFrame or named Series
    First pandas object to merge.
right : DataFrame or named Series
    Second pandas object to merge.
on : Hashable or a sequence of the previous
    Field names to join on. Must be found in both DataFrames.
left_on : Hashable or a sequence of the previous, or array-like
    Field names to join on in left DataFrame. Can be a vector or list of
    vectors of the length of the DataFrame to use a particular vector as
    the join key instead of columns.
right_on : Hashable or a sequence of the previous, or array-like
    Field names to join on in right DataFrame or vector/list of vectors per
    left_on docs.
left_by : column name or list of column names
    Group left DataFrame by group columns and merge piece by piece with
    right DataFrame. Must be None if either left or right are a Series.
right_by : column name or list of column names
    Group right DataFrame by group columns and merge piece by piece with
    left DataFrame. Must be None if either left or right are a Series.
fill_method : {'ffill', None}, default None
    Interpolation method for data.
suffixes : list-like, default is ("_x", "_y")
    A length-2 sequence where each element is optionally a string
    indicating the suffix to add to overlapping column names in
    `left` and `right` respectively. Pass a value of `None` instead
    of a string to indicate that the column name from `left` or
    `right` should be left as-is, with no suffix. At least one of the
    values must not be None.

how : {'left', 'right', 'outer', 'inner'}, default 'outer'
    * left: use only keys from left frame (SQL: left outer join)
    * right: use only keys from right frame (SQL: right outer join)
    * outer: use union of keys from both frames (SQL: full outer join)
    * inner: use intersection of keys from both frames (SQL: inner join).

Returns
-------
DataFrame
    The merged DataFrame output type will be the same as
    'left', if it is a subclass of DataFrame.

See Also
--------
merge : Merge with a database-style join.
merge_asof : Merge on nearest keys.

Examples
--------
>>> from pandas import merge_ordered
>>> df1 = pd.DataFrame(
...     {
...         "key": ["a", "c", "e", "a", "c", "e"],
...         "lvalue": [1, 2, 3, 1, 2, 3],
...         "group": ["a", "a", "a", "b", "b", "b"],
...     }
... )
>>> df1
  key  lvalue group
0   a       1     a
1   c       2     a
2   e       3     a
3   a       1     b
4   c       2     b
5   e       3     b

>>> df2 = pd.DataFrame({"key": ["b", "c", "d"], "rvalue": [1, 2, 3]})
>>> df2
  key  rvalue
0   b       1
1   c       2
2   d       3

>>> merge_ordered(df1, df2, fill_method="ffill", left_by="group")
  key  lvalue group  rvalue
0   a       1     a     NaN
1   b       1     a     1.0
2   c       2     a     2.0
3   d       2     a     3.0
4   e       3     a     3.0
5   a       1     b     NaN
6   b       1     b     1.0
7   c       2     b     2.0
8   d       2     b     3.0
9   e       3     b     3.0
c                   V ^8  d   QhRR/# rE   rX   r>   rY   )rZ   s   "r[   r\   #merge_ordered.<locals>.__annotate__k  s       r]   c                J   < \        V VSSSSSSR 7      pVP                  4       # ))rJ   rL   rM   rR   r   rI   )_OrderedMergere   )	xyrh   r   rI   rL   rJ   rM   rR   s	   && r[   _mergermerge_ordered.<locals>._mergerk  s3    #	
 }}r]   z*Can only group either left or right framesz not found in left columnsc                   < S! W4      # rv   rY   r   r   r   s   &&r[   <lambda>merge_ordered.<locals>.<lambda>  s
    'RS-r]   z not found in right columnsc                   < S! W4      # rv   rY   r   s   &&r[   r   r     s	    r]   )	
ValueErrorr   strr   
differencerx   r   r   r   )rF   rH   rJ   rL   rM   left_byright_byr   rR   rI   checkr   _r   s   &&fff&&fff   @r[   merge_orderedr      s   V  x3EFFgs##iGG''5u:?eW$>?@@&we=WX	 M 
	h$$ zHH((7u:?eW$?@AA&T#=
	
 M %Mr]   c               H    V ^8  d   QhRRRRRRRRRRRR	R
R	RRRRRR	RRRR/# )rE   rF   rG   rH   rJ   r   rL   rM   rN   rO   rP   rR   r   	tolerancezint | datetime.timedelta | Noneallow_exact_matches	directionr   rX   r>   rY   )rZ   s   "r[   r\   r\     s     U U
UU 	U 	U
  U U U U /U U U Ur]   c                V    \        V VVVVVVVVV	V
RVVVR7      pVP                  4       # )aX!  
Perform a merge by key distance.

This is similar to a left-join except that we match on nearest
key rather than equal keys. Both DataFrames must be first sorted by
the merge key in ascending order before calling this function.
Sorting by any additional 'by' grouping columns is not required.

For each row in the left DataFrame:

  - A "backward" search selects the last row in the right DataFrame whose
    'on' key is less than or equal to the left's key.

  - A "forward" search selects the first row in the right DataFrame whose
    'on' key is greater than or equal to the left's key.

  - A "nearest" search selects the row in the right DataFrame whose 'on'
    key is closest in absolute distance to the left's key.

Optionally match on equivalent keys with 'by' before searching with 'on'.

Parameters
----------
left : DataFrame or named Series
    First pandas object to merge.
right : DataFrame or named Series
    Second pandas object to merge.
on : label
    Field name to join on. Must be found in both DataFrames.
    The data MUST be in ascending order. Furthermore this must be
    a numeric column, such as datetimelike, integer, or float. ``on``
    or ``left_on`` / ``right_on`` must be given.
left_on : label
    Field name to join on in left DataFrame. If specified, sort the left
    DataFrame by this column in ascending order before merging.
right_on : label
    Field name to join on in right DataFrame. If specified, sort the right
    DataFrame by this column in ascending order before merging.
left_index : bool
    Use the index of the left DataFrame as the join key.
right_index : bool
    Use the index of the right DataFrame as the join key.
by : column name or list of column names
    Match on these columns before performing merge operation. It is not required
    to sort by these columns.
left_by : column name
    Field names to match on in the left DataFrame.
right_by : column name
    Field names to match on in the right DataFrame.
suffixes : 2-length sequence (tuple, list, ...)
    Suffix to apply to overlapping column names in the left and right
    side, respectively.
tolerance : int or timedelta, optional, default None
    Select asof tolerance within this range; must be compatible
    with the merge index.
allow_exact_matches : bool, default True

    - If True, allow matching with the same 'on' value
      (i.e. less-than-or-equal-to / greater-than-or-equal-to)
    - If False, don't match the same 'on' value
      (i.e., strictly less-than / strictly greater-than).

direction : 'backward' (default), 'forward', or 'nearest'
    Whether to search for prior, subsequent, or closest matches.

Returns
-------
DataFrame
    A DataFrame of the two merged objects, containing all rows from the
    left DataFrame and the nearest matches from the right DataFrame.

See Also
--------
merge : Merge with a database-style join.
merge_ordered : Merge with optional filling/interpolation.

Examples
--------
>>> left = pd.DataFrame({"a": [1, 5, 10], "left_val": ["a", "b", "c"]})
>>> left
    a left_val
0   1        a
1   5        b
2  10        c

>>> right = pd.DataFrame({"a": [1, 2, 3, 6, 7], "right_val": [1, 2, 3, 6, 7]})
>>> right
   a  right_val
0  1          1
1  2          2
2  3          3
3  6          6
4  7          7

>>> pd.merge_asof(left, right, on="a")
    a left_val  right_val
0   1        a          1
1   5        b          3
2  10        c          7

>>> pd.merge_asof(left, right, on="a", allow_exact_matches=False)
    a left_val  right_val
0   1        a        NaN
1   5        b        3.0
2  10        c        7.0

>>> pd.merge_asof(left, right, on="a", direction="forward")
    a left_val  right_val
0   1        a        1.0
1   5        b        6.0
2  10        c        NaN

>>> pd.merge_asof(left, right, on="a", direction="nearest")
    a left_val  right_val
0   1        a          1
1   5        b          6
2  10        c          7

We can use indexed DataFrames as well.

>>> left = pd.DataFrame({"left_val": ["a", "b", "c"]}, index=[1, 5, 10])
>>> left
   left_val
1         a
5         b
10        c

>>> right = pd.DataFrame({"right_val": [1, 2, 3, 6, 7]}, index=[1, 2, 3, 6, 7])
>>> right
   right_val
1          1
2          2
3          3
6          6
7          7

>>> pd.merge_asof(left, right, left_index=True, right_index=True)
   left_val  right_val
1         a          1
5         b          3
10        c          7

Here is a real-world times-series example

>>> quotes = pd.DataFrame(
...     {
...         "time": [
...             pd.Timestamp("2016-05-25 13:30:00.023"),
...             pd.Timestamp("2016-05-25 13:30:00.023"),
...             pd.Timestamp("2016-05-25 13:30:00.030"),
...             pd.Timestamp("2016-05-25 13:30:00.041"),
...             pd.Timestamp("2016-05-25 13:30:00.048"),
...             pd.Timestamp("2016-05-25 13:30:00.049"),
...             pd.Timestamp("2016-05-25 13:30:00.072"),
...             pd.Timestamp("2016-05-25 13:30:00.075"),
...         ],
...         "ticker": [
...             "GOOG",
...             "MSFT",
...             "MSFT",
...             "MSFT",
...             "GOOG",
...             "AAPL",
...             "GOOG",
...             "MSFT",
...         ],
...         "bid": [720.50, 51.95, 51.97, 51.99, 720.50, 97.99, 720.50, 52.01],
...         "ask": [720.93, 51.96, 51.98, 52.00, 720.93, 98.01, 720.88, 52.03],
...     }
... )
>>> quotes
                     time ticker     bid     ask
0 2016-05-25 13:30:00.023   GOOG  720.50  720.93
1 2016-05-25 13:30:00.023   MSFT   51.95   51.96
2 2016-05-25 13:30:00.030   MSFT   51.97   51.98
3 2016-05-25 13:30:00.041   MSFT   51.99   52.00
4 2016-05-25 13:30:00.048   GOOG  720.50  720.93
5 2016-05-25 13:30:00.049   AAPL   97.99   98.01
6 2016-05-25 13:30:00.072   GOOG  720.50  720.88
7 2016-05-25 13:30:00.075   MSFT   52.01   52.03

>>> trades = pd.DataFrame(
...     {
...         "time": [
...             pd.Timestamp("2016-05-25 13:30:00.023"),
...             pd.Timestamp("2016-05-25 13:30:00.038"),
...             pd.Timestamp("2016-05-25 13:30:00.048"),
...             pd.Timestamp("2016-05-25 13:30:00.048"),
...             pd.Timestamp("2016-05-25 13:30:00.048"),
...         ],
...         "ticker": ["MSFT", "MSFT", "GOOG", "GOOG", "AAPL"],
...         "price": [51.95, 51.95, 720.77, 720.92, 98.0],
...         "quantity": [75, 155, 100, 100, 100],
...     }
... )
>>> trades
                     time ticker   price  quantity
0 2016-05-25 13:30:00.023   MSFT   51.95        75
1 2016-05-25 13:30:00.038   MSFT   51.95       155
2 2016-05-25 13:30:00.048   GOOG  720.77       100
3 2016-05-25 13:30:00.048   GOOG  720.92       100
4 2016-05-25 13:30:00.048   AAPL   98.00       100

By default we are taking the asof of the quotes

>>> pd.merge_asof(trades, quotes, on="time", by="ticker")
                     time ticker   price  quantity     bid     ask
0 2016-05-25 13:30:00.023   MSFT   51.95        75   51.95   51.96
1 2016-05-25 13:30:00.038   MSFT   51.95       155   51.97   51.98
2 2016-05-25 13:30:00.048   GOOG  720.77       100  720.50  720.93
3 2016-05-25 13:30:00.048   GOOG  720.92       100  720.50  720.93
4 2016-05-25 13:30:00.048   AAPL   98.00       100     NaN     NaN

We only asof within 2ms between the quote time and the trade time

>>> pd.merge_asof(
...     trades, quotes, on="time", by="ticker", tolerance=pd.Timedelta("2ms")
... )
                     time ticker   price  quantity     bid     ask
0 2016-05-25 13:30:00.023   MSFT   51.95        75   51.95   51.96
1 2016-05-25 13:30:00.038   MSFT   51.95       155     NaN     NaN
2 2016-05-25 13:30:00.048   GOOG  720.77       100  720.50  720.93
3 2016-05-25 13:30:00.048   GOOG  720.92       100  720.50  720.93
4 2016-05-25 13:30:00.048   AAPL   98.00       100     NaN     NaN

We only asof within 10ms between the quote time and the trade time
and we exclude exact matches on time. However *prior* data will
propagate forward

>>> pd.merge_asof(
...     trades,
...     quotes,
...     on="time",
...     by="ticker",
...     tolerance=pd.Timedelta("10ms"),
...     allow_exact_matches=False,
... )
                     time ticker   price  quantity     bid     ask
0 2016-05-25 13:30:00.023   MSFT   51.95        75     NaN     NaN
1 2016-05-25 13:30:00.038   MSFT   51.95       155   51.97   51.98
2 2016-05-25 13:30:00.048   GOOG  720.77       100     NaN     NaN
3 2016-05-25 13:30:00.048   GOOG  720.92       100     NaN     NaN
4 2016-05-25 13:30:00.048   AAPL   98.00       100     NaN     NaN
asof)rJ   rL   rM   rN   rP   r   r   r   rR   rI   r   r   r   )
_AsOfMergere   )rF   rH   rJ   rL   rM   rN   rP   r   r   r   rR   r   r   r   rh   s   &&&&&&&&&&&&&& r[   
merge_asofr     sJ    J 
/
B" ==?r]   c                     ] tR tRt$ RtRt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&   RAR R llt]R R l4       t	R R  lt
R! R" lt]R# R$ l4       tR% R& lt]]R' R( l4       4       t]R) R* l4       t]R+ R, l4       t]R- R. l4       t]R/ R0 l4       tR1 R2 lt]R3 R4 l4       t]RBR5 R6 ll4       t]R7 R8 l4       t]R9 R: l4       t]R; R< l4       tR= t]R> R? l4       tR@tR# )Crd   i  z
Perform a database (SQL) merge operation between two DataFrame or Series
objects using either columns as keys or their row indexes
ri   JoinHow | Literal['asof']rI   r   rJ   z!Sequence[Hashable | AnyArrayLike]rL   rM   rO   rN   rP   rQ   r   rR   rU   rT   rW   rV   zlist[Hashable]
join_nameslist[ArrayLike]right_join_keysleft_join_keysNc               L    V ^8  d   Qh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/# )rE   rF   rG   rH   rI   4JoinHow | Literal['left_anti', 'right_anti', 'asof']rJ   rK   rL   rM   rN   rO   rP   rQ   rR   r   rT   rU   rV   rW   rX   NonerY   )rZ   s   "r[   r\   _MergeOperation.__annotate__  s     L2 L2 L2 "L2 B	L2
 -L2 2L2 3L2 L2 L2 L2 L2 L2 L2 
L2r]   c                	   \        V4      p\        V4      pV;V n        V n        V;V n        V n        V P                  V4      w  V n        V n        \        P                  ! V4      V n
        Wn        T	;'       g    VR 8H  V n        Wpn        Wn        Wn        \!        V4      '       g   \#        R\%        V4       24      h\!        V4      '       g   \#        R\%        V4       24      hVP&                  P(                  VP&                  P(                  8w  d=   RVP&                  P(                   RVP&                  P(                   R2p\+        V4      hV P-                  WV4      w  V n        V n        V P3                  4       w  V n        V n        V n        ppV'       d!   V P                  P;                  V4      V n        V'       d!   V P                  P;                  V4      V n        V P=                  V P4                  V P6                  4       V P?                  V P4                  4       V PA                  4        Ve   V PC                  V4       R# R# )outerz/left_index parameter must be of type bool, not z0right_index parameter must be of type bool, not z0Not allowed to merge between different levels. (z levels on the left, z on the right)N)"ra   rF   	orig_leftrH   
orig_right_validate_howrI   	anti_joincommaybe_make_listrJ   rR   rQ   rN   rP   rT   r   r   typerx   nlevelsr   _validate_left_right_onrL   rM   _get_merge_keysr   r   r   _drop_labels_or_levels_maybe_require_matching_dtypes_validate_tolerance_maybe_coerce_merge_keys_validate_validate_kwd)selfrF   rH   rI   rJ   rL   rM   rN   rP   rQ   rR   rT   rV   _left_rightmsg	left_drop
right_drops   &&&&&&&&&&&&&     r[   __init___MergeOperation.__init__  s    "$'"5)%**	DN'--
T_#'#5#5c#: $.%%b) **C7N	$&"z""A$zBRAST  {##B4CTBUV 
 ==  FNN$:$::MM))**?>>))*.: 
 S/!&*&B&B7&U#dm   "	
 O 		88CDI:::FDJ++D,?,?AUAUV  !4!45 	%%'
 ''1  r]   c                    V ^8  d   QhRRRR/# )rE   rI   r   rX   z&tuple[JoinHow | Literal['asof'], bool]rY   )rZ   s   "r[   r\   r     s      G	/r]   c                    0 RmpW9  d   \        RV R24      hRpVR9   d   VP                  R4      ^ ,          pRp\        \        \        R,          ,          V4      pW3# )	z`
Validate the 'how' parameter and return the actual join type and whether
this is an anti join.
r   'zZ' is not a valid Merge type: left, right, inner, outer, left_anti, right_anti, cross, asofFr   T>   r   rF   r_   rC   r   rH   	left_anti
right_anti>   r   r   )r   splitr   r   r   )r   rI   
merge_typer   s   &&  r[   r   _MergeOperation._validate_how  su    	

  C5 P Q  	--))C.#CI7WV_,c2~r]   c               $    V ^8  d   QhRRRRRR/# rE   r   r   r   rX   r   rY   )rZ   s   "r[   r\   r   .  s$      -@O	r]   c                	    R # rv   rY   )r   r   r   s   &&&r[   r   ._MergeOperation._maybe_require_matching_dtypes.  s     	r]   c                    V ^8  d   QhRRRR/# rE   r   r   rX   r   rY   )rZ   s   "r[   r\   r   4  s      / d r]   c                	    R # rv   rY   )r   r   s   &&r[   r   #_MergeOperation._validate_tolerance4  s    r]   c               (    V ^8  d   QhRRRRRRRR/# )rE   
join_indexr2   left_indexernpt.NDArray[np.intp] | Noneright_indexerrX   r>   rY   )rZ   s   "r[   r\   r   9  s2     3 33 23 3	3
 
3r]   c           	        V P                   R,          pV P                  R,          p\        V P                   P                  V P                  P                  V P                  4      w  rgVeY   \        V\        V4      4      '       g>   VP                  P                  VV^RRRR7      pVP                  WP                  R7      pWn        VeY   \        V\        V4      4      '       g>   VP                  P                  VV^RRRR7      p	VP                  WP                  R7      pYn        ^ RIHp
 Wdn        Wun        V
! WE.^R7      pV# )z/
reindex along index and concat along columns.
:NNNT)axis
only_slice
allow_dupsuse_na_proxy)axesr}   )r   )rF   rH   _items_overlap_with_suffix
_info_axisrR   r   r   _mgrreindex_indexer_constructor_from_mgrr   r   rB   r~   rx   )r   r   r   r   rF   rH   llabelsrlabelslmgrrmgrr~   r   s   &&&&        r[   _reindex_and_concat#_MergeOperation._reindex_and_concat8  s5    yy|

15II  $**"7"7
 #,<\3t9,U,U 99,,! - D --d-CD
$-=3u:.
 .
 ::--! . D //99/EE !A.r]   c                   V ^8  d   QhRR/# r   rY   )rZ   s   "r[   r\   r   n  s     
 
I 
r]   c                
   V P                   '       d4   V P                  V P                  V P                  4      w  V n        V n        V P	                  4       w  rpV P                  WV4      pV P                   '       d   V P                  V4      pV P                  WBV4       V P                  V4       VP                  \        P                  ! V P                  V P                  .V P                  V P                  R7      RR7      # )z
Execute the merge.
)
input_objsrF   rH   ri   )method)rT   _indicator_pre_mergerF   rH   _get_join_infor	  _indicator_post_merge_maybe_add_join_keys_maybe_restore_index_levels__finalize__typesSimpleNamespace)r   r   r   r   r   s   &    r[   re   _MergeOperation.get_resultn  s     >>>$($=$=dii$T!DItz262E2E2G/
-))*MR>>>//7F!!&F((0""!! IItzz2$** 	 # 
 	
r]   c                   V ^8  d   QhRR/# )rE   rX   rW   rY   )rZ   s   "r[   r\   r     s       r]   c                	    \        V P                  \        4      '       d   V P                  # \        V P                  \        4      '       d   V P                  '       d   R # R# \	        R4      h)_mergeNz<indicator option can only accept boolean or string arguments)r   rT   r   rO   r   r   s   &r[   _indicator_name_MergeOperation._indicator_name  sS     dnnc**>>!--#~~~8747N r]   c               $    V ^8  d   QhRRRRRR/# )rE   rF   r>   rH   rX   ztuple[DataFrame, DataFrame]rY   )rZ   s   "r[   r\   r     s$         &/ 	$ r]   c                   VP                   P                  VP                   4      pR F  pWC9   g   K  \        RV 24      h	  V P                  V9   d   \        R4      hVP	                  RR7      pVP	                  RR7      p^VR&   VR,          P                  R4      VR&   ^VR&   VR,          P                  R4      VR&   W3# )	z
Add one indicator column to each of the left and right inputs.

These columns are used to produce another column in the output of the
merge, indicating for each row of the output whether it was produced
using the left, right or both inputs.
_left_indicator_right_indicatorzECannot use `indicator=True` option when data contains a column named z:Cannot use name of an existing column for indicator columnFdeepint8)r   r!  )rx   unionr   r  rS   astype)r   rF   rH   rx   is   &&&  r[   r  $_MergeOperation._indicator_pre_merge  s     ,,$$U]]38A| 44538  9 7*L  yyey$


&"#"&'8"9"@"@"H$% !$)*<$=$D$DV$L !{r]   c                    V ^8  d   QhRRRR/# )rE   r   r>   rX   rY   )rZ   s   "r[   r\   r     s      I ) r]   c                p   VR,          P                  ^ 4      VR&   VR,          P                  ^ 4      VR&   \        VR,          VR,          ,           . ROR7      WP                  &   VV P                  ,          P                  P	                  . RO4      WP                  &   VP                  RR.^R7      pV# )z
Add an indicator column to the merge result.

This column indicates for each row of the output whether it was produced using
the left, right or both inputs.
r   r!  )
categories)labelsr   )   rE      )	left_only
right_onlyboth)fillnar1   r  catrename_categoriesdrop)r   r   s   &&r[   r  %_MergeOperation._indicator_post_merge  s     %++<$=$D$DQ$G !%+,>%?%F%Fq%I!"'2%&0B)CC (
##$ (.  (

# CD 	##$ %68J$KRSTr]   c                    V ^8  d   QhRRRR/# )rE   r   r>   rX   r   rY   )rZ   s   "r[   r\   r     s     )= )=) )= )=r]   c                   . p\        V P                  V P                  V P                  RR7       F  w  r4pV P                  P                  V4      '       g   K)  V P                  P                  V4      '       g   KL  WE8X  g   KT  W1P                  P                  9  g   Kp  VP                  V4       K  	  V'       d   VP                  VRR7       R# R# )a  
Restore index levels specified as `on` parameters

Here we check for cases where `self.left_on` and `self.right_on` pairs
each reference an index level in their respective DataFrames. The
joined columns corresponding to these pairs are then restored to the
index of `result`.

**Note:** This method has side effects. It modifies `result` in-place

Parameters
----------
result: DataFrame
    merge result

Returns
-------
None
TstrictinplaceN)zipr   rL   rM   r   _is_level_referencer   r   namesr   	set_index)r   r   names_to_restorenameleft_key	right_keys   &&    r[   r  +_MergeOperation._maybe_restore_index_levels  s    * ),OOT\\4==*
%DI 228<< OO77  ) 2 22 ''-#*
& -t< r]   c               (    V ^8  d   QhRRRRRRRR/# )rE   r   r>   r   r   r   rX   r   rY   )rZ   s   "r[   r\   r     s>     tB tBtB 2tB 3	tB
 
tBr]   c                	
   R pR p\         ;QJ d&    R V P                   4       F  '       d   K   RM	  RM! R V P                   4       4      '       g   Q h\        V P                  V P                  V P
                  RR7      p\        V4       EFt  w  pw  rp
\        W4      '       g   K  R R rW9   Ed:   Vf   VEe0   WP                  9   d   Vf   Vf   RMVR8H  P                  4       pV'       dc   V P                  V,          pW,          P                  V P                  V,          P                  8w  d   V P                  V,          P                  pMWP                  9   d   Vf   Vf   RMVR8H  P                  4       pV'       dc   V P                  V,          pW,          P                  V P                  V,          P                  8w  d   V P                  V,          P                  pM&V P                  V,          pV P                  V,          pVf   Vf   EK  Vf   W,          P                  pMAVf   TpM:\        VRR7      p\        VP                  4      p\         P"                  ! WVR7      pVf   W,          P                  pMBVf   TpM;\        VRR7      p\        VP                  4      p\         P"                  ! VVVR7      pVe>   VR8H  P                  4       '       d%   \%        WP                  RR7      pVP                  pMVe>   VR8H  P                  4       '       d%   \%        WP                  RR7      pVP                  pM\%        WP                  RR7      pVe   VR8H  pVP'                  V( V4      p\)        VP                  VP                  .4      pVP                  P*                  R8X  d9   VP                  P*                  R8X  d   VP*                  R	8X  d   VP                  pVP-                  V4      '       d$   VP/                  VVVP0                  R
7      W&   EK  VP3                  V4      '       d   \5        VP0                  \6        4      '       de   VVn        VP0                  P:                   Uu. uF'  pVV8w  d   VP0                  P=                  V4      MTNK)  	  ppVP?                  VRR7       EK@  \%        VVR7      Vn        EKU  TPA                  Yx;'       g    RV 2V4       EKw  	  R # u upi )Nc              3  B   "   T F  p\        V\        4      x  K  	  R # 5irv   )r   _knownry   r   s   & r[   r{   7_MergeOperation._maybe_add_join_keys.<locals>.<genexpr>  s     F2EQ:a((2Es   FTr9  extract_numpy
fill_valuedtyperS   MO)rQ  r   r;  rB  key_)!r   r   r=  r   rL   rM   	enumerate_should_fillrF   anyr   rQ  _valuesrH   r:   r/   algostake_ndr2   wherer   kind_is_label_reference_constructor_slicedr   r>  r   r3   rB  r?  get_level_valuesr@  insert)r   r   r   r   left_has_missingright_has_missingkeysr'  rB  lnamername	take_left
take_rightlvalslfillrvalstakerrfillkey_colresult_dtype	mask_left
level_nameidx_lists   &&&&                   r[   r  $_MergeOperation._maybe_add_join_keys  s8      sF$2E2EFsssF$2E2EFFFFF4??DLL$--M'0#A#U--$($z~+}/Hyy(+3 $0#7 !&&2b&8%=%=%? - ,)-)=)=a)@J%|11TYYt_5J5JJ,0IIdO,C,C	+,4 $1#8 !&&3r&9%>%>%@ . -(,(;(;A(>I%|11TZZ5E5K5KK-1ZZ-=-E-E
 !//2	!11!4
$
(>$"L00E!)%E !.it LI.y?E!MM)eTE%"L00E"*&E **DIE.u{{;E!MM%5QE  +1C0H0H0J0J#E5IG#(;;L".MR4G3L3L3N3N#E5IG#(;;L#E5IG#/$0B$6	")--
E"B#3U[[%++4N#OL((C/!KK,,3(--4 (/}}--d33#)#=#=|6<< $> $FL //55!&,,
;;'+ /5ll.@.@$ /A
 $.#5 !' = =j I%,!- /A ! $ ((4(@',W4'@MM!%7%7tA3ZAQ (7v$s   -Tc                   V ^8  d   QhRR/# )rE   rX   ?tuple[npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None]rY   )rZ   s   "r[   r\   r   o  s     
 
	H
r]   c                    V P                   R8w  g   Q h\        V P                  V P                  V P                  V P                   R7      # )return the join indexersr   rQ   rI   )rI   get_join_indexersr   r   rQ   r  s   &r[   _get_join_indexers"_MergeOperation._get_join_indexerso  s@    
 xx6!!! !5!5DII488
 	
r]   c                   V ^8  d   QhRR/# )rE   rX   Ftuple[Index, npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None]rY   )rZ   s   "r[   r\   r   z  s     A7 A7	OA7r]   c                	   V P                   P                  pV P                  P                  pV P                  '       dQ   V P                  '       d?   V P
                  R 8w  d.   VP                  W P
                  RV P                  R7      w  r4pEMV P                  '       d9   V P
                  R8X  d(   \        WV P                  V P                  R7      w  r4pEMzV P                  '       d9   V P
                  R8X  d(   \        W!V P                  V P                  R7      w  r5pEM0V P                  4       w  rEV P                  '       dX   \        V P                   4      ^ 8  d   V P                  VVVRR7      pMVf   VP                  4       pMVP                  V4      pMV P                  '       d   V P
                  R 8X  d   V P                  VVVRR7      pM|\        V P                  4      ^ 8  d   V P                  VVVRR7      pMLVf   VP                  4       pM7VP                  V4      pM%Vf   \        V4      M
\        V4      p\!        V4      pV P"                  '       d   V P%                  W4V4      w  r4pW4V3# )r   TrI   return_indexersrQ   rF   rt   rH   rI   )rF   r   rH   rN   rP   rI   r   rQ   _left_join_on_indexr   r   r{  r   _create_join_indexrS   r   r;   r   _handle_anti_join)r   left_axright_axr   r   r   ns   &      r[   r  _MergeOperation._get_join_infoy  s     ))//::##???t///DHH4F6=llhh499 7C 73Jm $((f"46I4#6#6TYY73Jm ___W!46I4#7#7dii73J| -1,C,C,E)\tyy>A%!%!8!8 $#	 "9 "J #*!)J!)}!=J88v%!%!8!8 $"	 "9 "J _q(!%!8!8 %"	 "9 "J ")!(J!(l!;J$0$8CLc,>O*1-
>>>6:6L6L-73Jm 66r]   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	rE   r   r2   other_indexindexerr   rI   r   rX   rY   )rZ   s   "r[   r\   r     s<     )# )#)# )# -	)#
 )# 
)#r]   c                   V P                   VR39   d   \        V\        4      '       g   VR8H  p\        P                  ! V4      '       d`   \        VP                  RR7      pVP                  '       g   \        V.4      pM\        V.VP                  R7      pVP                  V4      pVf   VP                  4       # VP                  V4      # )ae  
Create a join index by rearranging one index to match another

Parameters
----------
index : Index
    index being rearranged
other_index : Index
    used to supply values not found in index
indexer : np.ndarray[np.intp] or None
    how to rearrange index
how : str
    Replacement is only necessary if indexer based on other_index.

Returns
-------
Index
r   F)compatrQ  rV  )rI   r   r3   nprY  r/   rQ  _can_hold_nar2   r   rS   r   )r   r   r  r  rI   maskrO  	new_indexs   &&&&&   r[   r  "_MergeOperation._create_join_index  s    4 88W~%jj.Q.Q b=Dvvd||/EJ
))) %zl 3I %zl%++ FIY/?::<zz'""r]   c               (    V ^8  d   QhRRRRRRRR/# )rE   r   r2   r   r   r   rX   r~  rY   )rZ   s   "r[   r\   r     s3     '7 '7'7 2'7 3	'7
 
P'7r]   c                L   Vf*   \         P                  ! \        V P                  4      4      pVf*   \         P                  ! \        V P                  4      4      pV P
                  R9   g   Q hV P
                  R8X  d   VR8H  pMVR8H  pW,          pW$,          pW4,          pWV3# )aG  
Handle anti join by returning the correct join index and indexers

Parameters
----------
join_index : Index
    join index
left_indexer : np.ndarray[np.intp] or None
    left indexer
right_indexer : np.ndarray[np.intp] or None
    right indexer

Returns
-------
Index, np.ndarray[np.intp] or None, np.ndarray[np.intp] or None
rF   >   rF   rH   rV  )r  aranger   rF   rH   rI   )r   r   r   r   filts   &&&& r[   r  !_MergeOperation._handle_anti_join  s    0 99S^4L IIc$**o6Mxx,,,,88v B&D  2%D%
#)%+66r]   c                   V ^8  d   QhRR/# )rE   rX   zWtuple[list[ArrayLike], list[ArrayLike], list[Hashable], list[Hashable], list[Hashable]]rY   )rZ   s   "r[   r\   r     s     @H @H
@Hr]   c                
  aa . p. p. p. p. pV P                   V P                  uooV3R lpV3R lp\        V P                  4      '       Ed   \        V P                  4      '       Ed   \        V P                  V P                  RR7       EF\  w  r\        VRR7      p\        V	RR7      p	V! V4      '       d   \        \        V4      pVP                  V4       V! V	4      '       d5   \        \        V	4      p	VP                  V	4       VP                  R4       K  \        \        V	4      p	V	e4   VP                  SP                  V	4      4       VP                  V	4       K  VP                  SP                  P                  4       VP                  SP                  P                  4       EK%  V! V	4      '       gw   \        \        V	4      p	V	e"   VP                  SP                  V	4      4       M%VP                  SP                  P                  4       Ve   W8X  d   VP                  V	4       M!\        \        V	4      p	VP                  V	4       VeE   \        \        V4      pVP                  SP                  V4      4       VP                  V4       EK  VP                  SP                  P                  4       VP                  SP                  P                  4       EK_  	  EM\        V P                  4      '       Edi   V P                   F  p
V! V
4      '       dB   \        V
RR7      p
\        \        V
4      p
VP                  V
4       VP                  R4       KR  \        \        V
4      p
VP                  SP                  V
4      4       VP                  V
4       K  	  \        V P                  P                  \         4      '       dy   \        V P                  P                  P"                  V P                  P                  P$                  RR7       UUu. uF   w  rVP                  P'                  V4      NK"  	  pppEMV P                  P                  P                  .pEM\        V P                  4      '       Edf   V P                   F  p
\        V
RR7      p
V! V
4      '       d5   \        \        V
4      p
VP                  V
4       VP                  R4       KR  \        \        V
4      p
VP                  SP                  V
4      4       VP                  V
4       K  	  \        V P                   P                  \         4      '       dx   \        V P                   P                  P"                  V P                   P                  P$                  RR7       UUu. uF   w  rVP                  P'                  V4      NK"  	  pppM!V P                   P                  P                  .pWW5V3# u uppi u uppi )zJ
Returns
-------
left_keys, right_keys, join_names, left_drop, right_drop
c                b   < \        V \        4      ;'       d    \        V 4      \        S4      8H  # rv   r   rI  r   )r   rF   s   &r[   r   1_MergeOperation._get_merge_keys.<locals>.<lambda>*  s$    Jq&1IIc!fD	6IIr]   c                b   < \        V \        4      ;'       d    \        V 4      \        S4      8H  # rv   r  )r   rH   s   &r[   r   r  +  s$    Jq&1JJc!fE
6JJr]   Tr9  rL  N)rF   rH   _anyrL   rM   r=  r:   r   r   r   r   _get_label_or_level_valuesr   rZ  rB  r   r3   levelscodesr   )r   	left_keys
right_keysr   r   r   is_lkeyis_rkeylkrkklev	lev_codesrF   rH   s   &            @@r[   r   _MergeOperation._get_merge_keys  s    &(	&(
%'
%'
$&	iieIJ $t}}"5"5dllDMM$GG"2T:"2T:2;;i,B$$R(r{{!)R0"))"-"))$/ "(B/>&--e.N.Nr.RS&--b1 '--ekk.A.AB&--ekk.>.>?"2;; "(B/>&--e.N.Nr.RS '--ekk.A.AB>bh&--b1!)R0"))"-~ "(B/!(()H)H)LM"))"- "((););<"))$**//:[ H\ $,,\\1::%at<AY*A$$Q'%%d+ Xq)A$$T%D%DQ%GH%%a( " $****J77 +.

((//1A1A1G1GPT++ KK$$Y/+  
 #jj..667
$--  ]]!!481::Y*A%%a(%%d+ Xq)A%%e&F&Fq&IJ%%a( # $))//:66 +.		..		0E0Ed++ KK$$Y/+  	 "YY__445	jZGG?,s   %&W9)&W?c                   V ^8  d   QhRR/# )rE   rX   r   rY   )rZ   s   "r[   r\   r     s     @@ @@$ @@r]   c                	   \        V P                  V P                  V P                  R R7       E	F  w  rp\	        V4      '       d   \	        V4      '       d#   \	        V4      '       g   \	        V4      '       d   KM  \        VR R7      p\        VR R7      p\        VP                  \        4      p\        VP                  \        4      p\        VP                  4      ;'       g    \        VP                  4      p\        VP                  4      ;'       g    \        VP                  4      pV'       dD   V'       d<   \        \        V4      p\        \        V4      pVP                  V4      '       d   EKI  M/V'       g	   V'       d   MVP                  VP                  8X  d   EKy  RVP                   RVP                   RV R2p\        VP                  4      '       Edr   \        VP                  4      '       EdV   VP                  P                  VP                  P                  8X  d   EK  \        VP                  \         4      '       d   \        VP                  \         4      '       gn   \#        VP                  VP                  .4      p	\        V	\         4      '       d%   V	P%                  4       p
V
P'                  W)RR7      pMVP)                  V	4      pM\        VP                  \         4      '       dm   \#        VP                  VP                  .4      p	\        V	\         4      '       d%   V	P%                  4       p
V
P'                  WRR7      pMVP)                  V	4      p\+        VP                  4      '       d   \-        VP                  4      '       d   \.        P0                  ! R	R
7      ;_uu_ 4        VP)                  VP                  4      pRRR4       \.        P2                  ! V4      ( pVX8H  pW,          P5                  4       '       g&   \6        P8                  ! R\:        \=        4       R7       EK  \-        VP                  4      '       d   \+        VP                  4      '       d   \.        P0                  ! R	R
7      ;_uu_ 4        VP)                  VP                  4      pRRR4       \.        P2                  ! V4      ( pVX8H  pW,          P5                  4       '       g&   \6        P8                  ! R\:        \=        4       R7       EK  \>        P@                  ! VRR7      \>        P@                  ! VRR7      8X  d   EK$  EMKV'       d   \C        VP                  4      '       g$   \C        VP                  4      '       d   V'       d   EMV'       d   \        VP                  4      '       g$   \        VP                  4      '       dz   V'       dr   \>        P@                  ! VRR7      p\>        P@                  ! VRR7      p. ROp. ROpVV9   d
   VV9   d   EMuVV9   d   VV9  g   VV9   d   VV9  d   \E        V4      hEML\G        VP                  4      '       d'   \G        VP                  4      '       g   \E        V4      h\G        VP                  4      '       g'   \G        VP                  4      '       d   \E        V4      h\        VP                  \H        4      '       d,   \        VP                  \H        4      '       g   \E        V4      h\        VP                  \H        4      '       g,   \        VP                  \H        4      '       d   \E        V4      h\        VP                  \H        4      '       d!   \        VP                  \H        4      '       g7   VP                  P                  R8X  d   VP                  P                  R8X  d   EK  VP                  P                  R8X  d'   VP                  P                  R8X  d   \E        V4      hVP                  P                  R8X  d'   VP                  P                  R8X  d   \E        V4      h\        VP                  4      '       d   \        VP                  4      '       d   EKq  W0PJ                  PL                  9   d   V'       d%   \        \        V4      PN                  P                  M\P        pV PJ                  PS                  RR7      V n%        V PJ                  V,          P)                  V4      V PJ                  V&   W0PT                  PL                  9   g   E	K*  V'       d%   \        \        V4      PN                  P                  M\P        pV PT                  PS                  RR7      V n*        V PT                  V,          P)                  V4      V PT                  V&   E	K  	  R#   + '       g   i     EL; i  + '       g   i     ELJ; i)Tr9  rL  zYou are trying to merge on  and z columns for key 'z2'. If you wish to proceed you should use pd.concatFrP  ignore)invalidNzjYou are merging on int and float columns where the float values are not equal to their int representation.)
stacklevel)skipnarR  mr"  )integerzmixed-integerbooleanempty)stringunicodemixedbytesr  )+r=  r   r   r   r   r:   r   rQ  r*   r'   r(   r   r1   #_categories_match_up_to_permutationr&   r^  r   r   construct_array_type_from_sequencer&  r#   r!   r  errstateisnanr   warningswarnUserWarningr   r   infer_dtyper    r   r)   r+   rF   rx   r+  objectrS   rH   )r   r  r  rB  	lk_is_cat	rk_is_catlk_is_object_or_stringrk_is_object_or_stringr   ctcom_clscastedr  matchinferred_leftinferred_right
bool_typesstring_typestyps   &                  r[   r   (_MergeOperation._maybe_coerce_merge_keys  s     !5!5tt
 
LBD BBRSWWr6Br6B"288-=>I"288-=>I%4RXX%> & &/C" &5RXX%> & &/C" Y+r*+r*99"== > iRXX% .bhhZuRXXJ G 6!SU   )).>rxx.H.H88==BHHMM1bhh77
HHnA A *288RXX*>?B!"n55"$"9"9";$33Bu3MYYr].99)288RXX*>?B!"n55"$"9"9";$33Bu3MYYr] $BHH--.2J2JX66 "$288!4	 7 HHRL=D&LE !;??,, I ('7'9 !"((++0@0J0JX66 "$288!4	 7 HHRL=D&LE !;??,, I ('7'9  ??2e4u9   )]288-D-Dbhh'',B )-=bhh-G-G **/E #5 A!$E!BM
O !J.>Z3O "\1nL6X"l2}L7X$S/) %RXX..7J2887T7T o%(227J2887T7T o%BHHo66z/@ @ !o%/::z/@ @ !o%288_55rxx99((--3&288==C+?#%"((--3*> o%#%"((--3*> o% **rxx/H/H yy(((@Id;+66<<v IINNN6	"&))D/"8"8"=		$zz)))@Id;+66<<v!ZZ__%_8
#'::d#3#:#:3#?

4 s
B 766, 766s   ?g!g5!g25hc           
     	   \         P                  ! V4      p\         P                  ! V4      pV P                  Ef@   VEf;   VEf6   V P                  '       d   V P                  '       d   RRr!EMV P                  '       d   \        R4      hV P                  '       d   \        R4      hV P                  P                  pV P                  P                  pVP                  V4      p\        V4      ^ 8X  d,   \        RV RV RV P                   RV P                   24      hVP                  VRR7      P                  '       d$   VP                  VRR7      P                  '       g   \        R	V: 24      hT;rEMV P                  eR   Vf   Ve   \        R
4      hV P                  '       g   V P                  '       d   \        R4      hV P                  ;rEMfVe   V P                  '       d   \        R4      hV P                  '       g   Vf   \        R4      hV P                  '       d   Ve   \        R4      h\        V4      pV P                  '       dD   \        V4      V P                  P                  P                  8w  d   \        R4      hR .V,          pMVe   V P                  '       d   \        R4      hV P                  '       g   Vf   \        R4      h\        V4      pV P                  '       dD   \        V4      V P                  P                  P                  8w  d   \        R4      hR .V,          p\        V4      \        V4      8w  d   \        R4      hW3# )Nz&Must pass right_on or right_index=Truez$Must pass left_on or left_index=Truez>No common columns to perform merge on. Merge options: left_on=z, right_on=z, left_index=z, right_index=rC   r  zData columns not unique: zSCan only pass argument "on" OR "left_on" and "right_on", not a combination of both.zYCan only pass argument "on" OR "left_index" and "right_index", not a combination of both.z:Can only pass argument "left_on" OR "left_index" not both.z&Must pass "right_on" OR "right_index".z<Can only pass argument "right_on" OR "right_index" not both.zDlen(left_on) must equal the number of levels in the index of "right"z$Must pass "left_on" OR "left_index".zDlen(right_on) must equal the number of levels in the index of "left"z%len(right_on) must equal len(left_on)rY   )r   r   rJ   rN   rP   r   rF   rx   rH   intersectionr   r   	is_uniquer   r   r   )r   rL   rM   	left_cols
right_colscommon_colsr  s   &&&    r[   r   '_MergeOperation._validate_left_right_onY  s   %%g.&&x0 77?w83C4#3#3#3$& !IJJ!!! !GHH !II--	!ZZ//
'44Z@{#q($229 ;$$,: .&&*oo%6 7''+'7'7&8	:  "{@JJJ%??;G?DNNN$'@%PQQ%00(WW "h&: A  $"2"2"2 D  "&(Gh  P  ###(8 !IJJH$8 R  GAw<4::#3#3#;#;;$<  !6A:! R  ???w !GHHHAx=DIIOO$;$;;$;   &1*x=CL(DEE  r]   c                    V ^8  d   QhRRRR/# )rE   rV   r   rX   r   rY   )rZ   s   "r[   r\   r     s     L Ls Lt Lr]   c                	r  a  S P                   '       d$   S P                  P                  pVP                  pM,\        P
                  ! S P                  4      pVP                  pS P                  '       d8   S P                  P                  pS P                  P                  P                  pM,\        P
                  ! S P                  4      pVP                  pR  V 3R llpR V 3R llpVR9   dg   V'       g%   V'       g   \        RV! V4       V! V4       24      hV'       g   \        RV! V4       24      hV'       g   \        RV! V4       24      hR# VR9   d   V'       g   \        RV! V4       24      hR# VR9   d   V'       g   \        RV! V4       24      hR# VR9   d   R# \        R	V R
24      h)c                    V ^8  d   QhRRRR/# rE   r   r2   rX   r   rY   )rZ   s   "r[   r\   <_MergeOperation._validate_validate_kwd.<locals>.__annotate__  s     	8 	8e 	8 	8r]   c                   < SP                   '       g   SP                  M\        P                  pW P	                  4       ,          R ,          P                  VR7      P                  RR7      pRV R2# )N   NrT  Fr   z
Duplicates in left:
  ...)rN   rL   r   
no_default
duplicatedto_frame	to_stringr   rB  r   r   s   &  r[   left_error_msg>_MergeOperation._validate_validate_kwd.<locals>.left_error_msg  sX    '+4<<CNNDLLN#B'00d0;EEEERC-cU$77r]   c                    V ^8  d   QhRRRR/# r  rY   )rZ   s   "r[   r\   r    s     	9 	9u 	9 	9r]   c                   < SP                   '       g   SP                  M\        P                  pW P	                  4       ,          R ,          P                  VR7      P                  RR7      pRV R2# )r  rT  Fr  z
Duplicates in right:
 r  )rP   rM   r   r  r  r  r  r  s   &  r[   right_error_msg?_MergeOperation._validate_validate_kwd.<locals>.right_error_msg  s[    (,(8(8(84==cnnDLLN#B'00d0;EEEERC.se488r]   zRMerge keys are not unique in either left or right dataset; not a one-to-one merge.zAMerge keys are not unique in left dataset; not a one-to-one mergezBMerge keys are not unique in right dataset; not a one-to-one mergezBMerge keys are not unique in left dataset; not a one-to-many mergezDMerge keys are not unique in right dataset; not a many-to-one merge
"z" is not a valid argument. Valid arguments are:
- "1:1"
- "1:m"
- "m:1"
- "m:m"
- "one_to_one"
- "one_to_many"
- "many_to_one"
- "many_to_many"N)
one_to_onez1:1)one_to_manyz1:m)many_to_onezm:1)many_to_manyzm:m)rN   r   r   r  r3   from_arraysr   rP   r   r   r   r   )r   rV   left_join_indexleft_uniqueright_join_indexright_uniquer  r  s   f&      r[   r   &_MergeOperation._validate_validate_kwd  s    ???"nn22O)33K(44T5H5HIO)33K#44??00::L)55d6J6JK+55L	8 	8
	9 	9 ,,| @%o67&'789;   W%o679    X&'789;    // X%o679   // 0&'789;    00 H: 	# 	# r]   )r   rI   rT   r   rF   rN   r   rL   rJ   r   r   rH   rP   r   rM   rQ   rR   )
rC   NNNFFT_x_yFN)rF   )__name__
__module____qualname____firstlineno____doc___merge_type__annotations__r   r	   r   r   r   r	  re   r   r  r  r  r  r  r{  r  r  r  r   r   r   r   __static_attributes__rY   r]   r[   rd   rd     s   
 K	"" /.//
J$$##L2\  < 3 3j
2       D  * )= )=V tB tBl
 A7 A7F )# )#V '7 '7R @H @HD @@ @@DP!d L Lr]   rd   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rE   r  r   r  rQ   rO   rI   r   rX   rv  rY   )rZ   s   "r[   r\   r\     sB     K KKK K 
	K
 EKr]   c                  a aa \        S 4      \        S4      8X  g   Q R4       h\        S ^ ,          4      p\        S^ ,          4      pV^ 8X  d.   VR
9   d   \        4       # S'       g   VR9   d   \        VR4      # M3V^ 8X  d-   VR9   d   \        4       # S'       g   VR9   d   \        VR4      # \        S 4      ^8  dQ   V VV3R l\        \        S 4      4       4       p\	        VRR/ pR V 4       w  rp
\        W\        V
4      S4      w  rMS ^ ,          pS^ ,          p\        VRR7      p\        VRR7      pVP                  '       dP   VP                  '       d>   VP                  '       g   VP                  '       d   VP                  WRSR7      w  pppM%\        VP                  VP                  SV4      w  ppVe   \        V\        V4      4      '       d   R	pVe   \        V\        V4      4      '       d   R	pVV3# )ak  

Parameters
----------
left_keys : list[ndarray, ExtensionArray, Index, Series]
right_keys : list[ndarray, ExtensionArray, Index, Series]
sort : bool, default False
how : {'inner', 'outer', 'left', 'right'}, default 'inner'

Returns
-------
np.ndarray[np.intp] or None
    Indexer into the left_keys.
np.ndarray[np.intp] or None
    Indexer into the right_keys.
z0left_keys and right_keys must be the same lengthTFc              3  \   <"   T F!  p\        SV,          SV,          SR 7      x  K#  	  R# 5irt   N)_factorize_keys)ry   r  r  r  rQ   s   & r[   r{   $get_join_indexers.<locals>.<genexpr>'  s,      
* IaL*Q-dCC*s   ),r:  c              3  8   "   T F  p\        V4      x  K  	  R # 5irv   r   rJ  s   & r[   r{   r  ,       5fT!WWf   rS   r  N)rF   rC   )rH   r   )rH   rC   )rF   r   )r   _get_empty_indexer _get_no_sort_one_missing_indexerr   r=  _get_join_keysr   r2   is_monotonic_increasingr  r   get_join_indexers_non_uniquerZ  r   )r  r  rQ   rI   left_nright_nmappedzippedllabrlabshapelkeyrkeyrF   rH   r   lidxridxs   fff&              r[   rz  rz    s   , y>S_, :,
 1F*Q- G{##%''#!333GTBB	A$$%''#!223FEBB 9~
3y>*
 f*T*5f5E $DedC
d|!}E"D$U#E 	$$$)))^^^u		%$T	R41LL%--s

d ,T3t9==,T3u:>>:r]   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rE   rF   r   rH   rQ   rO   rI   r   rX   1tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]rY   )rZ   s   "r[   r\   r\   I  s:     # #
## # 
	#
 7#r]   c                V   \        WW#R7      w  rEpVR8X  d   WE3# VR8X  d   \        P                  ! WEWbR7      w  rxWx3# VR8X  d   \        P                  ! WTWbR7      w  rWx3# VR8X  d   \        P                  ! WEWbR7      w  rxWx3# VR8X  d   \        P                  ! WEV4      w  rxXX3# )a  
Get join indexers for left and right.

Parameters
----------
left : ArrayLike
right : ArrayLike
sort : bool, default False
how : {'inner', 'outer', 'left', 'right'}, default 'inner'

Returns
-------
np.ndarray[np.intp]
    Indexer into left.
np.ndarray[np.intp]
    Indexer into right.
ry  rF   rt   rH   rC   r   rV  )r  libjoinleft_outer_join
inner_joinfull_outer_join)	rF   rH   rQ   rI   r  r  countr   r!  s	   &&&&     r[   r  r  I  s    . ($HD{z
f},,TJ
 : 
,,TJ

 :	 
''EE
 : 
,,T?
:r]   c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )rE   rF   r3   rH   r   r2   lindexernpt.NDArray[np.intp]rindexerrX   z)tuple[FrozenList, FrozenList, FrozenList]rY   )rZ   s   "r[   r\   r\   o  sL     V/ V/
V/V/ 	V/
 #V/ #V/ /V/r]   c                   R R lpV! V4      pVP                   pVP                  pVP                  p	V F  p
WP                  9   d   T pTpMTpTpVP                  P                  V
4      pVP                   V,          pVP                  V,          pVf   TpM\        P
                  ! WRR7      pW~.,           pVV.,           pW.,           p	K  	  WxV	3# )a  
*this is an internal non-public method*

Returns the levels, labels and names of a multi-index to multi-index join.
Depending on the type of join, this method restores the appropriate
dropped levels of the joined multi-index.
The method relies on lindexer, rindexer which hold the index positions of
left and right, where a join was feasible

Parameters
----------
left : MultiIndex
    left index
right : MultiIndex
    right index
dropped_level_names : str array
    list of non-common level names
join_index : Index
    the index of the join between the
    common levels of left and right
lindexer : np.ndarray[np.intp]
    left indexer
rindexer : np.ndarray[np.intp]
    right indexer

Returns
-------
levels : list of Index
    levels of combined multiindexes
labels : np.ndarray[np.intp]
    labels of combined multiindexes
names : List[Hashable]
    names of combined multiindex levels

c                    V ^8  d   QhRRRR/# )rE   r   r2   rX   r3   rY   )rZ   s   "r[   r\   6restore_dropped_levels_multijoin.<locals>.__annotate__  s     O Oe O
 Or]   c                    \        V \        4      '       d   V # \        P                  ! V P                  .V P                  .R 7      # ))r?  )r   r3   r  rZ  rB  r  s   &r[   _convert_to_multiindex@restore_dropped_levels_multijoin.<locals>._convert_to_multiindex  s3    eZ((L))5==/%**NNr]   rN  rV  )r  r  r?  r   r[  r\  )rF   rH   dropped_level_namesr   r+  r-  r2  join_levels
join_codesr   dropped_level_nameidxr  name_idxrestore_levelsr  restore_codess   &&&&&&           r[    restore_dropped_levels_multijoinr<  o  s    XO (
3J##K!!J!!J 2+CGCG 99??#56H- 		(#?!M!MM%RHM "$44=/1
"66
/ 22 J..r]   c                  6    ] tR tRtRtR	R R lltR R ltRtR# )
r   i  ordered_mergeNc               D    V ^8  d   QhRRRRRRRRRRRR	R
R	RRRRRRRR/# )rE   rF   rG   rH   rJ   r   rL   rM   rN   rO   rP   rR   r   r   rW   rI   r   rX   r   rY   )rZ   s   "r[   r\   _OrderedMerge.__annotate__  sx     
 
 
 "
 	

 #
 $
 
 
 
  
 '
 

r]   c                	R    Wn         \        P                  V VVVVVVVV
VR R7       R# )T)rJ   rL   rN   rP   rM   rI   rR   rQ   N)r   rd   r   )r   rF   rH   rJ   rL   rM   rN   rP   rR   r   rI   s   &&&&&&&&&&&r[   r   _OrderedMerge.__init__  s>     '  !# 	! 	
r]   c                   V ^8  d   QhRR/# r   rY   )rZ   s   "r[   r\   r@    s      I r]   c                	H   V P                  4       w  rpV P                  R 8X  d<   Vf   RpM\        P                  ! V4      pVf   RpM5\        P                  ! V4      pMV P                  f   TpTpM\	        R4      hV P                  WV4      pV P                  WbV4       V# )ffillNz#fill_method must be 'ffill' or None)r  r   r%  ffill_indexerr   r	  r  )r   r   r   r   left_join_indexerright_join_indexerr   s   &      r[   re   _OrderedMerge.get_result  s    262E2E2G/
-
 w&#$(!$+$9$9,$G!$%)"%,%:%:=%I"% ,!.BCC))+=
 	!!&Fr]   )r   )NNNFFr  Nr   )r  r   r  r  r  r   re   r  rY   r]   r[   r   r     s    !K
8 r]   r   c                   V ^8  d   QhRR/# )rE   r   r   rY   )rZ   s   "r[   r\   r\   	  s     ( ( (r]   c                0    R V  R2p\        \        VR4      # )
asof_join_
_on_X_by_YN)getattrr%  )r   rB  s   & r[   _asof_by_functionrO  	  s    	{*-D7D$''r]   c                  l   a  ] tR tRtRtRR R lltV 3R ltR R ltR R	 ltR
 R lt	R R lt
RtV ;t# )r   i		  
asof_mergec               H    V ^8  d   QhRRRRRRRRRRRR	R
R	RRRRRR	RRRR/# )rE   rF   rG   rH   rJ   r   rL   rM   rN   rO   rP   rR   r   rI   zLiteral['asof']r   r   r   rX   r   rY   )rZ   s   "r[   r\   _AsOfMerge.__annotate__	  s     1
 1
 1
 "1
 	1

 #1
 $1
 1
 1
 1
 1
 "1
  !1
" 
#1
r]   c                	J   Wn         Wn        Wn        Wn        Wn        Wn        V P
                  R9  d   \        RV P
                   24      h\        V P                  4      '       g   RV P                   2p\        V4      h\        P                  V VVVVVVVVVRR7       R# )backwardzdirection invalid: z,allow_exact_matches must be boolean, passed N)rJ   rL   rM   rN   rP   rI   rR   r   )rU  forwardnearest)
r   r   r   r   r   r   r   r   r   r   )r   rF   rH   rJ   rL   rM   rN   rP   r   r   r   rR   rI   r   r   r   r   s   &&&&&&&&&&&&&&&& r[   r   _AsOfMerge.__init__	  s    $  "#6 " >>!CC24>>2BCDD t//002235  S/!!# 	 	
r]   c                	  < \         SV `  W4      w  r\        V4      ^8w  d   V P                  '       g   \	        R4      h\        V4      ^8w  d   V P
                  '       g   \	        R4      hV P                  '       d6   \        V P                  P                  \        4      '       d   \	        R4      hV P
                  '       d6   \        V P                  P                  \        4      '       d   \	        R4      hV P                  e@   V P                  f   V P                  e   \	        R4      hV P                  ;V n        V n        V P                  f   V P                  e   \	        R4      hV P                  e   V P                  f   \	        R4      hV P                  '       g   V^ ,          p\        V\        4      '       d   VP                  pMW0P                  P                   9   d&   V P                  P#                  V4      P                  M$V P                  P                  P%                  V4      pM V P                  P                  P                  pV P
                  '       g   V^ ,          p\        V\        4      '       d   VP                  pMWPP                  P                   9   d&   V P                  P#                  V4      P                  M$V P                  P                  P%                  V4      pM V P                  P                  P                  p\'        V4      '       g4   \'        V4      '       g#   \)        V4      '       g   \)        V4      '       d   \	        RV: R	V: R
24      hV P                  e   \+        V P                  4      '       g   V P                  .V n        \+        V P                  4      '       g   V P                  .V n        \        V P                  4      \        V P                  4      8w  d   \	        R4      hV P                  \-        V4      ,           pV P                  \-        V4      ,           pW3# )r-  zcan only asof on a key for leftz can only asof on a key for rightzleft can only have one indexzright can only have one indexz(Can only pass by OR left_by and right_byzmissing left_byzmissing right_byzIncompatible merge dtype, r  z$, both sides must have numeric dtypez,left_by and right_by must be the same length)superr   r   rN   r   rP   r   rF   r   r3   rH   r   r   r   rI  rQ  rx   r  ra  r'   r(   r$   r   )r   rL   rM   	left_on_0lo_dtype
right_on_0ro_dtype	__class__s   &&&    r[   r   "_AsOfMerge._validate_left_right_on?	  s(   !G;GN w<1T___>??x=Ad&6&6&6?@@???z$))//:FF;<<
4::+;+;Z H H<== 77||'4==+D !KLL+/772DL4=<<DMM$=.//<<#(=/00 
I)V,,$?? !II$5$55 II88CII99)D  yy,,H!!J*f--%++ "ZZ%7%77 JJ99*EKK)):::F  zz''--H H%%x((x((x((,XL,BD  <<#-- $~..!%4<< C$66 !OPPllT']2G}}tH~5H  r]   c               $    V ^8  d   QhRRRRRR/# r   rY   )rZ   s   "r[   r\   rS  	  s$     +& +&-+&@O+&	+&r]   c                	j   R  R lp\        \        WRR7      4       F  w  pw  rVV! WVV4       K  	  V P                  '       d"   V P                  P                  P
                  pM	VR,          pV P                  '       d"   V P                  P                  P
                  pM	VR,          pV! Wx^ 4       R# )c               (    V ^8  d   QhRRRRRRRR/# )rE   rF   r   rH   r'  intrX   r   rY   )rZ   s   "r[   r\   ?_AsOfMerge._maybe_require_matching_dtypes.<locals>.__annotate__	  s(     	& 	&Y 	&y 	&S 	&T 	&r]   c                \   V P                   VP                   8w  d   \        V P                   \        4      '       dD   \        VP                   \        4      '       d$   R V RV P                   : RVP                   : R2pM"R V RV P                   : RVP                   : R2p\        V4      hR# )zincompatible merge keys [z] r  z), both sides category, but not equal onesz, must be the same typeN)rQ  r   r*   r   )rF   rH   r'  r   s   &&& r[   _check_dtype_matchE_AsOfMerge._maybe_require_matching_dtypes.<locals>._check_dtype_match	  s    zzU[[(djj*:;;
KK!1A A 4A3be ;;/)RT  4A3be ;;/)@B  !o%+ )r]   Tr9  NrV  )rW  r=  rN   rF   r   rZ  rP   rH   )	r   r   r   rg  r'  r  r  ltrts	   &&&      r[   r   )_AsOfMerge._maybe_require_matching_dtypes	  s    
	&2 %SQU%VWKAxrq) X ???((B#B!!))B $B21%r]   c                    V ^8  d   QhRRRR/# r   rY   )rZ   s   "r[   r\   rS  	  s     #L #L/ #Ld #Lr]   c                	   V P                   Ee   V P                  '       d"   V P                  P                  P                  pM	VR,          pRV P                    RVP
                  : 2p\        VP
                  4      '       g2   \        V\        4      '       dx   VP
                  P                  R9   d]   \        V P                   \        P                  4      '       g   \        V4      hV P                   \        ^ 4      8  d   \        R4      hR # \        VP
                  4      '       dE   \        V P                   4      '       g   \        V4      hV P                   ^ 8  d   \        R4      hR # \!        VP
                  4      '       dE   \#        V P                   4      '       g   \        V4      hV P                   ^ 8  d   \        R4      hR # \        R4      hR # )Nzincompatible tolerance z, must be compat with type mMztolerance must be positivez'key must be integer, timestamp or floatrV  )r   rN   rF   r   rZ  rQ  r)   r   r5   r^  datetime	timedeltar   r
   r#   r"   r!   r%   )r   r   ri  r   s   &&  r[   r   _AsOfMerge._validate_tolerance	  sj   >>%YY__,,#B' *$..)9 :XXL* 
 #288,,22338M!$..(2D2DEE$S/)>>IaL0$%ABB 1 ""((++!$..11$S/)>>A%$%ABB &  )) 00$S/)>>A%$%ABB & !!JKKC &r]   c               $    V ^8  d   QhRRRRRR/# )rE   valuesr   sider   rX   
np.ndarrayrY   )rZ   s   "r[   r\   rS  	  s$      "*-	r]   c                	   \        VR R7      P                  '       g=   \        V4      P                  4       '       d   \	        RV R24      h\	        V R24      h\        V\        4      '       d   VP                  4       p\        VP                  4      '       d   VP                  R4      pV# \        V\        4      '       d   VP                  pV# \        V\        4      '       d   VP                  4       pV# )Fr  z"Merge keys contain null values on z sidez keys must be sortedi8)r2   r  r.   rY  r   r   r5   _maybe_convert_datelike_arrayr)   rQ  viewr6   _datar7   to_numpy)r   rs  rt  s   &&&r[   _convert_values_for_libjoin&_AsOfMerge._convert_values_for_libjoin	  s     V%(@@@F|!! #EdV5!QRRv%9:;;f12299;Fv||,,[[&F  00\\F  //__&F
 r]   c                   V ^8  d   QhRR/# rE   rX   r#  rY   )rZ   s   "r[   r\   rS  	  s     ` `$U `r]   c           	        V P                   '       d!   V P                  P                  P                  MV P                  R
,          pV P
                  '       d!   V P                  P                  P                  MV P                  R
,          pVP                  VP                  8X  g   Q hV P                  pVe   \        VP                  4      '       g2   \        V\        4      '       d   VP                  P                  R9   d   \        V4      pVP                  P                  R9   d^   \        V\        4      '       d"   VP                  P                  P                   pM\#        V4      P                   pVP%                  V4      pVP&                  pV P)                  VR4      pV P)                  VR4      pV P*                  Ee   V P                   '       d,   V P
                  '       d   V P                  pV P                  pMV P                  ^ R
 pV P                  ^ R
 p\-        \/        V4      4       Uu. uF  p\1        WW,          Wg,          RR7      NK  	  pp\/        V4      ^8X  d"   V^ ,          ^ ,          p	V^ ,          ^,          p
MV Uu. uF   p\2        P4                  ! VR,          4      NK"  	  pp\6        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      p\9        WRRR	7      p\/        V^ ,          4      pVRV p	WR p
\;        V	4      p	\;        V
4      p
\=        V P>                  4      pV! VVV	V
V P@                  V4      # \=        V P>                  4      pV! VVRRV P@                  VR4      # u upi u upi )rx  Nrn  rF   rH   Frt   :NrE   Nc              3  2   "   T F  q^,          x  K  	  R# 5i)rE   NrY   )ry   r  s   & r[   r{   0_AsOfMerge._get_join_indexers.<locals>.<genexpr>;
  s     3FqddFs   )r  rQ   xnullrV  )!rN   rF   r   rZ  r   rP   rH   r   rQ  r   r)   r   r5   r^  r
   pyarrow_dtypeunitr9   as_unit_valuer|  r   r   r   r  r  concatenater   r<   r   rO  r   r   )r   left_valuesright_valuesr   r  r   r   r  r  left_by_valuesright_by_valuesr  arrsr  group_indexleft_lenfuncs   &                r[   r{  _AsOfMerge._get_join_indexers	  s%   
 (,DIIOO##D<O<OPR<S 	 )-(8(8(8DJJ$$d>R>RSU>V 	
   L$6$6666NN	  #;#4#455;(;<<%%**d2%i0	 $$))T1 "+/BCC*00>>CC=kJOO ) 1 1$ 7I%,,	 66{FK77gN <<#4#3#3#3!%!4!4"&"6"6!%!4!4Qr!:"&"6"6q"< s>23 4A  "%#&
 4   >"a'!'1"()A,7=>v!qu-v>3F33F33-E ~a01!,Yh!7"-i"8).9N*?;O %T^^4D((  %T^^4D(( M ?s   7#M=&N)r   r   r   r   r   r   )NNNFFNNNr  r   NTrU  )r  r   r  r  r  r   r   r   r   r|  r{  r  __classcell__)r_  s   @r[   r   r   		  s3    K1
fN!`+&Z#LJ4` `r]   r   c               (    V ^8  d   QhRRRRRRRR/# )	rE   	join_keysr   r   r3   rQ   rO   rX   r#  rY   )rZ   s   "r[   r\   r\   ^
  s,      '19=6r]   c                  a aa VV V3R  l\        SP                  4       4       p\        VRR/ pR V 4       w  rVpS'       d0   \        \	        \
        P                  VSP                  4      4      pM"R p\        \	        VSP                  4      4      p\        S 4       F  w  rSP                  V	,          R8H  pVP                  4       '       g   K3  WV	,          Wy,          ^,
          8H  ,          pVP                  ^ 8X  g   V^ ,          V^ ,          8w  g   Wy;;,          ^,          uu&   Wy,          ^,
          WY,          V&   K  	  \        We\        V4      S4      w  rW3# )c              3     <"   T F5  p\        SP                  V,          P                  SV,          SR 7      x  K7  	  R# 5ir
  )r  r  rZ  )ry   r  r   r  rQ   s   & r[   r{   *_get_multiindex_indexer.<locals>.<genexpr>b
  s6      %A 	Q//1DII%s   =A r:  Tc              3  8   "   T F  p\        V4      x  K  	  R # 5irv   r  rJ  s   & r[   r{   r  g
  r  r  c                (    V P                  R RR7      # )rw  F)subok)r&  )as   &r[   r   )_get_multiindex_indexer.<locals>.<lambda>k
  s    188D86r]   rV  )r   r   r=  r   mapr  r   r  rW  rY  sizer  r   )r  r   rQ   r  r  rcodeslcodesr  i8copyr'  join_keyr  r  r  r  s   fff            r[   _get_multiindex_indexerr  ^
  s   u}}%F &&&F5f5FEc"''65;;786c&%++./ !+{{1~#88:: ehl23Avv{!A$!A$,A#hlFIdO ,  edCJD:r]   c                   V ^8  d   QhRR/# r  rY   )rZ   s   "r[   r\   r\   
  s      M r]   c                     \         P                  ! . \         P                  R7      \         P                  ! . \         P                  R7      3# )zReturn empty join indexers.r  )r  arrayintprY   r]   r[   r  r  
  s2     	277#
277# r]   c               $    V ^8  d   QhRRRRRR/# )rE   r  rd  left_missingrO   rX   r#  rY   )rZ   s   "r[   r\   r\   
  s$      
6r]   c                    \         P                  ! V \         P                  R7      p\         P                  ! V R\         P                  R7      pV'       d   W23# W#3# )a  
Return join indexers where all of one side is selected without sorting
and none of the other side is selected.

Parameters
----------
n : int
    Length of indexers to create.
left_missing : bool
    If True, the left indexer will contain only -1's.
    If False, the right indexer will contain only -1's.

Returns
-------
np.ndarray[np.intp]
    Left indexer
np.ndarray[np.intp]
    Right indexer
r  )r  rO  rQ  rV  )r  r  r  full)r  r  r8  idx_missings   &&  r[   r  r  
  sC    , ))ARWW
%C''b@Kr]   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rE   r  r2   r  r  r   rQ   rO   rX   z?tuple[Index, npt.NDArray[np.intp] | None, npt.NDArray[np.intp]]rY   )rZ   s   "r[   r\   r\   
  s4     ( ((#(0?(GK(D(r]   c                B   \        V\        4      '       d   \        W!VR 7      w  rEMV^ ,          pVP                  p\	        WEVR 7      w  rgp\
        P                  ! WgWR 7      w  rV'       g   \        V 4      \        V	4      8w  d   V P                  V	4      pWV
3# V RV
3# r
  )	r   r3   r  rZ  r  r%  r&  r   r   )r  r  r  rQ   r  r  rC  rD  r)  r   r   r   s   &&&&        r[   r  r  
  s     (J'',YtL
d
 | !0$!GH")"9"9U#L s7|s<00\\,/
66 D-''r]   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rE   r  r   r  rQ   rO   rI   rW   rX   z6tuple[npt.NDArray[np.intp], npt.NDArray[np.intp], int]rY   )rZ   s   "r[   r\   r\   
  sA     M MMM M 
	M
 <Mr]   c                L   \        V P                  \        4      '       d!   \        VP                  \        4      '       gO   \        P                  ! V P                  R4      '       ds   \        P                  ! VP                  R4      '       dL   \        RV 4      P                  V4      w  r\        RV 4      P                  p \        RV4      P                  pEM\        V P                  \        4      '       d   \        VP                  \        4      '       d   V P                  VP                  8X  dn   \        V \        4      '       g   Q h\        V\        4      '       g   Q hV P                  V4      p\        V P                  4      p \        VP                  4      pEM(\        V \        4      '       Ed   V P                  VP                  8X  Ed   \        V P                  \        4      '       g>   \        V P                  \        4      '       Ed   V P                  P                   R8X  Ed   ^ RIp^ RIHp \)        V 4      pV P*                  p VP*                  pVP-                  V P.                  VP.                  ,           4      P1                  4       P3                  4       pVP5                  VP6                  \9        V4      ,          R4      P;                  4       P=                  \>        P@                  RR7      VP5                  VP6                  \9        VR4      ,          R4      P;                  4       P=                  \>        P@                  RR7      \)        VPB                  4      rpV'       d+   VPB                  P;                  RR7      p\E        WV	4      w  rVPF                  ^ 8  dr   VR8H  pVPI                  4       pV	R8H  pVPI                  4       pV'       d   \>        PJ                  ! WV
4       V'       d   \>        PJ                  ! WV
4       V
^,          p
WV
3# \        V \L        4      '       g   \        V P                  \        4      '       dI   \O        V P                  PP                  4      '       gJ   \S        V P                  4      '       d	   V'       d'   V PU                  4       w  p pVPU                  4       w  pp\W        V P                  4      '       dh   V P                  VP                  8X  dM   \>        PX                  ! V \>        PZ                  R7      p \>        PX                  ! V\>        PZ                  R7      p\]        W4      w  prV! \_        \)        V 4      \)        V4      4      \        V\L        \`        34      R	7      p\        V \L        4      '       dJ   \        V\L        4      '       g   Q hV Pb                  V Pd                  ppVPb                  VPd                  ppM\        V \`        4      '       d   \        V\`        4      '       g   Q hV P;                  ^V P                  PP                  R
7      pVP;                  ^V P                  PP                  R
7      pV Pg                  4       VPg                  4       ppMYppRRppVR8H  ;'       d)    V'       * ;'       d    V P                  Ph                  R9   pV'       d`   VPk                  VVR7      p	VPm                  4       \)        V	4      8X  d   VPo                  VV4      w  ppVVR3# VPk                  VVR7      pM&VPk                  VVR7      pVPk                  VVR7      p	VP                  \>        P                  ! \>        P@                  4      8X  g   Q VP                  4       hV	P                  \>        P                  ! \>        P@                  4      8X  g   Q V	P                  4       hVPm                  4       p
V'       d)   VPp                  Ps                  4       p\E        WV	4      w  rVR8H  pVPI                  4       pV	R8H  pVPI                  4       pV'       g	   V'       dH   V'       d   \>        PJ                  ! WV
4       V'       d   \>        PJ                  ! WV
4       V
^,          p
WV
3# )a  
Encode left and right keys as enumerated types.

This is used to get the join indexers to be used when merging DataFrames.

Parameters
----------
lk : ndarray, ExtensionArray
    Left key.
rk : ndarray, ExtensionArray
    Right key.
sort : bool, defaults to True
    If True, the encoding is done such that the unique elements in the
    keys are sorted.
how: str, optional
    Used to determine if we can use hash-join. If not given, then just factorize
    keys.

Returns
-------
np.ndarray[np.intp]
    Left (resp. right if called with `key='right'`) labels, as enumerated type.
np.ndarray[np.intp]
    Right (resp. left if called with `key='right'`) labels, as enumerated type.
int
    Number of unique elements in union of left and right labels. -1 if we used
    a hash-join.

See Also
--------
merge : Merge DataFrame or named Series objects
    with a database-style join.
algorithms.factorize : Encode the object as an enumerated type
    or categorical variable.

Examples
--------
>>> lk = np.array(["a", "c", "b"])
>>> rk = np.array(["a", "c"])

Here, the unique values are `'a', 'b', 'c'`. With the default
`sort=True`, the encoding will be `{0: 'a', 1: 'b', 2: 'c'}`:

>>> pd.core.reshape.merge._factorize_keys(lk, rk)
(array([0, 2, 1]), array([0, 2]), 3)

With the `sort=False`, the encoding will correspond to the order
in which the unique elements first appear: `{0: 'a', 1: 'c', 2: 'b'}`:

>>> pd.core.reshape.merge._factorize_keys(lk, rk, sort=False)
(array([0, 1, 2]), array([0, 1]), 3)
rR  r@   pyarrowNFr  )zero_copy_onlyr  )	uses_mask)na_valuerQ  rC   iufb)r  rV  ):r   rQ  r+   r   is_np_dtyper   _ensure_matching_resos_ndarrayr*   r1   _encode_with_my_categoriesr   r  r7   r0   r8   storager  pyarrow.computecomputer   	_pa_arraychunked_arraychunkscombine_chunksdictionary_encode	fill_nullr   slicer{  r&  r  r  
dictionary_sort_labels
null_countrY  putmaskr6   r&   numpy_dtyper(   _values_for_factorizer)   asarrayint64#_convert_arrays_and_get_rizer_klassmaxr5   rz  _maskr.   r^  	factorize	get_counthash_inner_joinuniquesto_array)r  r  rQ   rI   papclen_lkdcr  r  r)  r  lmasklanyrmaskranyr   klassrizerlk_datalk_maskrk_datark_maskhash_join_availabler!  r   s   &&&&                      r[   r  r  
  s   z 	288_--*RXX2W2W
//"((C
(
(S__RXXs-K-K or*AA"E/2&///2&// 	288-..rxx!122HH "k****"k**** **2."((#"((#	B	'	'BHH,@bhh
++rxx--"((2B2Bi2O (WFBB  RYY!67!""$  RZZf6;e,RZZfd(;<bAe,BMM" D --000F)'>
}}q 
yy{
yy{JJtE2JJtE2
u$$"o..rxx,, !5!566#BHH--d ,,.EB ,,.EB288$$RXX)= ZZ"((+ZZ"((+7?ME2CGSWR/3F!GHE
 "o&&"o....88RXX88RXX	B+	,	,"12222 ++q0D0D+E++q0D0D+E779bggi
 .QQXQQ"((--6:QwW5??D	)..w@JD$r>!??7?9DwW5wW5::"''**6DJJ6*::"''**6DJJ6*OOE--((*!'6
 BJE99;DBJE99;DtJJtE*JJtE*
ur]   c               $    V ^8  d   QhRRRRRR/# )rE   r  r   r  rX   z:tuple[type[libhashtable.Factorizer], ArrayLike, ArrayLike]rY   )rZ   s   "r[   r\   r\     s$           ? r]   c                   \        V P                  4      '       Ed   V P                  VP                  8w  d   \        V P                  VP                  .4      p\        V\        4      '       d   VP                  4       p\        V \        4      '       g   VP                  WR R7      p MV P                  VR R7      p \        V\        4      '       g   VP                  WR R7      pM:VP                  VR R7      pM&V P                  VR R7      p VP                  VR R7      p\        V \        4      '       d#   \        V P                  P                  ,          pM\        V P                  \        4      '       d-   \        V P                  P                  P                  ,          pMH\        V P                  P                  ,          pM&\        P                  p\!        V 4      p \!        V4      pW@V3# )FrP  r  )r&   rQ  r   r   r   r  r7   r  r&  r6   _factorizersr   r0   r  libhashtableObjectFactorizerr   )r  r  rQ  clsr  s   &&   r[   r  r    sh    !!88rxx$bhh%9:E%00002!"n55++B%+HB5u5B!"n55++B%+HB5u5BYYu5Y1YYu5Y1b/** /E*-- !5!5!:!:;E /E --22b=r]   c               (    V ^8  d   QhRRRRRRRR/# )rE   r  ru  rF   r,  rH   rX   r#  rY   )rZ   s   "r[   r\   r\     s,     	 		3	<P	6	r]   c                    \        V4      p\        P                  ! W.4      p\        P                  ! WR R7      w  rVVRV WcR rWx3# )T)use_na_sentinelN)r   r  r  r[  	safe_sort)	r  rF   rH   llengthr,  r   
new_labelsnew_left	new_rights	   &&&      r[   r  r    sK     $iG^^TM*FOOGTJMA$Xg.
80Dir]   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rE   r  z%list[npt.NDArray[np.int64 | np.intp]]r  r  r   rQ   rO   rX   z3tuple[npt.NDArray[np.int64], npt.NDArray[np.int64]]rY   )rZ   s   "r[   r\   r\     s:     "3 "3
/"3
/"3 "3 	"3
 9"3r]   c                  a \        V3R  l\        \        S4      ^ R	4       4       4      p\        P                  ! S^V RR7      pWP^ ,          P                  RRRR7      ,          pWQ^ ,          P                  RRRR7      ,          p\        ^V4       Fg  p\        P                  ! RR7      ;_uu_ 4        VSV,          ,          pRRR4       W`V,          V,          ,          pWqV,          V,          ,          pKi  	  V\        S4      8X  d   Wg3# \        WgVR7      w  rgp	V.WR Op V.WR OpV	.SVR O5o\        WSV4      #   + '       g   i     L; i)
c              3  T   <"   T F  p\        SR V 4      '       d   K  Vx  K  	  R # 5irv   )r=   )ry   r  r  s   & r[   r{   !_get_join_keys.<locals>.<genexpr>  s(      +C)%+6 	+s   (
(rw  r  F)r  rS   r  )divideNrt   rV  )	nextr   r   r  prodr&  r  r  r  )
r  r  r  rQ   nlevstrider  r  r'  r)  s
   &&f&      r[   r  r    sA     UQ+ D WWU1T]$/FGNN4u5NAADGNN4u5NAAD1d^[[))uQxF *Q&  Q&  	  s5zz (>D4;D4;D"U45\"E$eT22 *)s   6EEc                   V ^8  d   QhRR/# rE   rX   rO   rY   )rZ   s   "r[   r\   r\     s      $ r]   c                f    \        V \        4      '       d   \        V\        4      '       g   R # W8H  # )T)r   r   )rf  rg  s   &&r[   rX  rX    s&    eS!!E3)?)?>r]   c                   V ^8  d   QhRR/# r  rY   )rZ   s   "r[   r\   r\     s     2 2t 2r]   c                B    V R J;'       d    \         P                  ! V !  # rv   )r   any_not_none)r   s   &r[   r  r    s    D=11S--q11r]   c                    V ^8  d   QhRRRR/# )rE   objrG   rX   r>   rY   )rZ   s   "r[   r\   r\     s     

 

- 

) 

r]   c                    \        V \        4      '       d   V # \        V \        4      '       d*   V P                  f   \	        R4      hV P                  4       # \        R\        V 4       R24      h)Nz$Cannot merge a Series without a namez.Can only merge Series or DataFrame objects, a z was passed)r   r,   r-   rB  r   r  	TypeErrorr   )r  s   &r[   ra   ra     s`    #|$$
	C	#	#88CDD||~<T#YK{S
 	
r]   c               (    V ^8  d   QhRRRRRRRR/# )rE   rF   r2   rH   rR   r   rX   ztuple[Index, Index]rY   )rZ   s   "r[   r\   r\     s2     D D
DD)1DDr]   c                B  a \        VRR7      '       d   \        V\        4      '       d   \        R\	        V4       R24      hV P                  V4      o\        S4      ^ 8X  d   W3# Vw  r4V'       g   V'       g   \        RS 24      hR V3R llp\        WSR7      p\        WTR7      pV P                  V4      pVP                  V4      p	. p
VP                  '       gJ   V
P                  WP                  4       V P                  4       ( ,          ,          P                  4       4       V	P                  '       gJ   V
P                  WP                  4       VP                  4       ( ,          ,          P                  4       4       V
P                  VP                  VP                  S4      4      P                  4       4       V
P                  V	P                  V P                  S4      4      P                  4       4       V
'       d   \        R	\!        V
4       R
24      hW3# )z
Suffixes type validation.

If two indices overlap, add suffixes to overlapping entries.

If corresponding suffix is empty, the entry is simply converted to string.

F)
allow_setszPassing 'suffixes' as a z:, is not supported. Provide 'suffixes' as a tuple instead.z)columns overlap but no suffix specified: c                   V ^8  d   QhRR/# )rE   suffixrW   rY   )rZ   s   "r[   r\   0_items_overlap_with_suffix.<locals>.__annotate__  s      : r]   c                *   < V S9   d   Ve   V  V 2# V # )z
Rename the left and right indices.

If there is overlap, and suffix is not None, add
suffix, otherwise, leave it as-is.

Parameters
----------
x : original column name
suffix : str or None

Returns
-------
x : renamed column name
rY   )r   r  	to_renames   &&r[   renamer+_items_overlap_with_suffix.<locals>.renamer  s$      	>f0S>!r]   )r  z1Passing 'suffixes' which cause duplicate columns z is not allowed.)r$   r   dictr  r   r  r   r   r   _transform_indexr  extendr  r   r   r   r   )rF   rH   rR   lsuffixrsuffixr  lrenamerrrenamerr  r  dupsr  s   &&&        @r[   r   r     s    U33z(D7Q7Q&tH~&6 75 5
 	

 !!%(I
9~{G7DYKPQQ ( w/Hw/H##H-G$$X.GD 	G//1t7H6HIJQQSTG//1u7G7G7I6IJKRRTUKK$$U%5%5i%@AHHJKKK$$T__Y%?@GGIJ?D	{ K 
 	

 r]   r  )	NNNFFFr  FN)NNNNNNr  r   )NNNFFNNNr  NTrU  )FrC   )F)TN)r  
__future__r   collections.abcr   r   ro  	functoolsr   r  typingr   r   r   r	   rm   r  numpyr  pandas._libsr
   r   r  r   r%  r   pandas._libs.libr   pandas._typingr   r   r   r   r   r   r   r   pandas.errorsr   pandas.util._decoratorsr   r   pandas.util._exceptionsr   pandas.core.dtypes.baser   pandas.core.dtypes.castr   pandas.core.dtypes.commonr   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   pandas.core.dtypes.dtypesr*   r+   pandas.core.dtypes.genericr,   r-   pandas.core.dtypes.missingr.   r/   rB   r0   r1   r2   r3   r4   pandas.core.algorithmscore
algorithmsr[  pandas.core.arraysr5   r6   r7   pandas.core.arrays.string_r8   pandas.core.commoncommonr   pandas.core.constructionr9   r:   pandas.core.indexes.apir;   pandas.core.sortingr<   r=   r>   pandas.corer?   r@   pandas.core.indexes.frozenrA   r  Int64Factorizerlonglongint32Int32Factorizerint16Int16Factorizerr$  Int8Factorizeruint64UInt64Factorizeruint32UInt32Factorizeruint16UInt16Factorizeruint8UInt8Factorizerbool_float64Float64Factorizerfloat32Float32Factorizer	complex64Complex64Factorizer
complex128Complex128Factorizerobject_r  r  intcrQ  itemsizeuintcndarrayrI  r  ri   rc   r   r   r   rd   rz  r  r<  r   rO  r   r  r  r  r  r  r  r  r  rX  r  ra   r   rY   r]   r[   <module>rP     s   #         .	 	 	 % 5 2 4   
  ' & 
 3     2
  #05 HHl**KK--HHl**HHl**GG\((II|,,II|,,II|,,HHl**HHl**JJ..JJ..LL,22MM<44JJ--& 77"((	xx!!Q& , < <RWW , < <RWW88299	xx""a'!-!>!>RXX!-!>!>RXX **neY	7 H +/0415%!$!} }@2j6r HL L^ HU UrN Nb"K\#LV/r9O 9x(
R Rj
B:(8M` F	"3J2

Dr]   