zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
U
¬ý°d¶³ã@sFddlmZddlZddlmZmZddlZddlm    Z    ddl
m Z ddl m mZddlmZddlmZmZmZmZmZmZmZmZddlmZmZmZdd    lm Z ddl!Z"dd
l!m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.dd l/m0Z0m1Z1m2Z2m3Z3m4Z4dd l5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<dmdddddœdd„Z=dd„Z>dndddœdd „Z?dod!d!d"ddddddd#dd$œ d%d&„Z@dpd"d#dd(œd)d*„ZAdqd#d#dd,œd-d.„ZBdd/œd0d1„ZCdd/œd2d3„ZDdrddd#dd5œd6d7„ZEdsdd#dd(œd9d:„ZFdtd#dd<œd=d>„ZGdud#ddd@œdAdB„ZHdvd#ddd@œdDdE„ZIdwdFdG„ZJdxddd#ddJœdKdL„ZKdyddddd#ddNœdOdP„ZLdzddHdRœddddddddddddd#ddddSœdTdU„ZMd{ddddddddddddddd#ddWœdXdY„ZNdd/œdZd[„ZOdd/œd\d]„ZPdd/œd^d_„ZQdd/œd`da„ZRdd/œdbdc„ZSdQddddddeœdfdg„ZTd|dhdiddjœdkdl„ZUdS)}é)Ú annotationsN)ÚLiteralÚcast)Úis_matching_na)Ú SparseIndex)Úcompare_mismatched_resolutions)Úis_boolÚis_categorical_dtypeÚis_extension_array_dtypeÚis_integer_dtypeÚis_interval_dtypeÚ    is_numberÚis_numeric_dtypeÚneeds_i8_conversion)ÚCategoricalDtypeÚDatetimeTZDtypeÚ PandasDtype)Úarray_equivalent)
Ú CategoricalÚ    DataFrameÚ DatetimeIndexÚIndexÚ IntervalIndexÚ
MultiIndexÚ PeriodIndexÚ
RangeIndexÚSeriesÚTimedeltaIndex)Útake_nd)Ú DatetimeArrayÚExtensionArrayÚ IntervalArrayÚ PeriodArrayÚTimedeltaArray)ÚDatetimeLikeArrayMixin)Ú StringDtype)Úsafe_sort_index)Ú pprint_thingÚequivçñh㈵øä>ç:Œ0âŽyE>zbool | Literal['equiv']ÚfloatÚNone)Ú check_dtypeÚrtolÚatolÚreturncKsôt|tƒr(t||fd|||dœ|—ŽnÈt|tƒrPt||fd|||dœ|—Žn t|tƒrxt||fd|||dœ|—Žnx|rÐt|ƒrŽt|ƒrŽnBt|ƒr t|ƒr n0t|t    j
ƒs¸t|t    j
ƒr¾d}nd}t |||dt j ||ft|ƒ||dœ|—ŽdS)    aØ
    Check that the left and right objects are approximately equal.
 
    By approximately equal, we refer to objects that are numbers or that
    contain numbers which may be equivalent to specific levels of precision.
 
    Parameters
    ----------
    left : object
    right : object
    check_dtype : bool or {'equiv'}, default 'equiv'
        Check dtype if both a and b are the same type. If 'equiv' is passed in,
        then `RangeIndex` and `Index` with int64 dtype are also considered
        equivalent when doing type checking.
    rtol : float, default 1e-5
        Relative tolerance.
 
        .. versionadded:: 1.1.0
    atol : float, default 1e-8
        Absolute tolerance.
 
        .. versionadded:: 1.1.0
    F)Ú check_exactÚexactr.r/)r1r-r.r/ú numpy arrayÚInput©Úobj)r-r.r/N)Ú
isinstancerÚassert_index_equalrÚassert_series_equalrÚassert_frame_equalr rÚnpÚndarrayÚassert_class_equalÚ_testingÚassert_almost_equalÚbool)ÚleftÚrightr-r.r/Úkwargsr6©rDúPd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/_testing/asserters.pyr?=sn
þúù
 
þúù
 
