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
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
Ë
nñúhŒ×ãóR—dZddlmZddlZddlZddlmZddlmZm    Z    m
Z
ddl Z ddl Z ddlmZmZmZmZddlmZmZmZmZmZmZddlmZdd    lmZdd
lm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1dd l2m3Z3dd l4m5Z5m6Z6m7Z7m8Z8ddl9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?ddl@mAZAmBZBddlCmDZDddlEmFZGmHZHmIZIddlJmKZKerddlmLZLmMZMmNZNddlOmPZPmQZQmRZRddlSmTZTmUZUd6d„ZV                                d7d„ZWd8d„ZXej²ej´ej¶ej¸ejºej¼ej¾ejÀejÂejÄejÆejÈejÊejÌdœZgd9d„Zhd:d„Zid„Zjd;d„Zkd<d=d„ZlejZmdZnd>d „Zo                d?                                            d@d!„Zpeed"«ed#«ed$«¬%«            dA                            dBd&„«Zq                    dC                                    dDd'„Zr                    dC                                    dDd(„Zs    d<                            dEd)„Zt        dF                            dGd*„Zu    dH                            dId+„Zv                    dJ                                                    dKd,„Zw            dL                    dMd-„Zx        dN                                    dOd.„Zyhd/£ZzdPdQd0„Z{                dR                                            dSd1„Z|dTd2„Z}dUd3„Z~                        dVd4„Z        dW                            dXd5„Z€y)Yzl
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
é)Ú annotationsN)Údedent)Ú TYPE_CHECKINGÚLiteralÚcast)ÚalgosÚ    hashtableÚiNaTÚlib)Ú AnyArrayLikeÚ    ArrayLikeÚAxisIntÚDtypeObjÚ TakeIndexerÚnpt)Údoc)Úfind_stack_level)Ú'construct_1d_object_array_from_listlikeÚnp_find_common_type)Úensure_float64Ú ensure_objectÚensure_platform_intÚ is_array_likeÚ is_bool_dtypeÚis_complex_dtypeÚ is_dict_likeÚis_extension_array_dtypeÚis_float_dtypeÚ
is_integerÚis_integer_dtypeÚ is_list_likeÚis_object_dtypeÚis_signed_integer_dtypeÚneeds_i8_conversion)Ú concat_compat)ÚBaseMaskedDtypeÚCategoricalDtypeÚExtensionDtypeÚ NumpyEADtype)ÚABCDatetimeArrayÚABCExtensionArrayÚABCIndexÚ ABCMultiIndexÚ    ABCSeriesÚABCTimedeltaArray)ÚisnaÚna_value_for_dtype)Útake_nd)ÚarrayÚensure_wrapped_if_datetimelikeÚ extract_array)Úvalidate_indices)ÚListLikeÚ NumpySorterÚNumpyValueArrayLike)Ú CategoricalÚIndexÚSeries)ÚBaseMaskedArrayÚExtensionArraycóÌ—t|t«s t|d¬«}t|j«rt t j|««St|jt«rBtd|«}|jst|j«St j|«St|jt«rtd|«}|jSt|j«rdt|t j «r$t j|«j#d«St j|«j%dd¬«St'|j«rt j|«St)|j«r8|jj*dvr t-|«St j|«St/|j«rtt j |«St1|j«r-|j#d    «}tt j |«}|St j|t2¬
«}t |«S) a„
    routine to ensure that our data is of the correct
    input dtype for lower-level routines
 
    This will coerce:
    - ints -> int64
    - uint -> uint64
    - bool -> uint8
    - datetimelike -> i8
    - datetime64tz -> i8 (in local tz)
    - categorical -> codes
 
    Parameters
    ----------
    values : np.ndarray or ExtensionArray
 
    Returns
    -------
    np.ndarray
    T©Ú extract_numpyr=r:Úuint8F©Úcopy)éé éÚi8©Údtype)Ú
isinstancer-r5r"rJrÚnpÚasarrayr&rÚ_hasnaÚ _ensure_dataÚ_datar'ÚcodesrÚndarrayÚviewÚastyper rÚitemsizerrr$Úobject)ÚvaluesÚnpvaluess  úIH:\Change_password\venv_build\Lib\site-packages\pandas/core/algorithms.pyrOrOjs¸€ô, fœmÔ ,ä˜v°TÔ:ˆäv—|‘|Ô$ÜœRŸZ™Z¨Ó/Ó0Ð0ä    F—L‘L¤/Ô    2äÐ'¨Ó0ˆØ}Š}ô  § ¡ Ó-Ð -܏z‰z˜&Ó!Ð!ä    F—L‘LÔ"2Ô    3ôm VÓ,ˆØ|‰|Ðä    v—|‘|Ô    $Ü fœbŸj™jÔ )ä—:‘:˜fÓ%×*Ñ*¨7Ó3Ð 3ô—:‘:˜fÓ%×,Ñ,¨W¸5Ð,ÓAÐ Aä    ˜&Ÿ,™,Ô    '܏z‰z˜&Ó!Ð!ä    ˜Ÿ ™ Ô    %ð <‰<×  Ñ   KÑ /ä! &Ó)Ð )܏z‰z˜&Ó!Ð!ä    ˜&Ÿ,™,Ô    'Ü”B—J‘J Ó'Ð'ô
˜VŸ\™\Ô    *Ø—;‘;˜tÓ$ˆÜœŸ
™
 HÓ-ˆØˆôZ‰Z˜¤fÔ -€FÜ ˜Ó  Ð ócóì—t|t«r|j|k(r|St|tj«s%|j    «}|j ||¬«}|S|j |d¬«}|S)zç
    reverse of _ensure_data
 
    Parameters
    ----------
    values : np.ndarray or ExtensionArray
    dtype : np.dtype or ExtensionDtype
    original : AnyArrayLike
 
    Returns
    -------
    ExtensionArray or np.ndarray
    rIFrC)rKr+rJrLÚconstruct_array_typeÚ_from_sequencerT)rWrJÚoriginalÚclss    rYÚ_reconstruct_datar`¸sr€ô &Ô+Ô,°·±ÀÒ1Fàˆ ä eœRŸX™XÔ &ð×(Ñ(Ó*ˆà×#Ñ# F°%Ð#Ó8ˆð
€M𗑘u¨5Ó1ˆà €MrZcób—t|ttttj
f«s„|dk7r't j|›dtt«¬«tj|d¬«}|dvr(t|t«r t|«}t|«}|St    j|«}|S)z5
    ensure that we are arraylike if not already
    ú isin-targetsz with argument that is not not a Series, Index, ExtensionArray, or np.ndarray is deprecated and will raise in a future version.©Ú
stacklevelF©Úskipna)ÚmixedÚstringú mixed-integer)rKr,r.r+rLrRÚwarningsÚwarnÚ FutureWarningrr Ú infer_dtypeÚtupleÚlistrrM)rWÚ    func_nameÚinferreds   rYÚ_ensure_arraylikerrÙsž€ô fœx¬Ô4EÄrÇzÁzÐRÔ Sà ˜Ò &ä M‰Mؐ+ð"ð"ôÜ+Ó-õ  ô—?‘? 6°%Ô8ˆØ Ð;Ñ ;ä˜&¤%Ô(ܘf›Ü<¸VÓDˆFð €Mô—Z‘Z Ó'ˆFØ €MrZ)Ú
complex128Ú    complex64Úfloat64Úfloat32Úuint64Úuint32Úuint16rBÚint64Úint32Úint16Úint8rhrVcóH—t|«}t|«}t|}||fS)z‰
    Parameters
    ----------
    values : np.ndarray
 
    Returns
    -------
    htable : HashTable subclass
    values : ndarray
    )rOÚ_check_object_for_stringsÚ _hashtables)rWÚndtyper    s   rYÚ_get_hashtable_algor‚s-€ô˜&Ó !€Fä & vÓ .€FܘFÑ#€IØ fÐ ÐrZcón—|jj}|dk(rtj|d¬«rd}|S)z 
    Check if we can use string hashtable instead of object hashtable.
 
    Parameters
    ----------
    values : ndarray
 
    Returns
    -------
    str
    rVFrerh)rJÚnamer Úis_string_array)rWrs  rYrrs7€ð\‰\× Ñ €FØ Òô × Ñ ˜v¨eÕ 4؈FØ €MrZcó—t|«S)a3
 
    Return unique values based on a hash table.
 
    Uniques are returned in order of appearance. This does NOT sort.
 
    Significantly faster than numpy.unique for long enough sequences.
    Includes NA values.
 
    Parameters
    ----------
    values : 1d array-like
 
    Returns
    -------
    numpy.ndarray or ExtensionArray
 
        The return can be:
 
        * Index : when the input is an Index
        * Categorical : when the input is a Categorical dtype
        * ndarray : when the input is a Series/ndarray
 
        Return numpy.ndarray or ExtensionArray.
 
    See Also
    --------
    Index.unique : Return unique values from an Index.
    Series.unique : Return unique values of Series object.
 
    Examples
    --------
    >>> pd.unique(pd.Series([2, 1, 3, 3]))
    array([2, 1, 3])
 
    >>> pd.unique(pd.Series([2] + [1] * 5))
    array([2, 1])
 
    >>> pd.unique(pd.Series([pd.Timestamp("20160101"), pd.Timestamp("20160101")]))
    array(['2016-01-01T00:00:00.000000000'], dtype='datetime64[ns]')
 
    >>> pd.unique(
    ...     pd.Series(
    ...         [
    ...             pd.Timestamp("20160101", tz="US/Eastern"),
    ...             pd.Timestamp("20160101", tz="US/Eastern"),
    ...         ]
    ...     )
    ... )
    <DatetimeArray>
    ['2016-01-01 00:00:00-05:00']
    Length: 1, dtype: datetime64[ns, US/Eastern]
 
    >>> pd.unique(
    ...     pd.Index(
    ...         [
    ...             pd.Timestamp("20160101", tz="US/Eastern"),
    ...             pd.Timestamp("20160101", tz="US/Eastern"),
    ...         ]
    ...     )
    ... )
    DatetimeIndex(['2016-01-01 00:00:00-05:00'],
            dtype='datetime64[ns, US/Eastern]',
            freq=None)
 
    >>> pd.unique(np.array(list("baabc"), dtype="O"))
    array(['b', 'a', 'c'], dtype=object)
 
    An unordered Categorical will return categories in the
    order of appearance.
 
    >>> pd.unique(pd.Series(pd.Categorical(list("baabc"))))
    ['b', 'a', 'c']
    Categories (3, object): ['a', 'b', 'c']
 
    >>> pd.unique(pd.Series(pd.Categorical(list("baabc"), categories=list("abc"))))
    ['b', 'a', 'c']
    Categories (3, object): ['a', 'b', 'c']
 
    An ordered Categorical preserves the category ordering.
 
    >>> pd.unique(
    ...     pd.Series(
    ...         pd.Categorical(list("baabc"), categories=list("abc"), ordered=True)
    ...     )
    ... )
    ['b', 'a', 'c']
    Categories (3, object): ['a' < 'b' < 'c']
 
    An array of tuples
 
    >>> pd.unique(pd.Series([("a", "b"), ("b", "a"), ("a", "c"), ("b", "a")]).values)
    array([('a', 'b'), ('b', 'a'), ('a', 'c')], dtype=object)
    )Úunique_with_mask)rWs rYÚuniquerˆ3s€ô| ˜FÓ #Ð#rZcóÀ—t|«dk(ryt|«}tj|j    «j d««dk7j «}|S)aH
    Return the number of unique values for integer array-likes.
 
    Significantly faster than pandas.unique for long enough sequences.
    No checks are done to ensure input is integral.
 
    Parameters
    ----------
    values : 1d array-like
 
    Returns
    -------
    int : The number of unique values in ``values``
    rÚintp)ÚlenrOrLÚbincountÚravelrTÚsum)rWÚresults  rYÚ nunique_intsr”sO€ô ˆ6ƒ{aÒØÜ ˜&Ó !€Fäk‰k˜&Ÿ,™,›.×/Ñ/°Ó7Ó8¸AÑ=× BÑ BÓ D€FØ €MrZcó’—t|d¬«}t|jt«r|j    «S|}t |«\}}|t |««}|€*|j    |«}t||j|«}|S|j    ||¬«\}}t||j|«}|€J‚||jd«fS)z?See algorithms.unique for docs. Takes a mask for masked arrays.rˆ©rp©ÚmaskÚbool)    rrrKrJr(rˆr‚r‹r`rT)rWr”r^r    ÚtableÚuniquess      rYr‡r‡«s¾€ä ˜v°Ô :€Fä&—,‘,¤Ô/à}‰}‹Ðà€HÜ+¨FÓ3Ñ€Iˆvá ”c˜&“kÓ "€EØ €|Ø—,‘,˜vÓ&ˆÜ# G¨X¯^©^¸XÓFˆØˆðŸ ™  V°$˜ Ó7‰ ˆÜ# G¨X¯^©^¸XÓFˆØÐÐÐØ˜Ÿ ™  FÓ+Ð+Ð+rZi@Bcó—t|«s"tdt|«j›d«‚t|«s"tdt|«j›d«‚t    |t
t ttjf«sUt|«}t|d¬«}t|«dkDrc|jjdvrKt|«s@t!|«}n4t    |t"«rtj$|«}nt'|dd¬«}t|d    ¬«}t'|d¬
«}t    |tj«s|j)|«St+|j«rt-|«j)|«St+|j«r:t/|j«s%tj0|j2t4¬ «St+|j«rt)||j7t8««St    |jt:«r2t)tj<|«tj<|««St|«t>kDrBt|«d kr4|jt8k7r!tA|«jC«rd „}nZd„}nVtE|j|j«}|j7|d¬«}|j7|d¬«}tFjH}|||«S)zÀ
    Compute the isin boolean array.
 
    Parameters
    ----------
    comps : list-like
    values : list-like
 
    Returns
    -------
    ndarray[bool]
        Same length as `comps`.
    zIonly list-like objects are allowed to be passed to isin(), you passed a `ú`rbr’rÚiufcbT)rAÚ extract_rangeÚisinr@rIécó˜—tjtj||«j«tj|««S©N)rLÚ