þúù ÿÿÿr?cCsZ|j}t||ƒs.t|›d|›dt|ƒ›dƒ‚t||ƒsVt|›d|›dt|ƒ›dƒ‚dS)aª
    Helper method for our assert_* methods that ensures that
    the two objects being compared have the right type before
    proceeding with the comparison.
 
    Parameters
    ----------
    left : The first object being compared.
    right : The second object being compared.
    cls : The class type to check against.
 
    Raises
    ------
    AssertionError : Either `left` or `right` is not an instance of `cls`.
    z Expected type z, found z insteadN)Ú__name__r7ÚAssertionErrorÚtype)rArBÚclsZcls_namerDrDrEÚ_check_isinstance“s
ÿ
ÿrJTr@)Ú compare_keysr0cCs t||tƒtj|||ddS)N)rK)rJÚdictr>Úassert_dict_equal)rArBrKrDrDrErM¯s rMrz
bool | strÚstr) rArBr2Ú check_namesr1Úcheck_categoricalÚ check_orderr.r/r6r0c
 s¬d}
ddddœ‡‡fdd„ } dd    „} t||tƒ| |||    d
|j|jkr‚|    ›d } |j›d |›}|j›d |›}t|    | ||ƒt|ƒt|ƒkrÎ|    ›d } t|ƒ›d |›}t|ƒ›d |›}t|    | ||ƒ|sât|ƒ}t|ƒ}|jdkrftt|ƒ}tt|ƒ}t|jƒD]X}| ||ƒ}| ||ƒ}d|›d}t    ||ˆ|||||d| |j
||j
||    d
q |r舐rè|  |¡s|j |j k}t |ƒr¤td|ƒ d¡}t | t¡¡dt|ƒ}|    ›dt |d¡›d}t|    |||ƒn&tˆƒ}tj|j|j||||    ||d|r$td|||    d
t|tƒs<t|tƒrLtd|||    d
t|tƒsdt|tƒrrt|j |j ƒˆr¨t|jƒst|jƒr¨t|j |j |    ›dd
dS)aÎ
    Check that left and right Index are equal.
 
    Parameters
    ----------
    left : Index
    right : Index
    exact : bool or {'equiv'}, default 'equiv'
        Whether to check the Index class, dtype and inferred_type
        are identical. If 'equiv', then RangeIndex can be substituted for
        Index with an int64 dtype as well.
    check_names : bool, default True
        Whether to check the names attribute.
    check_exact : bool, default True
        Whether to compare number exactly.
    check_categorical : bool, default True
        Whether to compare internal Categorical exactly.
    check_order : bool, default True
        Whether to compare the order of index entries as well as their values.
        If True, both indexes must contain the same elements, in the same order.
        If False, both indexes must contain the same elements, but in any order.
 
        .. versionadded:: 1.2.0
    rtol : float, default 1e-5
        Relative tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    atol : float, default 1e-8
        Absolute tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    obj : str, default 'Index'
        Specify object name being compared, internally used to show appropriate
        assertion message.
 
    Examples
    --------
    >>> from pandas import testing as tm
    >>> a = pd.Index([1, 2, 3])
    >>> b = pd.Index([1, 2, 3])
    >>> tm.assert_index_equal(a, b)
    TrrNr,©r6r0cszˆsdSt||ˆ|dtd|||dt|jƒrft|jƒrfˆrbtd|||dt|j|jˆddStd|||ddS)N)r2r6Z inferred_typer5Údtype)r2)r=Úassert_attr_equalr    rSr8Ú
categories©rArBr6©rPr2rDrEÚ _check_typesìsz(assert_index_equal.<locals>._check_typescSs:|j|}|j|}t|j||jd}|j||j|dS)N)Ú
fill_value)Úname)ÚlevelsÚcodesrÚ_valuesZ    _na_valueZ _shallow_copyÚnames)ÚindexÚlevelÚuniqueZ level_codesZfilledrDrDrEÚ_get_ilevel_valuesüs
 