logical_orrœrÚisnan)ÚcÚvs  rYÚfzisin.<locals>.fs.€Ü—}‘}¤R§W¡W¨Q°£]×%8Ñ%8Ó%:¼B¿H¹HÀQ»KÓHÐHrZcóJ—tj||«j«SrŸ)rLrœr)ÚaÚbs  rYú<lambda>zisin.<locals>.<lambda>s€œRŸW™W Q¨›]×0Ñ0Ó2€rZFrC)%r!Ú    TypeErrorÚtypeÚ__name__rKr,r.r+rLrRrorrr‹rJÚkindr#rr-r3r5rœr$Úpd_arrayr"ÚzerosÚshaper•rTrVr(rMÚ_MINIMUM_COMP_ARR_LENr0ÚanyrÚhtableÚismember)ÚcompsrWÚ orig_valuesÚ comps_arrayr¤Úcommons      rYrœrœÉsj€ô ˜Ô Üð (Ü(,¨U« ×(<Ñ(<Ð'=¸Qð @ó
ð    
ô ˜Ô Üð (Ü(,¨V« ×(=Ñ(=Ð'>¸að Aó
ð    
ô
fœx¬Ô4EÄrÇzÁzÐRÔ Sܘ6“lˆ Ü" ;¸.ÔIˆô ‹K˜!ŠOØ— ‘ ×!Ñ! WÑ,Ü+¨EÔ2ô=¸[ÓI‰Fä    FœMÔ    *ä—‘˜&Ó!‰ä˜v°TÈÔNˆä# E°VÔ<€KÜ  ¸4Ô@€KÜ k¤2§:¡:Ô .à×Ñ Ó'Ð'ä    ˜[×.Ñ.Ô    /ä˜ Ó$×)Ñ)¨&Ó1Ð1Ü    ˜VŸ\™\Ô    *´?À;×CTÑCTÔ3Uäx‰x˜ ×)Ñ)´Ô6Ð6ä    ˜VŸ\™\Ô    *ܐK §¡¬vÓ!6Ó7Ð7ä    F—L‘L¤.Ô    1Ü”B—J‘J˜{Ó+¬R¯Z©Z¸Ó-?Ó@Ð@ô     ˆKÓÔ0Ò0Ü ‹K˜2Ò Ø × Ñ ¤Ò 'ô ‹<× Ñ Ô ó Iñ3‰Aô% V§\¡\°;×3DÑ3DÓEˆØ—‘˜v¨EÓ2ˆØ!×(Ñ(¨°eÐ(Ó<ˆ Ü O‰Oˆá ˆ[˜&Ó !Ð!rZcó—|}|jjdvrt}t|«\}}||xs t    |««}|j |d|||¬«\}}    t ||j|«}t|    «}    |    |fS)a(
    Factorize a numpy array to codes and uniques.
 
    This doesn't do any coercion of types or unboxing before factorization.
 
    Parameters
    ----------
    values : ndarray
    use_na_sentinel : bool, default True
        If True, the sentinel -1 will be used for NaN values. If False,
        NaN values will be encoded as non-negative integers and will not drop the
        NaN from the uniques of the values.
    size_hint : int, optional
        Passed through to the hashtable's 'get_labels' method
    na_value : object, optional
        A value in `values` to consider missing. Note: only use this
        parameter when you know that you don't have any values pandas would
        consider missing in the array (NaN for float data, iNaT for
        datetimes, etc.).
    mask : ndarray[bool], optional
        If not None, the mask is used as indicator for missing values
        (True = missing, False = valid) instead of `na_value` or
        condition "val != val".
 
    Returns
    -------
    codes : ndarray[np.intp]
    uniques : ndarray
    ÚmMéÿÿÿÿ)Ú na_sentinelÚna_valuer”Ú    ignore_na)rJr¬r
r‚r‹Ú    factorizer`r)
rWÚuse_na_sentinelÚ    size_hintr¼r”r^Ú
hash_klassr–r—rQs
          rYÚfactorize_arrayrÂ$s“€ðH€HØ ‡||×јDÑ ô
ˆä,¨VÓ4Ñ€Já yÒ/¤C¨£KÓ 0€EØ—_‘_ØØØØ Ø!ð %óN€GˆUô  ¨¯©¸ÓB€Gä  Ó &€EØ 'ˆ>ÐrZz    values : sequence
        A 1-D sequence. Sequences that aren't pandas objects are
        coerced to ndarrays before factorization.
    zt    sort : bool, default False
        Sort `uniques` and shuffle `codes` to maintain the
        relationship.
    zG    size_hint : int, optional
        Hint to the hashtable sizer.
    )rWÚsortrÀcóÌ—t|ttf«r|j||¬«St    |d¬«}|}t|t
t f«r%|j|j|¬«\}}||fSt|tj«s|j|¬«\}}n„tj|«}|s\|jtk(rIt|«}|j«r.t|jd¬«}tj |||«}t#|||¬«\}}|r!t%|«d    kDrt'|||d
d¬ «\}}t)||j|«}||fS) aN
    Encode the object as an enumerated type or categorical variable.
 
    This method is useful for obtaining a numeric representation of an
    array when all that matters is identifying distinct values. `factorize`
    is available as both a top-level function :func:`pandas.factorize`,
    and as a method :meth:`Series.factorize` and :meth:`Index.factorize`.
 
    Parameters
    ----------
    {values}{sort}
    use_na_sentinel : bool, default True
        If True, the sentinel -1 will be used for NaN values. If False,
        NaN values will be encoded as non-negative integers and will not drop the
        NaN from the uniques of the values.
 
        .. versionadded:: 1.5.0
    {size_hint}
    Returns
    -------
    codes : ndarray
        An integer ndarray that's an indexer into `uniques`.
        ``uniques.take(codes)`` will have the same values as `values`.
    uniques : ndarray, Index, or Categorical
        The unique valid values. When `values` is Categorical, `uniques`
        is a Categorical. When `values` is some other pandas object, an
        `Index` is returned. Otherwise, a 1-D ndarray is returned.
 
        .. note::
 
           Even if there's a missing value in `values`, `uniques` will
           *not* contain an entry for it.
 
    See Also
    --------
    cut : Discretize continuous-valued array.
    unique : Find the unique value in an array.
 
    Notes
    -----
    Reference :ref:`the user guide <reshaping.factorize>` for more examples.
 
    Examples
    --------
    These examples all show factorize as a top-level method like
    ``pd.factorize(values)``. The results are identical for methods like
    :meth:`Series.factorize`.
 
    >>> codes, uniques = pd.factorize(np.array(['b', 'b', 'a', 'c', 'b'], dtype="O"))
    >>> codes
    array([0, 0, 1, 2, 0])
    >>> uniques
    array(['b', 'a', 'c'], dtype=object)
 
    With ``sort=True``, the `uniques` will be sorted, and `codes` will be
    shuffled so that the relationship is the maintained.
 
    >>> codes, uniques = pd.factorize(np.array(['b', 'b', 'a', 'c', 'b'], dtype="O"),
    ...                               sort=True)
    >>> codes
    array([1, 1, 0, 2, 1])
    >>> uniques
    array(['a', 'b', 'c'], dtype=object)
 
    When ``use_na_sentinel=True`` (the default), missing values are indicated in
    the `codes` with the sentinel value ``-1`` and missing values are not
    included in `uniques`.
 
    >>> codes, uniques = pd.factorize(np.array(['b', None, 'a', 'c', 'b'], dtype="O"))
    >>> codes
    array([ 0, -1,  1,  2,  0])
    >>> uniques
    array(['b', 'a', 'c'], dtype=object)
 
    Thus far, we've only factorized lists (which are internally coerced to
    NumPy arrays). When factorizing pandas objects, the type of `uniques`
    will differ. For Categoricals, a `Categorical` is returned.
 
    >>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c'])
    >>> codes, uniques = pd.factorize(cat)
    >>> codes
    array([0, 0, 1])
    >>> uniques
    ['a', 'c']
    Categories (3, object): ['a', 'b', 'c']
 
    Notice that ``'b'`` is in ``uniques.categories``, despite not being
    present in ``cat.values``.
 
    For all other pandas objects, an Index of the appropriate type is
    returned.
 
    >>> cat = pd.Series(['a', 'a', 'c'])
    >>> codes, uniques = pd.factorize(cat)
    >>> codes
    array([0, 0, 1])
    >>> uniques
    Index(['a', 'c'], dtype='object')
 
    If NaN is in the values, and we want to include NaN in the uniques of the
    values, it can be achieved by setting ``use_na_sentinel=False``.
 
    >>> values = np.array([1, 2, 1, np.nan])
    >>> codes, uniques = pd.factorize(values)  # default: use_na_sentinel=True
    >>> codes
    array([ 0,  1,  0, -1])
    >>> uniques
    array([1., 2.])
 
    >>> codes, uniques = pd.factorize(values, use_na_sentinel=False)
    >>> codes
    array([0, 1, 0, 2])
    >>> uniques
    array([ 1.,  2., nan])
    )rÃr¿r¾r’)rÃ)r¿F)Úcompat)r¿rÀrT)r¿Ú assume_uniqueÚverify)rKr,r.r¾rrr*r/ÚfreqrLrRrMrJrVr0r±r1ÚwhererÂr‹Ú    safe_sortr`)    rWrÃr¿rÀr^rQr—Ú    null_maskr¼s             rYr¾r¾bsV€ôp&œ8¤YÐ/Ô0Ø×Ñ T¸?ÐÓKÐKä ˜v°Ô =€FØ€Hô    6Ô,Ô.?Ð@ÔAØ K‰KÐ #ð ×)Ñ)¨tÐ)Ó4‰ˆˆwؐgˆ~Ðä ˜¤§
¡
Ô +à×)Ñ)¸/Ð)ÓJ‰ˆ‰wô—‘˜FÓ#ˆá 6§<¡<´6Ò#9ô
˜V› ˆI؏}‰}ŒÜ-¨f¯l©lÀ5ÔIäŸ™ )¨X°vÓ>ä(Ø Ø+Øô
‰ˆˆwñ  ”G“ ˜qÒ Ü"Ø Ø Ø+ØØô 
‰ˆô  ¨¯©¸ÓB€Gà 'ˆ>ÐrZcól—tjdtt«¬«t    ||||||¬«S)aK
    Compute a histogram of the counts of non-null values.
 
    Parameters
    ----------
    values : ndarray (1-d)
    sort : bool, default True
        Sort by values
    ascending : bool, default False
        Sort in ascending order
    normalize: bool, default False
        If True then compute a relative histogram
    bins : integer, optional
        Rather than count values, group them into half-open bins,
        convenience for pd.cut, only works with numeric data
    dropna : bool, default True
        Don't include counts of NaN
 
    Returns
    -------
    Series
    zupandas.value_counts is deprecated and will be removed in a future version. Use pd.Series(obj).value_counts() instead.rc)rÃÚ    ascendingÚ    normalizeÚbinsÚdropna)rjrkrlrÚvalue_counts_internal)rWrÃrÍrÎrÏrÐs      rYÚ value_countsrÒ/s@€ô< ‡MMð    EäÜ#Ó%õ ô !ØØ ØØØ Øô  ðrZcóŒ—ddlm}m}t|dd«}|rdnd}    |ßddlm}
t ||«r |j}    |
||d¬«} | j|¬
«} |    | _
| | jj«} | jjd «| _ | j«} |r,| jdk(j«r| j dd} t#j$t'| «g«}nt)|«rz||d ¬ «jj|¬
«} |    | _
|| j_
| j}t |t"j*«s“t#j,|«}n|t |t.«rot1t3|j4««}|||    ¬«j7||¬«j9«} |j:| j_| j}nýt=|d¬«}t?||«\}}}|j@t"jBk(r|jt"jD«}||«}|j@tFdfvr)|j@tHk(r|jtH«}nL|j@|j@k7r3|j@dk7r$tKjLdtNtQ«¬«||_
||||    d ¬«} |r| jS|¬«} |r| |jU«z } | S#t$r} td    «| ‚d} ~ wwxYw)Nr)r;r<r„Ú
proportionÚcount)ÚcutT)Úinclude_lowestz+bins argument only works with numeric data.©rÐÚintervalFrC)Úindexr„)ÚlevelrÐrÒr’rhzàThe behavior of value_counts with object-dtype is deprecated. In a future version, this will *not* perform dtype inference on the resulting index. To retain the old behavior, use `result.index = result.index.infer_objects()`rc)rÚr„rD)rÍ)+Úpandasr;r<ÚgetattrÚpandas.core.reshape.tilerÖrKÚ_valuesr©rÒr„rÚÚnotnarTÚ
sort_indexÚallÚilocrLr3r‹rrRrMr-roÚrangeÚnlevelsÚgroupbyÚsizeÚnamesrrÚvalue_counts_arraylikerJÚfloat16rvr•rVrjrkrlrÚ sort_valuesrŽ)rWrÃrÍrÎrÏrÐr;r<Ú
index_namer„rÖÚiiÚerrrÚcountsÚlevelsÚkeysÚ_Úidxs                   rYrÑrÑ^s¼€÷ô
˜ ¨Ó.€JÙ$‰<¨'€Dà ÐÝ0ä f˜fÔ %Ø—^‘^ˆFð    TِV˜T°$Ô7ˆBð
—‘¨Ó/ˆØˆŒ ؘŸ ™ ×*Ñ*Ó,Ñ-ˆØ—|‘|×*Ñ*¨:Ó6ˆŒ Ø×"Ñ"Ó$ˆñ v—~‘~¨Ñ*×/Ñ/Ô1Ø—[‘[  1Ð%ˆFô—‘œ3˜r›7˜)Ó$Šô $ FÔ +á˜F¨Ô/×7Ñ7×DÑDÈFÐDÓSˆF؈FŒKØ *ˆFL‰LÔ Ø—^‘^ˆFܘf¤b§j¡jÕ1䟙 FÓ+’ä ˜¤ Ô .äœ% §¡Ó/Ó0ˆFá˜V¨$Ô/ß‘˜v¨fÓ5ß‘“ð ð
"(§¡ˆFL‰LÔ Ø—^‘^‰Fô' v¸ÔHˆFÜ4°V¸VÓD‰OˆD&˜!؏z‰zœRŸZ™ZÒ'Ø—{‘{¤2§:¡:Ó.ñ˜“+ˆC؏y‰yœT 8Ð,Ñ,°·±¼vÒ1EØ—j‘j¤Ó(‘à—    ‘    ˜TŸZ™ZÒ'Ø—I‘I Ò)ä— ‘ ðDô"Ü/Ó1õð"ˆCŒHá˜F¨#°D¸uÔEˆFá Ø×#Ñ#¨iÐ#Ó8ˆáؘ&Ÿ*™*›,Ñ&ˆà €MøôSò    TÜÐIÓJÐPSÐ Sûð    Tús½ L)Ì)    MÌ2 L>Ì>Mcóà—|}t|«}tj|||¬«\}}}t|j«r|r|t
k7}||||}}t ||j|«}|||fS)zÓ
    Parameters
    ----------
    values : np.ndarray
    dropna : bool
    mask : np.ndarray[bool] or None, default None
 
    Returns
    -------
    uniques : np.ndarray
    counts : np.ndarray[np.int64]
    r“)rOr²Ú value_countr$rJr