z.assert_index_equal.<locals>._get_ilevel_valuesr5z levels are differentú, z length are differentézMultiIndex level [ú])r2rOr1r.r/r6r çY@ú values are different (éú %))r.r/r-r6ÚlobjZrobjr^Úfreqú     categoryN)r) rJrZnlevelsÚraise_assert_detailÚlenr&rrÚranger8r[Úequalsr]r
Zfillnar;ÚsumZastypeÚintÚroundr@r>r?ÚvaluesrTr7rrÚassert_interval_array_equalr    rSÚassert_categorical_equal)rArBr2rOr1rPrQr.r/r6Ú__tracebackhide__rXrbÚmsg1Úmsg2Zmsg3r`ZllevelZrlevelrjZmismatchÚdiffÚmsgZ
exact_boolrDrWrEr8´s€6  
 
 
 
 
 
 ø    
ø r8r4)r2r6r0cCspd}dd„}dddœdd„}t|ƒt|ƒkr0d    S|d
krL||ƒrL||ƒrLd    S|›d }t||||ƒ||ƒƒd    S) z#
    Checks classes are equal.
    TcSst|tƒr|St|ƒjS)N)r7rrHrF)ÚxrDrDrEÚ
repr_classbs
z&assert_class_equal.<locals>.repr_classrr@)Úidxr0cSst|ƒtkpt|tƒS)zµClasses that are a RangeIndex (sub-)instance or exactly an `Index` .
 
        This only checks class equivalence. There is a separate check that the
        dtype is int64.
        )rHrr7r)r~rDrDrEÚis_class_equivisz*assert_class_equal.<locals>.is_class_equivNr(z classes are different)rHrm)rArBr2r6rwr}rr{rDrDrEr=Zs
r=Ú
Attributes)Úattrr6r0c    Cs¢d}t||ƒ}t||ƒ}||ks*t||ƒr.dSz ||k}Wntk
rRd}YnX|tjk|tjkArnd}nt|tƒs€| ¡}|sžd|›d}t||||ƒdS)aO
    Check attributes are equal. Both objects must have attribute.
 
    Parameters
    ----------
    attr : str
        Attribute name being compared.
    left : object
    right : object
    obj : str, default 'Attributes'
        Specify object name being compared, internally used to show appropriate
        assertion message
    TNFz Attribute "z" are different)    ÚgetattrrÚ    TypeErrorÚpdZNAr7r@Úallrm)    rrArBr6rwZ    left_attrZ
right_attrÚresultr{rDrDrErT|s"
 
 
 
 rT)r0cCsŠddlm}t|ttjfƒrX| ¡D]0}dtt|ƒj    ƒ›}t||j
t fƒs$t |ƒ‚q$n.dtt|ƒj    ƒ›}t||j tt fƒs†t |ƒ‚dS)NrzBone of 'objs' is not a matplotlib Axes instance, type encountered zoobjs is neither an ndarray of Artist instances nor a single ArtistArtist instance, tuple, or dict, 'objs' is a )Zmatplotlib.pyplotZpyplotr7rr;r<ZravelÚreprrHrFZAxesrLrGZArtistÚtuple)ÚobjsZpltÚelr{rDrDrEÚ"assert_is_valid_plot_return_object£s  ÿÿr‹cCs.t|ttfƒr|j}t|t t |¡¡ƒdS)z#Assert that the sequence is sorted.N)r7rrrtÚassert_numpy_array_equalr;ÚsortÚarray)ÚseqrDrDrEÚassert_is_sorted¶srr)r-Úcheck_category_orderr6r0cCsøt||tƒt|jtƒs$t|jtƒr*d}nd}|rht|j|j|›d|dt|j|j||›ddn|z|j ¡}|j ¡}Wn"t    k
r¢|j|j}}YnXt|||›d|dt|j 
|j¡|j 
|j¡|›d|dt d|||d    d
S) a}
    Test that Categoricals are equivalent.
 
    Parameters
    ----------
    left : Categorical
    right : Categorical
    check_dtype : bool, default True
        Check that integer dtype of the codes are the same.
    check_category_order : bool, default True
        Whether the order of the categories should be compared, which
        implies identical integer codes.  If False, only the resulting
        values are compared.  The ordered attribute is
        checked regardless.
    obj : str, default 'Categorical'
        Specify object name being compared, internally used to show appropriate
        assertion message.
    r(Tz .categories)r6r2z.codes©r-r6z.valuesZorderedr5N) rJrr7rUrr8rŒr\Z sort_valuesrƒZtakerT)rArBr-r‘r6r2ÚlcÚrcrDrDrErv¾sB ÿÿÿ
  ürvr!cCszt||tƒi}|jjjdkr&d|d<t|j|jfd|›di|—Žt|j|jfd|›di|—Žtd|||ddS)    a
    Test that two IntervalArrays are equivalent.
 
    Parameters
    ----------
    left, right : IntervalArray
        The IntervalArrays to compare.
    exact : bool or {'equiv'}, default 'equiv'
        Whether to check the Index class, dtype and inferred_type
        are identical. If 'equiv', then RangeIndex can be substituted for
        Index with an int64 dtype as well.
    obj : str, default 'IntervalArray'
        Specify object name being compared, internally used to show appropriate
        assertion message
    )ÚmÚMFÚ
check_freqr6z.leftÚclosedr5N)rJr!Ú_leftrSÚkindÚ assert_equalZ_rightrT)rArBr2r6rCrDrDrEruûs   rur"rRcCs8t||tƒt|j|j|›ddtd|||ddS)Nú    ._ndarrayr5rk)rJr"rŒÚ_ndarrayrTrVrDrDrEÚassert_period_array_equals ržr)r6r—r0cCsPd}t||tƒt|j|j|›dd|r<td|||dtd|||ddS)NTrœr5rkÚtz)rJrrŒrrT©rArBr6r—rwrDrDrEÚassert_datetime_array_equal!s  r¡r#cCs@d}t||tƒt|j|j|›dd|r<td|||ddS)NTrœr5rk)rJr#rŒrrTr rDrDrEÚassert_timedelta_array_equal-s
 r¢c    CsØd}|›d|›}t|tjƒr0|dt|ƒ›7}t|tjƒrFt|ƒ}nt|tttfƒr^t|ƒ}t|tjƒrtt|ƒ}nt|tttfƒrŒt|ƒ}|d|›d|›7}|dk    r¶|d|›7}|dk    rÌ|d|›7}t|ƒ‚dS)NTz are different
 
z
 
[index]: z
 
[left]:  z
 
[right]: z    
[diff]: Ú
)    r7r;r<r'rrr%r‡rG)    r6ÚmessagerArBrzZ
first_diffÚ index_valuesrwr{rDrDrErm7s0þ  
 
ÿþrmFr3)Ú
strict_nanr-r6r0c sèd}t||ˆdt||tjƒdd„}    |    |ƒ}
|    |ƒ} |dkrd|
| k    rŽtt|
ƒ›dt| ƒ›ƒ‚n*|dkrŽ|
| krŽtt|
ƒ›dt| ƒ›ƒ‚‡‡‡fd    d
„} t||ˆd s¸| |||ƒ|rät|tjƒrät|tjƒrätd ||ˆdd S)a+
    Check that 'np.ndarray' is equivalent.
 
    Parameters
    ----------
    left, right : numpy.ndarray or iterable
        The two arrays to be compared.
    strict_nan : bool, default False
        If True, consider NaN and None to be different.
    check_dtype : bool, default True
        Check dtype if both a and b are np.ndarray.
    err_msg : str, default None
        If provided, used as assertion message.
    check_same : None|'copy'|'same', default None
        Ensure left and right refer/do not refer to the same memory area.
    obj : str, default 'numpy array'
        Specify object name being compared, internally used to show appropriate
        assertion message.
    index_values : numpy.ndarray, default None
        optional index (shared by both left and right), used in output.
    Tr5cSst|ddƒdk    r|jS|S)NÚbase)r‚r§r5rDrDrEÚ    _get_basesz+assert_numpy_array_equal.<locals>._get_baseZsamez is not Úcopyz is csž|dkr’|j|jkr,tˆˆ›d|j|jƒd}t||ƒD]\}}t||ˆds:|d7}q:|d|j}ˆ›dt |d¡›d}tˆ|||ˆd    t|ƒ‚dS)
Nz shapes are differentr©r¦rdrfrgrhri)r¥)ÚshapermÚziprÚsizer;rsrG)rArBÚerr_msgrzZleft_arrZ    right_arrr{©r¥r6r¦rDrEÚ_raiseŽs  ÿ
z(assert_numpy_array_equal.<locals>._raiserªrSN)    r=rJr;r<rGr‡rr7rT) rArBr¦r-r®Z
check_samer6r¥rwr¨Z    left_baseZ
right_baser°rDr¯rErŒZs$ rŒr )r-r1r.r/r6r0c    Cs¨t|tƒstdƒ‚t|tƒs$tdƒ‚|r>td||d|›dt|tƒrt|tƒrt|ƒt|ƒkr|sö|jjdkröt|jtjƒs–t    t
|jƒj }nt  |j¡d}t|jtjƒsÄt    t
|jƒj }    nt  |j¡d}    ||    kröt |j|jtjƒ ¡rödStt |j¡t |j¡||d    dSt | ¡¡}
t | ¡¡} t|
| |›d
|d ||
jtd } || jtd } |rˆt| | ||d ntj| | t|ƒ||||d dS)a"
    Check that left and right ExtensionArrays are equal.
 
    Parameters
    ----------
    left, right : ExtensionArray
        The two arrays to compare.
    check_dtype : bool, default True
        Whether to check if the ExtensionArray dtypes are identical.
    index_values : numpy.ndarray, default None
        Optional index (shared by both left and right), used in output.
    check_exact : bool, default False
        Whether to compare number exactly.
    rtol : float, default 1e-5
        Relative tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    atol : float, default 1e-8
        Absolute tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    obj : str, default 'ExtensionArray'
        Specify object name being compared, internally used to show appropriate
        assertion message.
 
        .. versionadded:: 2.0.0
 
    Notes
    -----
    Missing values are checked separately from valid values.
    A mask of missing values is computed for each and checked to match.
    The remaining all-valid values are cast to object dtype and checked.
 
    Examples
    --------
    >>> from pandas import testing as tm
    >>> a = pd.Series([1, 2, 3, 4])
    >>> b, c = a.array, a.array
    >>> tm.assert_extension_array_equal(b, c)
    zleft is not an ExtensionArrayzright is not an ExtensionArrayrSúAttributes of r5ZmMrN)r¥r6z NA mask)r6r¥)rS)r-r.r/r6r¥)r7r rGrTr$rHrSršr;rrÚunitZ datetime_datarrÚoperatorÚeqr…rŒÚasarrayZasi8ZisnaZto_numpyÚobjectr>r?r@)rArBr-r¥r1r.r/r6Zl_unitZr_unitZleft_naZright_naZ
left_validZ right_validrDrDrEÚassert_extension_array_equalªsv2ÿþýÿÿþ
 
üÿÿùr·r)Ú check_indexÚ
check_like)r-Úcheck_index_typeÚcheck_series_typerOr1Úcheck_datetimelike_compatrPr‘r—Ú check_flagsr.r/r6r¸r¹r0c Csôd}|s|rtdƒ‚t||tƒ|r2t|||dt|ƒt|ƒkrxt|ƒ›d|j›}t|ƒ›d|j›}t|d||ƒ| r¦|j|jks¦tt    |jƒ›dt    |jƒ›ƒ‚|rÒt
|j|j||||| | | |›dd
|rà|  |¡}|
r"t |jt tfƒr"|j}|j}|j|jks"t|j|jfƒ‚|rbt |jtƒrLt |jtƒrL|sLntd    ||d
|›d|ræt|jƒræt|jƒræ|j}|j}t |tƒrÄt |tƒrÄt|||t |j¡t|ƒd nt|||t|ƒt |j¡d n¸|r>t|jƒst|jƒr>t|jƒ t|jƒ¡sžd |j›d|j›d}t|ƒ‚n`t|jƒrht|jƒrht|j |j ƒn6t |jtƒs„t |jtƒr²t!j"|j|j| | t#|ƒt|ƒt |j¡dnìt$|jƒròt$|jƒròt|j|j| | |t |j¡t|ƒdn¬t%|j|jƒst%|j|jƒr6t|j|j|t |j¡t|ƒd nht|jƒrrt|jƒrrt|j|j|t |j¡t|ƒd n,t!j"|j|j| | t#|ƒt|ƒt |j¡d|r´td|||d|rðt |jtƒsÖt |jtƒrðt&|j|j|›d|    ddS)a¦
    Check that left and right Series are equal.
 
    Parameters
    ----------
    left : Series
    right : Series
    check_dtype : bool, default True
        Whether to check the Series dtype is identical.
    check_index_type : bool or {'equiv'}, default 'equiv'
        Whether to check the Index class, dtype and inferred_type
        are identical.
    check_series_type : bool, default True
         Whether to check the Series class is identical.
    check_names : bool, default True
        Whether to check the Series and Index names attribute.
    check_exact : bool, default False
        Whether to compare number exactly.
    check_datetimelike_compat : bool, default False
        Compare datetime-like which is comparable ignoring dtype.
    check_categorical : bool, default True
        Whether to compare internal Categorical exactly.
    check_category_order : bool, default True
        Whether to compare category order of internal Categoricals.
 
        .. versionadded:: 1.0.2
    check_freq : bool, default True
        Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
 
        .. versionadded:: 1.1.0
    check_flags : bool, default True
        Whether to check the `flags` attribute.
 
        .. versionadded:: 1.2.0
 
    rtol : float, default 1e-5
        Relative tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    atol : float, default 1e-8
        Absolute tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    obj : str, default 'Series'
        Specify object name being compared, internally used to show appropriate
        assertion message.
    check_index : bool, default True
        Whether to check index equivalence. If False, then compare only values.
 
        .. versionadded:: 1.3.0
    check_like : bool, default False
        If True, ignore the order of the index. Must be False if check_index is False.
        Note: same labels must be with the same data.
 
        .. versionadded:: 1.5.0
 
    Examples
    --------
    >>> from pandas import testing as tm
    >>> a = pd.Series([1, 2, 3, 4])
    >>> b = pd.Series([1, 2, 3, 4])
    >>> tm.assert_series_equal(a, b)
    Tz0check_like must be False if check_index is Falser5rczSeries length are differentú != ú.index©r2rOr1rPrQr.r/r6rSr±)r-r¥r6)r-r6r¥zatetimelike_compat=True] z is not equal to Ú.)r.r/r-r6r¥)r.r/r-r¥r6rZrl)r6r‘N)'Ú