r`)rWrÐr”r^rñrïÚ
na_counterÚres_keyss        rYréréÃsx€ð€HÜ ˜&Ó !€Fä%×1Ñ1°&¸&ÀtÔLÑ€Dˆ&*ä˜8Ÿ>™>Ô*ñ Øœ4‘<ˆDØ ™: v¨d¡|&ˆDä   x§~¡~°xÓ@€HØ V˜ZÐ 'Ð'rZcóH—t|«}tj|||¬«S)ax
    Return boolean ndarray denoting duplicate values.
 
    Parameters
    ----------
    values : np.ndarray or ExtensionArray
        Array over which to check for duplicate values.
    keep : {'first', 'last', False}, default 'first'
        - ``first`` : Mark duplicates as ``True`` except for the first
          occurrence.
        - ``last`` : Mark duplicates as ``True`` except for the last
          occurrence.
        - False : Mark all duplicates as ``True``.
    mask : ndarray[bool], optional
        array indicating which elements to exclude from checking
 
    Returns
    -------
    duplicated : ndarray[bool]
    )Úkeepr”)rOr²Ú
duplicated)rWrùr”s   rYrúrúâs#€ô2˜&Ó !€FÜ × Ñ ˜V¨$°TÔ :Ð:rZcó®—t|d¬«}|}t|j«r)t|«}t    d|«}|j |¬«St |«}tj|||¬«\}}|||fS    t|«}t||j|«}|S#t$r,}tjd|›t«¬«Yd}~ŒId}~wwxYw)    a
    Returns the mode(s) of an array.
 
    Parameters
    ----------
    values : array-like
        Array over which to check for duplicate values.
    dropna : bool, default True
        Don't consider counts of NaN/NaT.
 
    Returns
    -------
    np.ndarray or ExtensionArray
    Úmoder’r>rØ)rÐr”NzUnable to sort modes: rc)rrr$rJr4rÚ_moderOr²rürÊr©rjrkrr`)rWrÐr”r^ÚnpresultÚres_maskrîrs        rYrürüÿsրô"˜v°Ô 8€FØ€Hä˜6Ÿ<™<Ô(ä/°Ó7ˆÜÐ&¨Ó/ˆØ|‰| 6ˆ|Ó*Ð*ä ˜&Ó !€F䟙 V°FÀÔFÑ€HˆhØÐؘÐ!Ð!ð
ܘXÓ&ˆô˜x¨¯©¸Ó B€FØ €Møô ò
܏ ‰ Ø$ S EÐ *Ü'Ó)÷    
ò    
ûð
úsÁ; B    CÂ("CÃCc    ó
—t|j«}t|«}|jdk(rt    j
||||||¬«}|S|jdk(rt    j |||||||¬«}|Std«‚)a÷
    Rank the values along a given axis.
 
    Parameters
    ----------
    values : np.ndarray or ExtensionArray
        Array whose values will be ranked. The number of dimensions in this
        array must not exceed 2.
    axis : int, default 0
        Axis over which to perform rankings.
    method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
        The method by which tiebreaks are broken during the ranking.
    na_option : {'keep', 'top'}, default 'keep'
        The method by which NaNs are placed in the ranking.
        - ``keep``: rank each NaN value with a NaN ranking
        - ``top``: replace each NaN with either +/- inf so that they
                   there are ranked at the top
    ascending : bool, default True
        Whether or not the elements should be ranked in ascending order.
    pct : bool, default False
        Whether or not to the display the returned rankings in integer form
        (e.g. 1, 2, 3) or in percentile form (e.g. 0.333..., 0.666..., 1).
    é)Úis_datetimelikeÚ ties_methodrÍÚ    na_optionÚpctrE)ÚaxisrrrÍrrz&Array with ndim > 2 are not supported.)r$rJrOÚndimrÚrank_1dÚrank_2dr©)rWrÚmethodrrÍrrÚrankss        rYÚrankr +s•€ô>*¨&¯,©,Ó7€OÜ ˜&Ó !€Fà ‡{{aÒÜ— ‘ Ø Ø+ØØØØô 
ˆð* €Lð
‰˜Ò    Ü— ‘ Ø ØØ+ØØØØô
ˆð €LôÐ@ÓAÐArZcóx—t|tjttt
f«s$t jdtt«¬«t|«stj|«}t|«}|r+t||j|«t|||d|¬«}|S|j!||¬«}|S)ak    
    Take elements from an array.
 
    Parameters
    ----------
    arr : array-like or scalar value
        Non array-likes (sequences/scalars without a dtype) are coerced
        to an ndarray.
 
        .. deprecated:: 2.1.0
            Passing an argument other than a numpy.ndarray, ExtensionArray,
            Index, or Series is deprecated.
 
    indices : sequence of int or one-dimensional np.ndarray of int
        Indices to be taken.
    axis : int, default 0
        The axis over which to select values.
    allow_fill : bool, default False
        How to handle negative values in `indices`.
 
        * False: negative values in `indices` indicate positional indices
          from the right (the default). This is similar to :func:`numpy.take`.
 
        * True: negative values in `indices` indicate
          missing values. These values are set to `fill_value`. Any other
          negative values raise a ``ValueError``.
 
    fill_value : any, optional
        Fill value to use for NA-indices when `allow_fill` is True.
        This may be ``None``, in which case the default NA value for
        the type (``self.dtype.na_value``) is used.
 
        For multi-dimensional `arr`, each *element* is filled with
        `fill_value`.
 
    Returns
    -------
    ndarray or ExtensionArray
        Same type as the input.
 
    Raises
    ------
    IndexError
        When `indices` is out of bounds for the array.
    ValueError
        When the indexer contains negative values other than ``-1``
        and `allow_fill` is True.
 
    Notes
    -----
    When `allow_fill` is False, `indices` may be whatever dimensionality
    is accepted by NumPy for `arr`.
 
    When `allow_fill` is True, `indices` should be 1-D.
 
    See Also
    --------
    numpy.take : Take elements from an array along an axis.
 
    Examples
    --------
    >>> import pandas as pd
 
    With the default ``allow_fill=False``, negative numbers indicate
    positional indices from the right.
 
    >>> pd.api.extensions.take(np.array([10, 20, 30]), [0, 0, -1])
    array([10, 10, 30])
 
    Setting ``allow_fill=True`` will place `fill_value` in those positions.
 
    >>> pd.api.extensions.take(np.array([10, 20, 30]), [0, 0, -1], allow_fill=True)
    array([10., 10., nan])
 
    >>> pd.api.extensions.take(np.array([10, 20, 30]), [0, 0, -1], allow_fill=True,
    ...      fill_value=-10)
    array([ 10,  10, -10])
    z­pd.api.extensions.take accepting non-standard inputs is deprecated and will raise in a future version. Pass either a numpy.ndarray, ExtensionArray, Index, or Series instead.rcT)rÚ
allow_fillÚ
fill_value)r)rKrLrRr+r,r.rjrkrlrrrMrr6r¯r2Útake)ÚarrÚindicesrrrrs      rYrrks¤€ôj cœBŸJ™JÔ(9¼8ÄYÐOÔ Pä ‰ ð 8ô Ü'Ó)õ     
ô ˜Ô ܏j‰j˜‹oˆä! 'Ó*€Gá䘠#§)¡)¨D¡/Ô2ÜØ ˜t°Àô
ˆð €M𗑘'¨Ó-ˆØ €MrZcóà—| t|«}t|tj«r(|jj
dvrt |«s t|«rùtj|jj«}t |«rtj|g«ntj|«}||jk\j«r*||jkj«r |j}n |j}t |«r tt|j|««}n't!tt"|«|¬«}n t%|«}|j'|||¬«S)aû
    Find indices where elements should be inserted to maintain order.
 
    Find the indices into a sorted array `arr` (a) such that, if the
    corresponding elements in `value` were inserted before the indices,
    the order of `arr` would be preserved.
 
    Assuming that `arr` is sorted:
 
    ======  ================================
    `side`  returned index `i` satisfies
    ======  ================================
    left    ``arr[i-1] < value <= self[i]``
    right   ``arr[i-1] <= value < self[i]``
    ======  ================================
 
    Parameters
    ----------
    arr: np.ndarray, ExtensionArray, Series
        Input array. If `sorter` is None, then it must be sorted in
        ascending order, otherwise `sorter` must be an array of indices
        that sort it.
    value : array-like or scalar
        Values to insert into `arr`.
    side : {'left', 'right'}, optional
        If 'left', the index of the first suitable location found is given.
        If 'right', return the last such index.  If there is no suitable
        index, return either 0 or N (where N is the length of `self`).
    sorter : 1-D array-like, optional
        Optional array of integer indices that sort array a into ascending
        order. They are typically the result of argsort.
 
    Returns
    -------
    array of ints or int
        If value is array-like, array of insertion points.
        If value is scalar, a single integer.
 
    See Also
    --------
    numpy.searchsorted : Similar method from NumPy.
    ÚiurI)ÚsideÚsorter)rrKrLrRrJr¬rr Úiinforªr3ÚminrâÚmaxrÚintr­r r4Ú searchsorted)rÚvaluerrrÚ    value_arrrJs       rYrràs€ð`ÐÜ$ VÓ,ˆô    3œŸ
™
Õ#Ø I‰IN‰N˜dÒ "Ü ˜Ô Ô"2°5Ô"9ô —‘˜Ÿ™Ÿ™Ó(ˆÜ)3°EÔ):”B—H‘H˜e˜WÔ%ÄÇÁÈÈ    Ø ˜Ÿ™Ñ "× 'Ñ 'Ô )¨y¸E¿I¹IÑ/E×.JÑ.JÔ.Lð—I‘I‰Eà—O‘OˆEä eÔ äœ˜eŸj™j¨Ó/Ó0‰EäœT¤)¨UÓ3¸5ÔA‰Eô-¨SÓ1ˆð × Ñ ˜E¨°VÐ Ó <Ð<rZ>r}r|r{rzrvrucó\—t|«}tj}|j}t    |«}|rt
j }nt
j}t|t«r|j«}|j}t|tj«s|t|d|j›d«rA|dk7r$tdt|«j›d|›«‚|||j!|««St#t|«j›d«‚d}|jj$dvr*tj&}|j)d«}t*}d    }nZ|rtj,}nG|j$d
vr9|jj.d vrtj0}ntj2}|j4}|d k(r|j7d d «}tj|«}tj8|j:|¬«}    t=d«gdz}
|dk\r t=d|«n t=|d«|
|<||    t?|
«<|jj.t@vrtCjD||    |||¬«nˆt=d«gdz} |dk\r t=|d«n t=d|«| |<t?| «} t=d«gdz} |dkDr t=d| «n t=| d«| |<t?| «}||| ||«|    | <|r|    j)d«}    |d k(r    |    dd…df}    |    S)aQ
    difference of n between self,
    analogous to s-s.shift(n)
 
    Parameters
    ----------
    arr : ndarray or ExtensionArray
    n : int
        number of periods
    axis : {0, 1}
        axis to shift on
    stacklevel : int, default 3
        The stacklevel for the lost dtype warning.
 
    Returns
    -------
    shifted
    Ú__rz cannot diff z     on axis=zK has no 'diff' method. Convert to a suitable dtype prior to calling 'diff'.Fr¹rHTr)r}r|rrºrINrE)Ú datetimelikeztimedelta64[ns])#rrLÚnanrJrÚoperatorÚxorÚsubrKr)Úto_numpyrRÚhasattrr«Ú
ValueErrorrªÚshiftr©r¬rzrSr
Úobject_r„rvrurÚreshapeÚemptyr¯ÚslicernÚ _diff_specialrÚdiff_2d)rÚnrÚnarJÚis_boolÚopÚ is_timedeltaÚ    orig_ndimÚout_arrÚ
na_indexerÚ _res_indexerÚ res_indexerÚ _lag_indexerÚ lag_indexers               rYÚdiffr;;s¿€ô(     ˆA‹€AÜ     ‰€BØ I‰I€Eä˜EÓ"€GÙÜ \‰\‰ä \‰\ˆä%œÔ&àl‰l‹nˆØ—    ‘    ˆä cœ2Ÿ:™:Ô &ä 3˜"˜RŸ[™[˜M¨Ð,Ô -ؐqŠyÜ  <´°S³    ×0BÑ0BÐ/CÀ9ÈTÈFÐ!SÓTÐTِc˜3Ÿ9™9 Q›<Ó(Ð (äܘ“9×%Ñ%Ð&ð'GðGóð ð
€LØ
‡yy‡~~˜ÑÜ—‘ˆØh‰ht‹nˆÜ ˆØ‰ á    ä—
‘
‰à    ‰tÑ    ð
9‰9>‰>Ð.Ñ .Ü—J‘J‰Eä—J‘JˆEà—‘€IؐA‚~àk‰k˜"˜aÓ ˆô H‰HU‹O€E܏h‰hs—y‘y¨Ô.€G䘓+ Ñ"€JØ)*¨aª”u˜T 1”~´U¸1¸d³^€JˆtÑØ!#€GŒE*Ó Ñà
‡yy‡~~œÑ&ô     ‰ c˜7 A t¸,ÖGô˜d› } qÑ(ˆ Ø/0°AªvœU 1 dœ^¼5ÀÀq»>ˆ TÑܘLÓ)ˆ ä˜d› } qÑ(ˆ Ø01°A²œU 4¨!¨œ_¼5À!ÀÀT»?ˆ TÑܘLÓ)ˆ á! # kÑ"2°C¸ Ñ4DÓEˆ ÑáØ—,‘,Ð0Ó1ˆàA‚~Øš!˜Q˜$‘-ˆØ €NrZcó8—t|tjttf«s t d«‚d}t|j t«s&tj|d¬«dk(r t|«}n"    |j«}|j|«}|€|St%|«s t d«‚t'tj(|««}|s+t+t-|««t+|«k(s t/d«‚|€Jt1|«\}}|t+|««}|j3|«t'|j5|««}|rG|j«}    |r$|t+|« k|t+|«k\z}
d||
<nd}
t7|    |d    ¬
«} ntj8t+|«t:¬ «} | j=|tj>t+|«««| j|d ¬ «} |r(|d    k(}
|r!|
|t+|« kz|t+|«k\z}
|r
tj@| |
d    «|t'| «fS#t
tjf$r:|jrt|dt «r t#|«}n t|«}YŒwxYw)a
    Sort ``values`` and reorder corresponding ``codes``.
 
    ``values`` should be unique if ``codes`` is not None.
    Safe for use with mixed types (int, str), orders ints before strs.
 
    Parameters
    ----------
    values : list-like
        Sequence; must be unique if ``codes`` is not None.
    codes : np.ndarray[intp] or None, default None
        Indices to ``values``. All out of bound indices are treated as
        "not found" and will be masked with ``-1``.
    use_na_sentinel : bool, default True
        If True, the sentinel -1 will be used for NaN values. If False,
        NaN values will be encoded as non-negative integers and will not drop the
        NaN from the uniques of the values.
    assume_unique : bool, default False
        When True, ``values`` are assumed to be unique, which can speed up
        the calculation. Ignored when ``codes`` is None.
    verify : bool, default True
        Check if codes are out of bound for the values and put out of bound
        codes equal to ``-1``. If ``verify=False``, it is assumed there
        are no out of bound codes. Ignored when ``codes`` is None.
 
    Returns
    -------
    ordered : AnyArrayLike
        Sorted ``values``
    new_codes : ndarray
        Reordered ``codes``; returned when ``codes`` is not None.
 
    Raises
    ------
    TypeError
        * If ``values`` is not list-like or if ``codes`` is neither None
        nor list-like
        * If ``values`` cannot be sorted
    ValueError
        * If ``codes`` is not None and ``values`` contain duplicates.
    zbOnly np.ndarray, ExtensionArray, and Index objects are allowed to be passed to safe_sort as valuesNFrerirzMOnly list-like objects or None are allowed to be passed to safe_sort as codesz,values should be unique if codes is not Nonerº©rrIÚwrap)rü)!rKrLrRr+r,r©rJr(r rmÚ _sort_mixedÚargsortrÚdecimalÚInvalidOperationrçrnÚ _sort_tuplesr!rrMr‹rˆr'r‚Ú map_locationsÚlookupr2r+rÚputÚarangeÚputmask) rWrQr¿rÆrÇrÚorderedrÁÚtÚorder2r”Ú    new_codesÚreverse_indexers              rYrÊrʬsZ€ô` fœrŸz™zÔ+<¼hÐGÔ HÜð /ó