ValueErrorrJrr=rnr_rmÚflagsrGr‡r8Ú reindex_liker7rrrkrSrrTrr]r r·r;rµrNrŒrrrpr rurŽr>r?r@r
Ú0is_extension_array_dtype_and_needs_i8_conversionrv)rArBr-rºr»rOr1r¼rPr‘r—r½r.r/r6r¸r¹rwrxryZlidxZridxZ left_valuesZ right_valuesr{rDrDrEr9sS *ö 
 
ÿ
þýÿ
û
û
ÿÿ    ÿ ÿ
ù    
ù    ÿ þ
û
û
ù ÿür9r)r-rºÚcheck_column_typeÚcheck_frame_typerOÚ    by_blocksr1r¼rPr¹r—r½r.r/r6r0cCsÂd}t||tƒ|r&t|t|ƒƒs&t‚|j|jkrVt||›dt|jƒ›t|jƒ›ƒ| r„|j|jks„tt|jƒ›dt|jƒ›ƒ‚t    |j
|j
||||
| |||›dd
t    |j |j ||||
| |||›dd
| râ|  |¡}|rV|  ¡}|  ¡}ttt| ¡ƒt| ¡ƒƒƒD]:}||ks*t‚||ks8t‚t||||||dqnht|j ƒD]\\}}|j|dd    }|j|dd    }t|||||||    |
| |›d
|›d |›d ||d d dq`dS)a]
    Check that left and right DataFrame are equal.
 
    This function is intended to compare two DataFrames and output any
    differences. It is mostly intended for use in unit tests.
    Additional parameters allow varying the strictness of the
    equality checks performed.
 
    Parameters
    ----------
    left : DataFrame
        First DataFrame to compare.
    right : DataFrame
        Second DataFrame to compare.
    check_dtype : bool, default True
        Whether to check the DataFrame dtype is identical.
    check_index_type : bool or {'equiv'}, default 'equiv'
        Whether to check the Index class, dtype and inferred_type
        are identical.
    check_column_type : bool or {'equiv'}, default 'equiv'
        Whether to check the columns class, dtype and inferred_type
        are identical. Is passed as the ``exact`` argument of
        :func:`assert_index_equal`.
    check_frame_type : bool, default True
        Whether to check the DataFrame class is identical.
    check_names : bool, default True
        Whether to check that the `names` attribute for both the `index`
        and `column` attributes of the DataFrame is identical.
    by_blocks : bool, default False
        Specify how to compare internal data. If False, compare by columns.
        If True, compare by blocks.
    check_exact : bool, default False
        Whether to compare number exactly.
    check_datetimelike_compat : bool, default False
        Compare datetime-like which is comparable ignoring dtype.
    check_categorical : bool, default True
        Whether to compare internal Categorical exactly.
    check_like : bool, default False
        If True, ignore the order of index & columns.
        Note: index labels must match their respective rows
        (same as in columns) - same labels must be with the same data.
    check_freq : bool, default True
        Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
 
        .. versionadded:: 1.1.0
    check_flags : bool, default True
        Whether to check the `flags` attribute.
    rtol : float, default 1e-5
        Relative tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    atol : float, default 1e-8
        Absolute tolerance. Only used when check_exact is False.
 
        .. versionadded:: 1.1.0
    obj : str, default 'DataFrame'
        Specify object name being compared, internally used to show appropriate
        assertion message.
 
    See Also
    --------
    assert_series_equal : Equivalent method for asserting Series equality.
    DataFrame.equals : Check DataFrame equality.
 
    Examples
    --------
    This example shows comparing two DataFrames that are equal
    but with columns of differing dtypes.
 
    >>> from pandas.testing import assert_frame_equal
    >>> df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
    >>> df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})
 
    df1 equals itself.
 
    >>> assert_frame_equal(df1, df1)
 
    df1 differs from df2 as column 'b' is of a different type.
 
    >>> assert_frame_equal(df1, df2)
    Traceback (most recent call last):
    ...
    AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="b") are different
 
    Attribute "dtype" are different
    [left]:  int64
    [right]: float64
 
    Ignore differing dtypes in columns with check_dtype.
 
    >>> assert_frame_equal(df1, df2, check_dtype=False)
    Tz shape mismatchr¾r¿rÀz.columnsr’rd)Zaxisz    .iloc[:, z] (column name="z")F) r-rºr1rOr¼rPr—r6r.r/r¸r½N)rJrr7rHrGr«rmr‡rÃr8r_ÚcolumnsrÄZ_to_dict_of_blocksÚlistÚsetÚkeysr:Ú    enumerateZ_ixsr9)rArBr-rºrÆrÇrOrÈr1r¼rPr¹r—r½r.r/r6rwZrblocksZlblocksrSÚiÚcolZlcolZrcolrDrDrEr:sŒo  
 
ÿ*öö 
$ÿ òr:cKsfd}t|tƒrJt||f|Žt|ttfƒrF|j|jksFt|j|jfƒ‚nt|tƒrdt||f|Žnþt|t    ƒr~t
||f|Žnät|t ƒr˜t ||f|ŽnÊt|t ƒr²t||f|Žn°t|tƒrÌt||f|Žn–t|tƒræt||f|Žn|t|tƒrt||f|Žn`t|tjƒr t||f|ŽnBt|tƒrJ|iks:t‚||ksbt‚n|iksXt‚t||ƒdS)aC
    Wrapper for tm.assert_*_equal to dispatch to the appropriate test function.
 
    Parameters
    ----------
    left, right : Index, Series, DataFrame, ExtensionArray, or np.ndarray
        The two items to be compared.
    **kwargs
        All keyword arguments are passed through to the underlying assert method.
    TN)r7rr8rrrkrGrr9rr:r!rur"ržrr¡r#r¢r r·r;r<rŒrNr?)rArBrCrwrDrDrEr›Ús4 
 
 
 
 
 
 
  r›cCs’t||tjjƒt|j|jƒt|jtƒs.t    ‚t|jtƒs>t    ‚|j}|j}| 
|¡sdt dd||ƒnt d||ƒt d||ƒt|  ¡|  ¡ƒdS)zŒ
    Check that the left and right SparseArray are equal.
 
    Parameters
    ----------
    left : SparseArray
    right : SparseArray
    zSparseArray.indexzindex are not equalrYrSN)rJr„ZarraysZ SparseArrayrŒZ    sp_valuesr7Zsp_indexrrGrprmrTZto_dense)rArBZ
left_indexZ right_indexrDrDrEÚassert_sp_array_equals     
ÿ  rÐcCs(|D]}||kstdt|ƒ›ƒ‚qdS)NzDid not contain item: )rGr‡)ÚiterableZdicÚkrDrDrEÚassert_contains_all$srÓcKsXt||ƒD]H\}}t||f|Ždtt|ƒƒ›dtt|ƒƒ›d}||k    s
t|ƒ‚q
dS)zï
    iter1, iter2: iterables that produce elements
    comparable with assert_almost_equal
 
    Checks that the elements are equal, but not
    the same object. (Does not check that items
    in sequences are also not the same object)
    zExpected object z  and object z8 to be different objects, but they were the same object.N)r¬r?r‡rHrG)Ziter1Ziter2Z
eql_kwargsZelem1Zelem2r{rDrDrEÚ assert_copy)s
     ÿrÔcCst|ƒot|ƒS)z¸
    Checks that we have the combination of an ExtensionArraydtype and
    a dtype that should be converted to int64
 
    Returns
    -------
    bool
 
    Related to issue #37609
    )r