ð    
ð
€Fô v—|‘|¤^Ô 4Ü O‰O˜F¨5Ô 1°_Ò Dä˜fÓ%‰ð     .Ø—^‘^Ó%ˆFØ—k‘k &Ó)ˆGð €}Øˆä ˜Ô Üð .ó
ð    
ô  ¤§
¡
¨5Ó 1Ó 2€Eá ¤¤V¨F£^Ó!4¼¸F» Ò!CÜÐGÓHÐHà €~ô
1°Ó8ш
FÙ ”s˜6“{Ó #ˆØ    ‰˜ÔÜ$ Q§X¡X¨gÓ%6Ó7ˆáà—‘Ó!ˆÙ ØœS ›[˜LÑ(¨U´c¸&³kÑ-AÑBˆD؈E$ŠKàˆDܘF E°bÔ9‰    äŸ(™(¤3 v£;´cÔ:ˆØ×јF¤B§I¡I¬c°&«kÓ$:Ô;ð$×(Ñ(¨°VÐ(Ó<ˆ    á ؘB‘;ˆDÙØ˜u¬¨F«  |Ñ3Ñ4¸ÄÀVÃÑ8LÑMá˜4Ð+Ü

‰
9˜d BÔ'à Ô'¨    Ó2Ð 2Ð2øô{œ7×3Ñ3Ð4ò
    .ð{Š{œz¨&°©)´UÔ;ô' vÓ.‘ä% fÓ-úð
    .úsÁ4!IÉAJÊJc    óV—tj|Dcgc]}t|t«‘Œc}t¬«}tj|Dcgc] }t |«‘Œc}t¬«}||z}tj ||«}tj ||«}|j«dj|«}|j«dj|«}|j«d}    tj|||    g«}
|j|
«Scc}wcc}w)z3order ints before strings before nulls in 1d arraysrIr)
rLr3rKÚstrr•r0r@ÚnonzerorÚ concatenate) rWÚxÚstr_posÚnull_posÚnum_posÚ str_argsortÚ num_argsortÚstr_locsÚnum_locsÚ    null_locsÚlocss            rYr?r?.sì€äh‰h°FÖ;¨qœ
 1¤cÕ*Ò;Ä4ÔH€G܏x‰x¨&Ö1 Qœ˜aÒ1¼Ô>€H؈h˜(˜Ñ"€GÜ—*‘*˜V G™_Ó-€KÜ—*‘*˜V G™_Ó-€Kà‰Ó  Ñ#×(Ñ(¨Ó5€H؏‰Ó  Ñ#×(Ñ(¨Ó5€HØ× Ñ Ó" 1Ñ%€IÜ >‰>˜8 X¨yÐ9Ó :€DØ ;‰;tÓ Ðùò<ùÚ1s ”D!Á D&cóP—ddlm}ddlm}||d«\}}||d¬«}||S)a
    Convert array of tuples (1d) to array of arrays (2d).
    We need to keep the columns separately as they contain different types and
    nans (can't use `np.sort` as it may fail when str and nan are mixed in a
    column as types cannot be compared).
    r)Ú    to_arrays)Úlexsort_indexerNT)Úorders)Ú"pandas.core.internals.constructionr]Úpandas.core.sortingr^)rWr]r^ÚarraysròÚindexers      rYrCrC=s0€õ=Ý3á˜& $Ó'I€FˆAÙ˜f¨TÔ2€GØ '‰?ÐrZcó—ddlm}tj«5tjddt
¬«t |d¬«}t |d¬«}ddd«jd¬    «\}}tj|j|j«}|||jd
d¬ «}t|t«r0t|t«r |j|«j«}n[t|t «r |j"}t|t «r |j"}t%||g«}t|«}t'|«}|j)|«j}tj*||«S#1swYŒ,xYw) aù
    Extracts the union from lvals and rvals with respect to duplicates and nans in
    both arrays.
 
    Parameters
    ----------
    lvals: np.ndarray or ExtensionArray
        left values which is ordered in front.
    rvals: np.ndarray or ExtensionArray
        right values ordered after lvals.
 
    Returns
    -------
    np.ndarray or ExtensionArray
        Containing the unsorted union of both arrays.
 
    Notes
    -----
    Caller is responsible for ensuring lvals.dtype == rvals.dtype.
    r©r<Úignorez<The behavior of value_counts with object-dtype is deprecated)ÚcategoryFrØNr=r)rÚrJrD)rÜr<rjÚcatch_warningsÚfilterwarningsrlrÑÚalignrLÚmaximumrWrÚrKr-Úappendrˆr,rßr%r4ÚreindexÚrepeat)    ÚlvalsÚrvalsr<Úl_countÚr_countÚ final_countÚ unique_valsÚcombinedÚrepeatss             rYÚunion_with_duplicatesrwLs;€õ.ä    ×     Ñ     Ó    "ñ    =ô    ×ÑØ Ø JÜ"õ    