r)Z
left_dtypeZ right_dtyperDrDrErÅ;s rÅÚslice)ÚserÚl_slcÚi_slcr0cCs6|j|}t|j||ƒt|jƒs2t|||ƒdS)z_
    Check that ser.iloc[i_slc] matches ser.loc[l_slc] and, if applicable,
    ser[l_slc].
    N)Zilocr9Úlocr r_)rÖr×rØÚexpectedrDrDrEÚ!assert_indexing_slices_equivalentIs
 
rÛzDataFrame | SerieszDataFrame | Series | None)rArBr0cCsF|jD]:}t||dƒ}|dkr,|dks@t‚q|t||dƒkst‚qdS)z:
    Check that ._metadata attributes are equivalent.
    N)Ú    _metadatar‚rG)rArBrÚvalrDrDrEÚassert_metadata_equivalentWs
 
 rÞ)r(r)r*)T)r(TTTTr)r*r)Tr4)r€)TTr)r(r!)r")rT)r#T)NNN)FTNNr3N)TNFr)r*r ) Tr(TTFFTTTTr)r*r)Tr(r(TTFFFTFTTr)r*r)N)VÚ
__future__rr³ÚtypingrrÚnumpyr;Zpandas._libs.missingrZpandas._libs.sparserZpandas._libs.testingZ_libsZtestingr>Zpandas._libs.tslibs.np_datetimerZpandas.core.dtypes.commonrr    r
r r r rrZpandas.core.dtypes.dtypesrrrZpandas.core.dtypes.missingrZpandasr„rrrrrrrrrrZpandas.core.algorithmsrZpandas.core.arraysrr r!r"r#Zpandas.core.arrays.datetimeliker$Zpandas.core.arrays.string_r%Zpandas.core.indexes.apir&Zpandas.io.formats.printingr'r?rJrMr8r=rTr‹rrvruržr¡r¢rmrŒr·r9r:r›rÐrÓrÔrÅrÛrÞrDrDrDrEÚ<module>sæ    (
 0     ûVö$(ÿ"' û>ÿÿ ÿ ÿ
&øSøsñî0{ï.J)!ÿ