ô
(¨°eÔ<ˆÜ'¨°eÔ<ˆ÷    =ð—}‘} W¸}Ó;Ñ€GˆWÜ—*‘*˜WŸ^™^¨W¯^©^Ó<€KÙ˜¨G¯M©MÀÈUÔS€Kܐ%œÔ'¬J°u¼mÔ,LØ—l‘l 5Ó)×0Ñ0Ó2‰ ä eœXÔ &Ø—M‘MˆEÜ eœXÔ &Ø—M‘MˆEô! %¨ Ó0ˆÜ˜XÓ&ˆ Ü4°[ÓAˆ Ø×!Ñ! +Ó.×5Ñ5€GÜ 9‰9[ 'Ó *Ð*÷7    =ñ    =ús ›7E<Å<FcóÖ‡    —|dvrd|›d}t|«‚t|«rYt|t«rt    |d«r|Š    ˆ    fd„}n5ddlm}t|«dk(r||tj¬«}n||«}t|t«rU|d    k(r||jj«}|jj|«}t|j|«}|St|«s|j!«S|j#t$d
¬ «}|€t'j(|||¬ «St'j*||t-|«j/tj0«|¬ «S)a®
    Map values using an input mapping or function.
 
    Parameters
    ----------
    mapper : function, dict, or Series
        Mapping correspondence.
    na_action : {None, 'ignore'}, default None
        If 'ignore', propagate NA values, without passing them to the
        mapping correspondence.
    convert : bool, default True
        Try to find better dtype for elementwise function results. If
        False, leave as dtype=object.
 
    Returns
    -------
    Union[ndarray, Index, ExtensionArray]
        The output of the mapping function applied to the array.
        If the function returns a tuple with more than one element
        a MultiIndex will be returned.
    )Nrfz+na_action must either be 'ignore' or None, z  was passedÚ __missing__có|•—‰t|t«r'tj|«rtjS|SrŸ)rKÚfloatrLr¡r!)rRÚdict_with_defaults €rYr¨zmap_array.<locals>.<lambda>ªs1ø€Ð0Ü$ Q¬Ô.´2·8±8¸A´;”—‘ñ €ØDEñ €rZrrerIrfFrC)Úconvert)r”r})r'rrKÚdictr&rÜr<r‹rLrur.rÚràÚ get_indexerr2rßrDrTrVr Ú    map_inferÚmap_infer_maskr0rSrB)
rÚmapperÚ    na_actionr}Úmsgr<rcÚ
new_valuesrWr|s
         @rYÚ    map_arrayr†ƒs@ø€ð6Ð(Ñ(Ø;¸I¸;ÀkÐRˆÜ˜‹oÐô
FÔÜ fœdÔ #¬°¸ Ô(Fð!'Ð ó‰Fõ &ä6‹{˜aÒÙ ¬b¯j©jÔ9‘á ›ä&œ)Ô$Ø ˜Ò  Ø˜FŸL™L×.Ñ.Ó0Ñ1ˆFð—,‘,×*Ñ*¨3Ó/ˆÜ˜VŸ^™^¨WÓ5ˆ
àÐä ˆsŒ8؏x‰x‹zÐðZ‰Zœ UˆZÓ +€FØÐ܏}‰}˜V V°WÔ=Ð=ä×!Ñ!Ø F¤ f£×!2Ñ!2´2·8±8Ó!<Àgô
ð    
rZ)rWr Úreturnú
np.ndarray)rWr rJrr^r r‡r )rprOr‡r )rWrˆ)rWrˆr‡rO)rWr r‡rrŸ)r”únpt.NDArray[np.bool_] | None)r´r7rWr7r‡únpt.NDArray[np.bool_])TNNN) rWrˆr¿r•rÀú
int | Noner¼rVr”r‰r‡z'tuple[npt.NDArray[np.intp], np.ndarray])FTN)rÃr•r¿r•rÀr‹r‡z%tuple[np.ndarray, np.ndarray | Index])TFFNT)
rÃr•rÍr•rÎr•rÐr•r‡r<)rWrˆrÐr•r”r‰r‡z,tuple[ArrayLike, npt.NDArray[np.int64], int])ÚfirstN)rWr rùzLiteral['first', 'last', False]r”r‰r‡rŠ)TN)rWr rÐr•r”r‰r‡r )rÚaveragerùTF)rWr rrr
rOrrOrÍr•rr•r‡znpt.NDArray[np.float64])rFN)rrrrrr•)ÚleftN)
rr rz$NumpyValueArrayLike | ExtensionArrayrzLiteral['left', 'right']rzNumpySorter | Noner‡znpt.NDArray[np.intp] | np.intp)r)r/rrr)NTFT) rWzIndex | ArrayLikerQznpt.NDArray[np.intp] | Noner¿r•rÆr•rÇr•r‡z.AnyArrayLike | tuple[AnyArrayLike, np.ndarray])r‡r )rWrˆr‡rˆ)roúArrayLike | Indexrprr‡r)NT)rr rƒzLiteral['ignore'] | Noner}r•r‡z#np.ndarray | ExtensionArray | Index)Ú__doc__Ú
__future__rrAr"ÚtextwraprÚtypingrrrrjÚnumpyrLÚ pandas._libsrr    r²r
r Úpandas._typingr r rrrrÚpandas.util._decoratorsrÚpandas.util._exceptionsrÚpandas.core.dtypes.castrrÚpandas.core.dtypes.commonrrrrrrrrrrr r!r"r#r$Úpandas.core.dtypes.concatr%Úpandas.core.dtypes.dtypesr&r'r(r)Úpandas.core.dtypes.genericr*r+r,r-r.r/Úpandas.core.dtypes.missingr0r1Úpandas.core.array_algos.taker2Úpandas.core.constructionr3r­r4r5Úpandas.core.indexersr6r7r8r9rÜr:r;r<Úpandas.core.arraysr=r>rOr`rrÚComplex128HashTableÚComplex64HashTableÚFloat64HashTableÚFloat32HashTableÚUInt64HashTableÚUInt32HashTableÚUInt16HashTableÚUInt8HashTableÚInt64HashTableÚInt32HashTableÚInt16HashTableÚ Int8HashTableÚStringHashTableÚPyObjectHashTabler€r‚rrˆrr‡Úunique1dr°rœrÂr¾rÒrÑrérúrür rrr-r;rÊr?rCrwr†©rZrYú<module>r³sðñõ#ãÛÝ÷ñó
ã÷ó÷ ÷õ(Ý4÷÷÷÷÷ñõ"4÷ó÷ ÷÷õ
1÷ñõ
2á÷ñ÷ ñ÷
óK!ð\Ø ðØ&ðØ2>ðàóóBð8×,Ñ,Ø×*Ñ*Ø×&Ñ&Ø×&Ñ&Ø×$Ñ$Ø×$Ñ$Ø×$Ñ$Ø × "Ñ "Ø × "Ñ "Ø × "Ñ "Ø × "Ñ "Ø ×  Ñ  Ø×$Ñ$Ø×&Ñ&ñ€ ó$ó$ò6^$óBô.,ð0 €ð"ÐóX"ðz!Ø ØØ)-ð ;Ø ð;àð;ðð;ðð    ;ð
'ð ;ð -ó ;ñ|Ù ð    ó ñ
ð    ó
ñð    óôð0ؠؠ𠠠 tà
ðtððtðð    tð
+ò tó-ð,tðrØØØ     Øð ,à
ð,ðð,ðð    ,ð ð ,ð ó,ðbØØØ     Øð aà
ðaððaðð    að ð að óaðLLPð(Ø ð(Ø $ð(Ø,Hð(à1ó(ðB-4Ø)-ð;Ø ð;à
)ð;ð 'ð;ðó    ;ð<RVð)Ø ð)Ø#ð)Ø2Nð)àó)ð\ØØØØð 8Ø ð8à
ð8ð ð8ðð    8ð
ð 8ð
ð 8ðó8ðFØØð mà ðmð ðmðó    mðp&,Ø!%ð    Q=Ø    ðQ=à /ðQ=ð #ðQ=ð ð    Q=ð
$ó Q=òpJ€ ôgðf*.Ø ØØð 3Ø ð3à &ð3ðð3ðð    3ð
ð 3ð 4ó 3óD ó ð4+Ø ð4+Ø%6ð4+àó4+ðt+/Øð    P
Ø    ðP
ð(ðP
ðð    P
ð
)ô P
rZ