hyb
2025-12-31 6cdcd01f77e11b72c323603e27ebdb85b15223c9
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
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
Ë
nñúh­‰ã    óö—ddlmZddlmZddlmZddlZddlmZddl    m
Z
m Z m Z m Z ddlZddlZddlmZddlmZmZmZdd    lmZdd
lmZdd lmZdd lm Z dd l!m"Z"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6m7Z7ddl8m9Z9m:Z:ddl;m<Z<m=Z=m>Z>ddl?m@Z@mAZAddlBmCZCmDZDddlEmFZFmGZGddlHmIZImJZJmKZKddlLmMcmNZOddlPmQZQmRZRddlSmTZTddlUmVZVddlWmXZXddlYmZZZe
r.ddl[m\Z\m]Z]m^Z^ddl_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjddlkmlZlmmZmmnZnd„Zod/d „ZpGd!„d"eFeKeX«ZqeAeqd#d$gd%¬&«eAeqgd'¢d(¬&«Gd)„d*e@eKeJ«««Zr                        d0d+„Zs    d1                    d2d,„Ztd3d-„Zud4d.„Zvy)5é)Ú annotations)ÚQUOTE_NONNUMERIC)ÚpartialN)Úget_terminal_size)Ú TYPE_CHECKINGÚLiteralÚcastÚoverload)Ú
get_option)ÚNaTÚalgosÚlib)Ú NDArrayBacked)Úfunction)Úfind_stack_level)Úvalidate_bool_kwarg)Úcoerce_indexer_dtypeÚfind_common_type) Ú ensure_int64Úensure_platform_intÚis_any_real_numeric_dtypeÚ is_bool_dtypeÚ is_dict_likeÚ is_hashableÚis_integer_dtypeÚ is_list_likeÚ    is_scalarÚneeds_i8_conversionÚ pandas_dtype)Ú
ArrowDtypeÚCategoricalDtypeÚCategoricalDtypeTypeÚExtensionDtype)ÚABCIndexÚ    ABCSeries)Úis_valid_na_for_dtypeÚisna)Ú
algorithmsÚ    arraylikeÚops)ÚPandasDelegateÚdelegate_names)Ú    factorizeÚtake_nd)ÚNDArrayBackedExtensionArrayÚ ravel_compat)ÚExtensionArrayÚNoNewAttributesMixinÚ PandasObject)Ú extract_arrayÚsanitize_array)Úunpack_zerodim_and_defer)Únargsort)ÚObjectStringArrayMixin)Úconsole)ÚHashableÚIteratorÚSequence) Ú    ArrayLikeÚ    AstypeArgÚAxisIntÚDtypeÚDtypeObjÚNpDtypeÚOrderedÚSelfÚShapeÚSortKindÚnpt)Ú    DataFrameÚIndexÚSeriesc󈇇‡—d‰j›dŠ‰tjuŠt‰«ˆˆˆfd„«}‰|_|S)NÚ__có2•—t|«}t|«r$t|«t|«k7r |s td«‚|js‰
dvr t d«‚t |t«rÈd}|j|«s t |«‚|jsS|jj|j«s.t|j|j|jd¬«}n |j}‰    |j|«}|jdk(|dk(z}|j«r‰||<|S|rc||jvr>|j|«}‰    |j|«}‰
dvr|jdk(}‰||<|St!j"||‰    «S‰
d    vrt d
‰
›d t%|«›d «‚t |t&«rt)|j*«r    ‰    ||«St-t/j0|«‰
«t/j0|««S) NzLengths must match.)Ú__lt__Ú__gt__Ú__le__Ú__ge__z7Unordered Categoricals can only compare equality or notz?Categoricals can only be compared if 'categories' are the same.F©Úcopyéÿÿÿÿ>Ú__eq__rQrO)rUÚ__ne__z$Cannot compare a Categorical for op z  with type zB.
If you want to compare values, use 'np.asarray(cat) <op> other'.)rrÚlenÚ
ValueErrorÚorderedÚ    TypeErrorÚ
isinstanceÚ CategoricalÚ#_categories_match_up_to_permutationÚ
categoriesÚequalsÚrecode_for_categoriesÚcodesÚ_codesÚanyÚ _unbox_scalarr*Úinvalid_comparisonÚtyper1rÚdtypeÚgetattrÚnpÚarray) ÚselfÚotherÚhashableÚmsgÚ other_codesÚretÚmaskÚiÚ
fill_valueÚopÚopnames         €€€úQH:\Change_password\venv_build\Lib\site-packages\pandas/core/arrays/categorical.pyÚfuncz_cat_compare_op.<locals>.func~sôø€ä˜uÓ%ˆÜ ˜Ô ¤3 u£:´°T³Ò#:Á8äÐ2Ó3Ð 3à|Š|ØÐAÑAÜØMóðô eœ[Ô )ðTˆCØ×;Ñ;¸EÔBÜ “nÐ$à—<’<¨¯©×(>Ñ(>¸u×?OÑ?OÔ(Pä3Ø—K‘K ×!1Ñ!1°4·?±?Èô‘ ð$Ÿl™l áT—[‘[ +Ó.ˆCØ—K‘K 2Ñ%¨+¸Ñ*;Ñ<ˆD؏x‰xŒzØ&D‘    ØˆJá Ø˜Ÿ™Ñ'Ø×&Ñ& uÓ-Ù˜Ÿ™ aÓ(àÐ!?Ñ?ð Ÿ;™;¨"Ñ,DØ *C˜‘Iؐ
ä×-Ñ-¨d°E¸2Ó>Ð>ðÐ1Ñ1ÜØ:¸6¸(ðCÜ  ›K˜=ð)8ð8óðô ˜%¤Ô0Ô5HÈÏÉÔ5Uñ˜% “Ð&Ø2”7œ2Ÿ8™8 D›>¨6Ó2´2·8±8¸E³?ÓCÐ Có)Ú__name__ÚoperatorÚner6)rtrwrsrus` @@rvÚ_cat_compare_opr|zsKú€Ø"—+‘+˜bÐ !€FØ”x—{‘{Ð"€Jä˜fÓ%õ=Dó&ð=Dð~€D„Mà €Krxcó‡—t|«    |jj|«}t |«r|‰vSt ˆfd„|D««S#ttf$rYywxYw)aO
    Helper for membership check for ``key`` in ``cat``.
 
    This is a helper method for :method:`__contains__`
    and :class:`CategoricalIndex.__contains__`.
 
    Returns True if ``key`` is in ``cat.categories`` and the
    location of ``key`` in ``categories`` is in ``container``.
 
    Parameters
    ----------
    cat : :class:`Categorical`or :class:`categoricalIndex`
    key : a hashable object
        The key to check membership for.
    container : Container (e.g. list-like or mapping)
        The container to check for membership in.
 
    Returns
    -------
    is_in : bool
        True if ``key`` is in ``self.categories`` and location of
        ``key`` in ``categories`` is in ``container``, else False.
 
    Notes
    -----
    This method does not check for NaN values. Do that separately
    before calling this method.
    Fc3ó&•K—|]}|‰v–—Œ
y­w©N©)Ú.0Úloc_Ú    containers  €rvú    <genexpr>zcontains.<locals>.<genexpr>ósøèø€Ò5¨4˜9Ô$Ñ5ùsƒ)Úhashr^Úget_locÚKeyErrorrZrrc)ÚcatÚkeyrƒÚlocs  ` rvÚcontainsr‹Ãseø€ô:    ˆ„Ið
؏n‰n×$Ñ$ SÓ)ˆô„~ؐiÐÐôÓ5°Ô5Ó5Ð5øô ”iÐ  òÙðúsŽA Á AÁAcó0‡—eZdZUdZdZej edg«zZdZde    d<e
                        deˆfd„ «Z ddde jd    f                            dfˆfd
„ Zedgd „«Zedhd „«Ze
dd dœ                    did„«Ze
djd„«Zedkdld„«Zedkdmd„«Zedkdnd„«Zdodnˆfd„ Zd„Ze
    dp    dqd„«Ze
                dr                    dsd„«Zedtd„«Zedud„«Zedvd„«Zdwdxˆfd„ Zdyd„Zdzd„Zdqd„Zdqd „Z d{d|d!„Z!dqd"„Z"dpdqd#„Z#dqd$„Z$dqd%„Z%dqd&„Z&e jf    d}d'„Z'e(e)jT«Z+e(e)jX«Z-e(e)j\«Z/e(e)j`«Z1e(e)jd«Z3e(e)jh«Z5d(„Z6d)„Z7e
d~d*„«Z8e9    d                    d€d+„«Z:dd,„Z;d‚ˆfd-„ Z<edhd.„«Z=dwdƒd/„Z>d„d0„Z?e?Z@d„d1„ZAeAZBdod…d2„ZCe
                        d†d3„«ZDd‡d4„ZEd‚d5„ZFd    d6d7œ            dˆˆfd8„ZGedddd9œ                            d‰d:„«ZHeddd;œ                            dŠd<„«ZHd d    d=d9œ                            d‹d>„ZHd?d@dAd    d dBœ                                    dŒdC„ZIdvdD„ZJ                                ddE„ZKedvdF„«ZLdŽdG„ZMdhdH„ZNddI„ZOddJ„ZPdwd‘dK„ZQd’dL„ZRd“dM„ZSd“dN„ZTd“dO„ZUdP„ZVd”dQ„ZWd    d dRœ                    d•ˆfdS„ZXd    dTœd–dU„ZYd    dTœd–dV„ZZdod—dW„Z[dqˆfdX„ Z\d˜dZ„Z]e
d™dšd[„«Z^d›d\„Z_dœd]„Z`dd^„Zadžd_„Zbd d`œdŸda„Zce jedj dY«d    f    d db„Zed¡d¢dc„Zf                                        d£dd„ZgˆxZhS)¤r\aZ
    Represent a categorical variable in classic R / S-plus fashion.
 
    `Categoricals` can only take on a limited, and usually fixed, number
    of possible values (`categories`). In contrast to statistical categorical
    variables, a `Categorical` might have an order, but numerical operations
    (additions, divisions, ...) are not possible.
 
    All values of the `Categorical` are either in `categories` or `np.nan`.
    Assigning values outside of `categories` will raise a `ValueError`. Order
    is defined by the order of the `categories`, not lexical order of the
    values.
 
    Parameters
    ----------
    values : list-like
        The values of the categorical. If categories are given, values not in
        categories will be replaced with NaN.
    categories : Index-like (unique), optional
        The unique categories for this categorical. If not given, the
        categories are assumed to be the unique values of `values` (sorted, if
        possible, otherwise in the order in which they appear).
    ordered : bool, default False
        Whether or not this categorical is treated as a ordered categorical.
        If True, the resulting categorical will be ordered.
        An ordered categorical respects, when sorted, the order of its
        `categories` attribute (which in turn is the `categories` argument, if
        provided).
    dtype : CategoricalDtype
        An instance of ``CategoricalDtype`` to use for this categorical.
 
    Attributes
    ----------
    categories : Index
        The categories of this categorical.
    codes : ndarray
        The codes (integer positions, which point to the categories) of this
        categorical, read only.
    ordered : bool
        Whether or not this Categorical is ordered.
    dtype : CategoricalDtype
        The instance of ``CategoricalDtype`` storing the ``categories``
        and ``ordered``.
 
    Methods
    -------
    from_codes
    __array__
 
    Raises
    ------
    ValueError
        If the categories do not validate.
    TypeError
        If an explicit ``ordered=True`` is given but no `categories` and the
        `values` are not sortable.
 
    See Also
    --------
    CategoricalDtype : Type for categorical data.
    CategoricalIndex : An Index with an underlying ``Categorical``.
 
    Notes
    -----
    See the `user guide
    <https://pandas.pydata.org/pandas-docs/stable/user_guide/categorical.html>`__
    for more.
 
    Examples
    --------
    >>> pd.Categorical([1, 2, 3, 1, 2, 3])
    [1, 2, 3, 1, 2, 3]
    Categories (3, int64): [1, 2, 3]
 
    >>> pd.Categorical(['a', 'b', 'c', 'a', 'b', 'c'])
    ['a', 'b', 'c', 'a', 'b', 'c']
    Categories (3, object): ['a', 'b', 'c']
 
    Missing values are not included as a category.
 
    >>> c = pd.Categorical([1, 2, 3, 1, 2, 3, np.nan])
    >>> c
    [1, 2, 3, 1, 2, 3, NaN]
    Categories (3, int64): [1, 2, 3]
 
    However, their presence is indicated in the `codes` attribute
    by code `-1`.
 
    >>> c.codes
    array([ 0,  1,  2,  0,  1,  2, -1], dtype=int8)
 
    Ordered `Categoricals` can be sorted according to the custom order
    of the categories and can have a min and max value.
 
    >>> c = pd.Categorical(['a', 'b', 'c', 'a', 'b', 'c'], ordered=True,
    ...                    categories=['c', 'b', 'a'])
    >>> c
    ['a', 'b', 'c', 'a', 'b', 'c']
    Categories (3, object): ['c' < 'b' < 'a']
    >>> c.min()
    'c'
    ièÚtolistÚ categoricalr!Ú_dtypec󆕗t||j«}td¬«j|«}t‰|||«S)NF©rY)rr^r!Ú update_dtypeÚsuperÚ _simple_new)ÚclsrargÚ    __class__s   €rvr”zCategorical._simple_newgs>ø€ô% U¨E×,<Ñ,<Ó=ˆÜ ¨Ô/×<Ñ<¸UÓCˆÜ‰wÑ" 5¨%Ó0Ð0rxNTcó
    •—|tjur%tjdtt «¬«nd}t j||||«}|rBt||j«}t d¬«j|«}t‰|1||«yt|«s td«‚tj d«}t#|dd«}    t%|    t «r/|j€Nt |j|j&«}n,t%|t(t*t,f«st/j0|«}t%|t2«r*t5|«dk(rtj gt6¬«}nÁt%|tj8«r'|j:d    kDr t=d
«‚t?|d«}n€t?|d«}
tA|
«}|jC«rWtjD|«dD cgc]} || ‘Œ    } } | s|
jFd k(rd} n |
jF} t?| d| ¬«}
|
}|j€t%|jFtH«r£tK|jFjLtN«r|jPjS«}
|
jTjWtH¬ «}|
jXj[«}t ||jFj\j&«}n·t%|t(«s t?|d«}    t_|d ¬«\}}t ||j&«}nst%|jFt «rCta|«jb}te||jFj|j|¬«}ntg||j«}|jC«r4tjh|jj|jF¬« }|||<|}t d¬«j|«}t||j«}
t‰|1|
|«ycc} w#t$r3}t_|d¬«\}}|j&r td«|‚Yd}~ŒLd}~wwxYw)NzThe 'fastpath' keyword in Categorical is deprecated and will be removed in a future version. Use Categorical.from_codes instead©Ú
stacklevelFr‘z#Categorical input must be list-likergr©rgéz3> 1 ndim Categorical are not supported at this timeÚobject)Ú types_mapperT©Úsortzl'values' is not ordered, please explicitly specify the categories order by passing in a categories argument.rR)6rÚ
no_defaultÚwarningsÚwarnÚDeprecationWarningrr!Ú_from_values_or_dtyperr^r’r“Ú__init__rrZrirjrhr[rYr$r%r1ÚcomÚconvert_to_list_likeÚlistrWrœÚndarrayÚndimÚNotImplementedErrorr5r'rcÚwherergr Ú
issubclassrfr"Ú    _pa_arrayÚcombine_chunksÚ
dictionaryÚ    to_pandasÚindicesÚto_numpyÚ pyarrow_dtyper-r4rbr`Ú_get_codes_for_valuesÚonesÚshape)rkÚvaluesr^rYrgÚfastpathrSraÚ    null_maskÚvdtypeÚarrÚidxÚarr_listÚsanitize_dtypeÚerrÚ    old_codesÚ
full_codesr–s                 €rvr¥zCategorical.__init__ss¼ø€ð œ3Ÿ>™>Ñ )ä M‰MðUä"Ü+Ó-ö     ðˆHä ×6Ñ6Ø J ¨ó
ˆñ Ü(¨°×1AÑ1AÓBˆEÜ$¨UÔ3×@Ñ@ÀÓGˆEÜ ‰GÑ ˜U EÔ *Ø ä˜FÔ#äÐAÓBÐ Bô—H‘H˜U“Oˆ    ô˜ ¨$Ó/ˆÜ fÔ.Ô /Ø×ÑÑ'Ü(¨×):Ñ):¸E¿M¹MÓJ’ܘF¤X¬y¼.Ð$IÕJÜ×-Ñ-¨fÓ5ˆFܘ&¤$Ô'¬C°«K¸1Ò,<䟙 "¬FÔ3‘ܘF¤B§J¡JÔ/Ø—;‘; ’?ä-ØMóðô(¨°Ó5‘ô% V¨TÓ2Ü  ›I    Ø—=‘=”?ô8:·x±xÀÀ
Ó7KÈAÑ7NÖO°  s£ ÐOHÐOñ  3§9¡9°Ò#8Ø)-™à),¯©˜ä(¨°4¸~ÔNCؐà × Ñ Ñ #ܘ&Ÿ,™,¬
Ô3¼
Ø— ‘ ×!Ñ!Ô#7ô9ð×&Ñ&×5Ñ5Ó7Ø Ÿ^™^×5Ñ5Ä:Ð5ÓN
ØŸ ™ ×,Ñ,Ó.Ü(¨°V·\±\×5OÑ5O×5WÑ5WÓX‘ä! &¬(Ô3ä+¨F°DÓ9Fð #Ü(1°&¸tÔ(DÑ%E˜:ô)¨°U·]±]ÓC‘ä ˜Ÿ ™ Ô&6Ô 7Ü% fÓ-×4Ñ4ˆIÜ)ؘ6Ÿ<™<×2Ñ2°E×4DÑ4DÈ4ô‰Eô
*¨&°%×2BÑ2BÓCˆEà =‰=Œ?äŸ'™' )§/¡/¸¿¹ÔEÐEˆJØ%*ˆJ˜    zÑ "؈Eä ¨Ô/×<Ñ<¸UÓCˆÜ" 5¨%×*:Ñ*:Ó;ˆÜ ‰Ñ˜˜eÕ$ùòq Pøô2!ò    #Ü(1°&¸uÔ(EÑ%E˜:Ø—}’}ô(ðCóð #ð    #õ%ûð    #úsÇ< QÌ!QÑ    RÑ(Q=Ñ=Rcó—|jS)an
        The :class:`~pandas.api.types.CategoricalDtype` for this instance.
 
        Examples
        --------
        >>> cat = pd.Categorical(['a', 'b'], ordered=True)
        >>> cat
        ['a', 'b']
        Categories (2, object): ['a' < 'b']
        >>> cat.dtype
        CategoricalDtype(categories=['a', 'b'], ordered=True, categories_dtype=object)
        )r©rks rvrgzCategorical.dtypeîs€ð{‰{ÐrxcóP—|jj}|jd«S©NrT)Ú_ndarrayrgrf)rkrgs  rvÚ_internal_fill_valuez Categorical._internal_fill_valueþs!€ð— ‘ ×#Ñ#ˆØz‰z˜"‹~ÐrxF©rgrScó—||||¬«S)NrÉr€)r•ÚscalarsrgrSs    rvÚ_from_sequencezCategorical._from_sequences€ñ7 %¨dÔ3Ð3rxcó —|€t‚|j||¬«}t|«}||j«k(j«st‚|S)Nrš)r«rÌr'ÚallrX)r•rËrgÚresrqs     rvÚ _from_scalarszCategorical._from_scalars sO€à ˆ=ä%Ð %à× Ñ  °Ð Ó6ˆôG‹}ˆØ˜Ÿ™›
Ñ"×'Ñ'Ô)äР؈
rx.có—yrr€©rkrgrSs   rvÚastypezCategorical.astypeó€à rxcó—yrr€rÒs   rvrÓzCategorical.astyperÔrxcó—yrr€rÒs   rvrÓzCategorical.astype#rÔrxcój•—t|«}|j|ur|r|j«}|S|}|St|t«rB|jj |«}|r|j«n|}|j |«}|St|t«rt‰|%||¬«S|jdvr)|j«j«r td«‚t|j«dk(st|j «dk(r4|st#j$||¬«}|St#j&||¬«}|S|j j(}    |j||¬«}|j j*}t-||«sKt/j0t#j&|j j*«j|««}t5|t7|j8«|¬    «}|S#t2tf$r(d|j j›d|›}t|«‚wxYw)
aZ
        Coerce this type to another dtype
 
        Parameters
        ----------
        dtype : numpy dtype or pandas type
        copy : bool, default True
            By default, astype always returns a newly allocated object.
            If copy is set to False and dtype is categorical, the original
            object is returned.
        rRÚiuz#Cannot convert float NaN to integerrršrÉz Cannot cast z
 dtype to ©rs)rrgrSr[r!r’Ú
_set_dtyper#r“rÓÚkindr'rcrXrWrar^riÚasarrayrjÚ_valuesÚ    _na_valuer&rÚitem_from_zerodimrZr.rrb)rkrgrSÚresultÚnew_catsrsrnr–s       €rvrÓzCategorical.astype'sûø€ô˜UÓ#ˆØ :‰:˜Ñ Ù$(T—Y‘Y“[ˆFðXˆ ðY/3ˆFðXˆ ôU˜Ô/Ô 0à—J‘J×+Ñ+¨EÓ2ˆEÙ"&4—9‘9”;¨DˆDØ—_‘_ UÓ+ˆFðLˆ ôI˜œ~Ô .Ü‘7‘> %¨d>Ó3Ð 3à Z‰Z˜4Ñ  D§I¡I£K§O¡OÔ$5ÜÐBÓCÐ Cä —‘‹_ Ò !¤S¨¯©Ó%9¸QÒ%>ñÜŸ™ D°Ô6ð4ˆ ô1Ÿ™ $¨eÔ4ð0ˆ ð)—‘×.Ñ.ˆHð &Ø#Ÿ?™?°¸T˜?ÓBØ!Ÿ_™_×6Ñ6
Ü,¨Z¸Ô?Ü!$×!6Ñ!6ÜŸ™ §¡×!:Ñ!:Ó;×BÑBÀ5ÓIó"JôØÔ-¨d¯k©kÓ:ÀzôˆFðˆ øôÜðò &ð% T§_¡_×%:Ñ%:Ð$;¸:ÀeÀWÐMÜ  “oÐ%ð  &ús ÅBG;Ç;7H2cój—tjdtt«¬«|j    «S)z#
        Alias for tolist.
        zcCategorical.to_list is deprecated and will be removed in a future version. Use obj.tolist() insteadr˜)r¡r¢Ú FutureWarningrrrÄs rvÚto_listzCategorical.to_listcs,€ô
     ‰ ð 0ä Ü'Ó)õ        
ð {‰{‹}Ðrxcó —ddlm}m}m}m}||«}    t |t «xr|jdu}
|
rÊt|jj«r ||d¬«}    n tj|jjd«r ||d¬«}    nktj|jjd«r ||d¬«}    n6t|jj«r|€gd¢}|    j|«}    |
r|j} t||    | «} nV|    js;|    j!«} |    j#«} t|| | «} t | d    ¬
«}nt |    d    ¬
«}|} |j%| |¬ «S) aA
        Construct a Categorical from inferred values.
 
        For inferred categories (`dtype` is None) the categories are sorted.
        For explicit `dtype`, the `inferred_categories` are cast to the
        appropriate type.
 
        Parameters
        ----------
        inferred_categories : Index
        inferred_codes : Index
        dtype : CategoricalDtype or 'category'
        true_values : list, optional
            If none are provided, the default ones are
            "True", "TRUE", and "true."
 
        Returns
        -------
        Categorical
        r)rIÚ to_datetimeÚ
to_numericÚ to_timedeltaNÚcoerce)ÚerrorsÚMÚm)ÚTrueÚTRUEÚtrueFr‘rš)ÚpandasrIrærçrèr[r!r^rrgrÚ is_np_dtyperÚisinr`Úis_monotonic_increasingrSÚ sort_valuesr”)r•Úinferred_categoriesÚinferred_codesrgÚ true_valuesrIrærçrèÚcatsÚknown_categoriesr^raÚunsorteds              rvÚ_from_inferred_categoriesz%Categorical._from_inferred_categoriespsX€÷0    
ó    
ñÐ(Ó)ˆä uÔ.Ó /Ò P°E×4DÑ4DÈDÐ4Pð    ñ ä(¨×)9Ñ)9×)?Ñ)?Ô@Ù!Ð"5¸hÔG‘Ü—‘ ×!1Ñ!1×!7Ñ!7¸Ô=Ù"Ð#6¸xÔH‘Ü—‘ ×!1Ñ!1×!7Ñ!7¸Ô=Ù#Ð$7ÀÔI‘ܘu×/Ñ/×5Ñ5Ô6ØÐ&Ú":Kð—y‘y Ó-á à×)Ñ)ˆJÜ)¨.¸$À
ÓK‰EØ×-Ò-à—y‘y“{ˆHØ×)Ñ)Ó+ˆJä)¨.¸(ÀJÓOˆEÜ$ Z¸Ô?‰Eä$ T°5Ô9ˆEØ"ˆEà‰˜u¨EˆÓ2Ð2rxcó´—tj|||¬«}|j€ d}t|«‚|r|j    ||¬«}|j ||¬«S)a
        Make a Categorical type from codes and categories or dtype.
 
        This constructor is useful if you already have codes and
        categories/dtype and so do not need the (computation intensive)
        factorization step, which is usually done on the constructor.
 
        If your data does not follow this convention, please use the normal
        constructor.
 
        Parameters
        ----------
        codes : array-like of int
            An integer array, where each integer points to a category in
            categories or dtype.categories, or else is -1 for NaN.
        categories : index-like, optional
            The categories for the categorical. Items need to be unique.
            If the categories are not given here, then they must be provided
            in `dtype`.
        ordered : bool, optional
            Whether or not this categorical is treated as an ordered
            categorical. If not given here or in `dtype`, the resulting
            categorical will be unordered.
        dtype : CategoricalDtype or "category", optional
            If :class:`CategoricalDtype`, cannot be used together with
            `categories` or `ordered`.
        validate : bool, default True
            If True, validate that the codes are valid for the dtype.
            If False, don't validate that the codes are valid. Be careful about skipping
            validation, as invalid codes can lead to severe problems, such as segfaults.
 
            .. versionadded:: 2.1.0
 
        Returns
        -------
        Categorical
 
        Examples
        --------
        >>> dtype = pd.CategoricalDtype(['a', 'b'], ordered=True)
        >>> pd.Categorical.from_codes(codes=[0, 1, 0, 1], dtype=dtype)
        ['a', 'b', 'a', 'b']
        Categories (2, object): ['a' < 'b']
        )r^rYrgzKThe categories must be provided in 'categories' or 'dtype'. Both were None.rš)r!r¤r^rXÚ_validate_codes_for_dtyper”)r•rar^rYrgÚvalidaterns       rvÚ
from_codeszCategorical.from_codesµsk€ôj!×6Ñ6Ø!¨7¸%ô
ˆð × Ñ Ð #ð+ð ô˜S“/Ð !á à×1Ñ1°%¸uÐ1ÓEˆEà‰˜u¨EˆÓ2Ð2rxcó.—|jjS)a]
        The categories of this categorical.
 
        Setting assigns new values to each category (effectively a rename of
        each individual category).
 
        The assigned value has to be a list-like object. All items must be
        unique and the number of items in the new categories must be the same
        as the number of items in the old categories.
 
        Raises
        ------
        ValueError
            If the new categories do not validate as categories or if the
            number of new categories is unequal the number of old categories
 
        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.
 
        Examples
        --------
        For :class:`pandas.Series`:
 
        >>> ser = pd.Series(['a', 'b', 'c', 'a'], dtype='category')
        >>> ser.cat.categories
        Index(['a', 'b', 'c'], dtype='object')
 
        >>> raw_cat = pd.Categorical(['a', 'b', 'c', 'a'], categories=['b', 'c', 'd'])
        >>> ser = pd.Series(raw_cat)
        >>> ser.cat.categories
        Index(['b', 'c', 'd'], dtype='object')
 
        For :class:`pandas.Categorical`:
 
        >>> cat = pd.Categorical(['a', 'b'], ordered=True)
        >>> cat.categories
        Index(['a', 'b'], dtype='object')
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'c', 'b', 'a', 'c', 'b'])
        >>> ci.categories
        Index(['a', 'b', 'c'], dtype='object')
 
        >>> ci = pd.CategoricalIndex(['a', 'c'], categories=['c', 'b', 'a'])
        >>> ci.categories
        Index(['c', 'b', 'a'], dtype='object')
        )rgr^rÄs rvr^zCategorical.categoriesýs€ðpz‰z×$Ñ$Ð$rxcó.—|jjS)a{
        Whether the categories have an ordered relationship.
 
        Examples
        --------
        For :class:`pandas.Series`:
 
        >>> ser = pd.Series(['a', 'b', 'c', 'a'], dtype='category')
        >>> ser.cat.ordered
        False
 
        >>> raw_cat = pd.Categorical(['a', 'b', 'c', 'a'], ordered=True)
        >>> ser = pd.Series(raw_cat)
        >>> ser.cat.ordered
        True
 
        For :class:`pandas.Categorical`:
 
        >>> cat = pd.Categorical(['a', 'b'], ordered=True)
        >>> cat.ordered
        True
 
        >>> cat = pd.Categorical(['a', 'b'], ordered=False)
        >>> cat.ordered
        False
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'b'], ordered=True)
        >>> ci.ordered
        True
 
        >>> ci = pd.CategoricalIndex(['a', 'b'], ordered=False)
        >>> ci.ordered
        False
        )rgrYrÄs rvrYzCategorical.ordered7s€ðLz‰z×!Ñ!Ð!rxcó\—|jj«}d|j_|S)a§
        The category codes of this categorical index.
 
        Codes are an array of integers which are the positions of the actual
        values in the categories array.
 
        There is no setter, use the other categorical methods and the normal item
        setter to change values in the categorical.
 
        Returns
        -------
        ndarray[int]
            A non-writable view of the ``codes`` array.
 
        Examples
        --------
        For :class:`pandas.Categorical`:
 
        >>> cat = pd.Categorical(['a', 'b'], ordered=True)
        >>> cat.codes
        array([0, 1], dtype=int8)
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'])
        >>> ci.codes
        array([0, 1, 2, 0, 1, 2], dtype=int8)
 
        >>> ci = pd.CategoricalIndex(['a', 'c'], categories=['c', 'b', 'a'])
        >>> ci.codes
        array([2, 0], dtype=int8)
        F)rbÚviewÚflagsÚ    writeable)rkÚvs  rvrazCategorical.codes_s(€ðD K‰K× Ñ Ó ˆØ!ˆ‰Ô؈rxcó^•—|r!tj||j«}nt||j¬«}|sV|jj@t |j«t |jj«k7r t d«‚t‰|!|j|«y)aä
        Sets new categories inplace
 
        Parameters
        ----------
        fastpath : bool, default False
           Don't perform validation of the categories for uniqueness or nulls
 
        Examples
        --------
        >>> c = pd.Categorical(['a', 'b'])
        >>> c
        ['a', 'b']
        Categories (2, object): ['a', 'b']
 
        >>> c._set_categories(pd.Index(['a', 'c']))
        >>> c
        ['a', 'c']
        Categories (2, object): ['a', 'c']
        r‘NzKnew categories need to have the same number of items as the old categories!)
r!Ú_from_fastpathrYrgr^rWrXr“r¥rÇ)rkr^r¹Ú    new_dtyper–s    €rvÚ_set_categorieszCategorical._set_categories…sŠø€ñ* Ü(×7Ñ7¸
ÀDÇLÁLÓQ‰Iä(¨¸T¿\¹\ÔJˆIáØ—
‘
×%Ñ%Ð1ܐI×(Ñ(Ó)¬S°·±×1FÑ1FÓ-GÒGäð/óð ô
    ‰Ñ˜Ÿ™¨    Õ2rxcó—t|j|j|j«}t|«j    ||¬«S)a+
        Internal method for directly updating the CategoricalDtype
 
        Parameters
        ----------
        dtype : CategoricalDtype
 
        Notes
        -----
        We don't do any validation here. It's assumed that the dtype is
        a (valid) instance of `CategoricalDtype`.
        rš)r`rar^rfr”)rkrgras   rvrÚzCategorical._set_dtypeªs:€ô& d§j¡j°$·/±/À5×CSÑCSÓTˆÜD‹z×%Ñ% e°5Ð%Ó9Ð9rxcó–—t|j|¬«}|j«}tj||j
|«|S)zÇ
        Set the ordered attribute to the boolean value.
 
        Parameters
        ----------
        value : bool
           Set whether this categorical is ordered (True) or not (False).
        r‘)r!r^rSrr¥rÇ)rkÚvaluer    rˆs    rvÚ set_orderedzCategorical.set_orderedºs:€ô% T§_¡_¸eÔDˆ    Øi‰i‹kˆÜ×јs C§L¡L°)Ô<؈
rxcó$—|jd«S)ae
        Set the Categorical to be ordered.
 
        Returns
        -------
        Categorical
            Ordered Categorical.
 
        Examples
        --------
        For :class:`pandas.Series`:
 
        >>> ser = pd.Series(['a', 'b', 'c', 'a'], dtype='category')
        >>> ser.cat.ordered
        False
        >>> ser = ser.cat.as_ordered()
        >>> ser.cat.ordered
        True
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'b', 'c', 'a'])
        >>> ci.ordered
        False
        >>> ci = ci.as_ordered()
        >>> ci.ordered
        True
        T©rrÄs rvÚ
as_orderedzCategorical.as_orderedÈs€ð:×Ñ Ó%Ð%rxcó$—|jd«S)a¥
        Set the Categorical to be unordered.
 
        Returns
        -------
        Categorical
            Unordered Categorical.
 
        Examples
        --------
        For :class:`pandas.Series`:
 
        >>> raw_cat = pd.Categorical(['a', 'b', 'c', 'a'], ordered=True)
        >>> ser = pd.Series(raw_cat)
        >>> ser.cat.ordered
        True
        >>> ser = ser.cat.as_unordered()
        >>> ser.cat.ordered
        False
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'b', 'c', 'a'], ordered=True)
        >>> ci.ordered
        True
        >>> ci = ci.as_unordered()
        >>> ci.ordered
        False
        FrrÄs rvÚ as_unorderedzCategorical.as_unorderedçs€ð<×Ñ Ó&Ð&rxcó—|€|jj}t||¬«}|j«}|r‡|jjdt |j«t |jj«kr/d|j |j t |j«k\<|j }n+t|j|j|j«}tj|||«|S)aÍ
        Set the categories to the specified new categories.
 
        ``new_categories`` can include new categories (which will result in
        unused categories) or remove old categories (which results in values
        set to ``NaN``). If ``rename=True``, the categories will simply be renamed
        (less or more items than in old categories will result in values set to
        ``NaN`` or in unused categories respectively).
 
        This method can be used to perform more than one action of adding,
        removing, and reordering simultaneously and is therefore faster than
        performing the individual steps via the more specialised methods.
 
        On the other hand this methods does not do checks (e.g., whether the
        old categories are included in the new categories on a reorder), which
        can result in surprising changes, for example when using special string
        dtypes, which does not considers a S1 string equal to a single char
        python string.
 
        Parameters
        ----------
        new_categories : Index-like
           The categories in new order.
        ordered : bool, default False
           Whether or not the categorical is treated as a ordered categorical.
           If not given, do not change the ordered information.
        rename : bool, default False
           Whether or not the new_categories should be considered as a rename
           of the old categories or as reordered categories.
 
        Returns
        -------
        Categorical with reordered categories.
 
        Raises
        ------
        ValueError
            If new_categories does not validate as categories
 
        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
 
        Examples
        --------
        For :class:`pandas.Series`:
 
        >>> raw_cat = pd.Categorical(['a', 'b', 'c', 'A'],
        ...                           categories=['a', 'b', 'c'], ordered=True)
        >>> ser = pd.Series(raw_cat)
        >>> ser
        0   a
        1   b
        2   c
        3   NaN
        dtype: category
        Categories (3, object): ['a' < 'b' < 'c']
 
        >>> ser.cat.set_categories(['A', 'B', 'C'], rename=True)
        0   A
        1   B
        2   C
        3   NaN
        dtype: category
        Categories (3, object): ['A' < 'B' < 'C']
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'b', 'c', 'A'],
        ...                          categories=['a', 'b', 'c'], ordered=True)
        >>> ci
        CategoricalIndex(['a', 'b', 'c', nan], categories=['a', 'b', 'c'],
                         ordered=True, dtype='category')
 
        >>> ci.set_categories(['A', 'b', 'c'])
        CategoricalIndex([nan, 'b', 'c', nan], categories=['A', 'b', 'c'],
                         ordered=True, dtype='category')
        >>> ci.set_categories(['A', 'b', 'c'], rename=True)
        CategoricalIndex(['A', 'b', 'c', nan], categories=['A', 'b', 'c'],
                         ordered=True, dtype='category')
        r‘rT) rgrYr!rSr^rWrbr`rarr¥)rkÚnew_categoriesrYÚrenamer    rˆras       rvÚset_categorieszCategorical.set_categoriessҀðn ˆ?Ø—j‘j×(Ñ(ˆGÜ$ ^¸WÔEˆ    ài‰i‹kˆÙ ؏y‰y×#Ñ#Ð/´C¸    ×8LÑ8LÓ4MÔPSØ—    ‘    ×$Ñ$óQò5ðGI—
‘
˜3Ÿ:™:¬¨Y×-AÑ-AÓ)BÑBÑCØ—J‘J‰Eä)Ø—    ‘    ˜3Ÿ>™>¨9×+?Ñ+?óˆEô    ×јs E¨9Ô5؈
rxcó—t|«r*|jDcgc]}|j||«‘Œ}}n*t|«r|jDcgc]
}||«‘Œ }}|j    «}|j |«|Scc}wcc}w)aÉ
        Rename categories.
 
        Parameters
        ----------
        new_categories : list-like, dict-like or callable
 
            New categories which will replace old categories.
 
            * list-like: all items must be unique and the number of items in
              the new categories must match the existing number of categories.
 
            * dict-like: specifies a mapping from
              old categories to new. Categories not contained in the mapping
              are passed through and extra categories in the mapping are
              ignored.
 
            * callable : a callable that is called on all items in the old
              categories and whose return values comprise the new categories.
 
        Returns
        -------
        Categorical
            Categorical with renamed categories.
 
        Raises
        ------
        ValueError
            If new categories are list-like and do not have the same number of
            items than the current categories or do not validate as categories
 
        See Also
        --------
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.
 
        Examples
        --------
        >>> c = pd.Categorical(['a', 'a', 'b'])
        >>> c.rename_categories([0, 1])
        [0, 0, 1]
        Categories (2, int64): [0, 1]
 
        For dict-like ``new_categories``, extra keys are ignored and
        categories not in the dictionary are passed through
 
        >>> c.rename_categories({'a': 'A', 'c': 'C'})
        ['A', 'A', 'b']
        Categories (2, object): ['A', 'b']
 
        You may also provide a callable to create the new categories
 
        >>> c.rename_categories(lambda x: x.upper())
        ['A', 'A', 'B']
        Categories (2, object): ['A', 'B']
        )rr^ÚgetÚcallablerSr
)rkrÚitemrˆs    rvÚrename_categorieszCategorical.rename_categoriesqs‡€ôz ˜Ô 'à;?¿?¹?öØ37×"Ñ" 4¨Õ.ðˆNñônÔ %Ø?C¿¹ÖO°t™n¨TÕ2ÐOˆNÐOài‰i‹kˆØ ×јNÔ+؈
ùòùòPs šBÁBcóʗt|j«t|«k7s%|jj|«js t    d«‚|j ||¬«S)aÞ
        Reorder categories as specified in new_categories.
 
        ``new_categories`` need to include all old categories and no new category
        items.
 
        Parameters
        ----------
        new_categories : Index-like
           The categories in new order.
        ordered : bool, optional
           Whether or not the categorical is treated as a ordered categorical.
           If not given, do not change the ordered information.
 
        Returns
        -------
        Categorical
            Categorical with reordered categories.
 
        Raises
        ------
        ValueError
            If the new categories do not contain all old category items or any
            new ones
 
        See Also
        --------
        rename_categories : Rename categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.
 
        Examples
        --------
        For :class:`pandas.Series`:
 
        >>> ser = pd.Series(['a', 'b', 'c', 'a'], dtype='category')
        >>> ser = ser.cat.reorder_categories(['c', 'b', 'a'], ordered=True)
        >>> ser
        0   a
        1   b
        2   c
        3   a
        dtype: category
        Categories (3, object): ['c' < 'b' < 'a']
 
        >>> ser.sort_values()
        2   c
        1   b
        0   a
        3   a
        dtype: category
        Categories (3, object): ['c' < 'b' < 'a']
 
        For :class:`pandas.CategoricalIndex`:
 
        >>> ci = pd.CategoricalIndex(['a', 'b', 'c', 'a'])
        >>> ci
        CategoricalIndex(['a', 'b', 'c', 'a'], categories=['a', 'b', 'c'],
                         ordered=False, dtype='category')
        >>> ci.reorder_categories(['c', 'b', 'a'], ordered=True)
        CategoricalIndex(['a', 'b', 'c', 'a'], categories=['c', 'b', 'a'],
                         ordered=True, dtype='category')
        z=items in new_categories are not the same as in old categoriesr‘)rWr^Ú
differenceÚemptyrXr)rkrrYs   rvÚreorder_categorieszCategorical.reorder_categories¹s[€ôF —‘Ó  ¤C¨Ó$7Ò 7Ø—?‘?×-Ñ-¨nÓ=×CÒCäØOóð ð×"Ñ" >¸7Ð"ÓCÐCrxcó¶—t|«s|g}t|«t|jj«z}t    |«dk7rt d|›«‚t |d«roddlm}t|jjj|jg«}|t|jj«t|«z|¬«}n+t|jj«t|«z}t||j«}|j«}t|j|j«}t!j"|||«|S)a¨
        Add new categories.
 
        `new_categories` will be included at the last/highest place in the
        categories and will be unused directly after this call.
 
        Parameters
        ----------
        new_categories : category or list-like of category
           The new categories to be included.
 
        Returns
        -------
        Categorical
            Categorical with new categories added.
 
        Raises
        ------
        ValueError
            If the new categories include old categories or do not validate as
            categories
 
        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        remove_categories : Remove the specified categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.
 
        Examples
        --------
        >>> c = pd.Categorical(['c', 'b', 'c'])
        >>> c
        ['c', 'b', 'c']
        Categories (2, object): ['b', 'c']
 
        >>> c.add_categories(['d', 'a'])
        ['c', 'b', 'c']
        Categories (4, object): ['b', 'c', 'd', 'a']
        rz0new categories must not include old categories: rg©rJrš)rÚsetrgr^rWrXÚhasattrrðrJrr¨r!rYrSrrÇrr¥)rkrÚalready_includedrJrgr    rˆras        rvÚadd_categorieszCategorical.add_categoriess$€ôV˜NÔ+Ø,Ð-ˆNܘ~Ó.´°T·Z±Z×5JÑ5JÓ1KÑKÐÜ ÐÓ   AÒ %ÜØBÐCSÐBTÐUóð ô > 7Ô +Ý %ä$Ø—‘×&Ñ&×,Ñ,¨n×.BÑ.BÐCóˆEñ$ܐT—Z‘Z×*Ñ*Ó+¬d°>Ó.BÑBÈ%ô‰Nô" $§*¡*×"7Ñ"7Ó8¼4ÀÓ;OÑOˆNä$ ^°T·\±\ÓBˆ    Øi‰i‹kˆÜ$ S§\¡\°9×3GÑ3GÓHˆÜ×јs E¨9Ô5؈
rxcó—ddlm}t|«s|g}||«j«j    «}|j
j dur'|j
jj|d¬«n$|j
jj|«}|j|j
j«}t|«dk7rt|«}td|›«‚|j||j d¬«S)a‘
        Remove the specified categories.
 
        `removals` must be included in the old categories. Values which were in
        the removed categories will be set to NaN
 
        Parameters
        ----------
        removals : category or list of categories
           The categories which should be removed.
 
        Returns
        -------
        Categorical
            Categorical with removed categories.
 
        Raises
        ------
        ValueError
            If the removals are not contained in the categories
 
        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_unused_categories : Remove categories which are not used.
        set_categories : Set the categories to the specified ones.
 
        Examples
        --------
        >>> c = pd.Categorical(['a', 'c', 'b', 'c', 'd'])
        >>> c
        ['a', 'c', 'b', 'c', 'd']
        Categories (4, object): ['a', 'b', 'c', 'd']
 
        >>> c.remove_categories(['d', 'a'])
        [NaN, 'c', 'b', 'c', NaN]
        Categories (2, object): ['b', 'c']
        r©rITFržz(removals must all be in old categories: )rYr) rðrIrÚuniqueÚdropnargrYr^rrWr#rXr)rkÚremovalsrIrÚ not_includeds     rvÚremove_categorieszCategorical.remove_categoriesIså€õR    !ä˜HÔ%Ø zˆHᘓ?×)Ñ)Ó+×2Ñ2Ó4ˆðz‰z×!Ñ! TÑ)ð J‰J× !Ñ !× ,Ñ ,¨X¸EÐ ,Ô Bà—‘×&Ñ&×1Ñ1°(Ó;ð    ð
 ×*Ñ*¨4¯:©:×+@Ñ+@ÓAˆ ä ˆ|Ó  Ò !ܘ|Ó,ˆLÜÐGÈ À~ÐVÓWÐ Wà×"Ñ" >¸4¿<¹<ÐPUÐ"ÓVÐVrxcó–—tj|jd¬«\}}|jdk7r|ddk(r
|dd|dz
}}|jj
j |«}tj||j¬«}t||j
«}|j«}tj|||«|S)a¡
        Remove categories which are not used.
 
        Returns
        -------
        Categorical
            Categorical with unused categories dropped.
 
        See Also
        --------
        rename_categories : Rename categories.
        reorder_categories : Reorder categories.
        add_categories : Add new categories.
        remove_categories : Remove the specified categories.
        set_categories : Set the categories to the specified ones.
 
        Examples
        --------
        >>> c = pd.Categorical(['a', 'c', 'b', 'c', 'd'])
        >>> c
        ['a', 'c', 'b', 'c', 'd']
        Categories (4, object): ['a', 'b', 'c', 'd']
 
        >>> c[2] = 'a'
        >>> c[4] = 'c'
        >>> c
        ['a', 'c', 'a', 'c', 'c']
        Categories (4, object): ['a', 'b', 'c', 'd']
 
        >>> c.remove_unused_categories()
        ['a', 'c', 'a', 'c', 'c']
        Categories (2, object): ['a', 'c']
        T)Úreturn_inverserrTr›Nr‘)rir)rbÚsizergr^Útaker!rrYrrSrr¥)rkr½Úinvrr    Ú    new_codesrˆs       rvÚremove_unused_categoriesz$Categorical.remove_unused_categories…s®€ôD—9‘9˜TŸ[™[¸Ô>‰ˆˆSà 8‰8qŠ=˜S ™V rš\ؘ1˜2w  a¡ˆCàŸ™×.Ñ.×3Ñ3°CÓ8ˆÜ$×3Ñ3Ø  D§L¡Lô
ˆ    ô)¨¨i×.BÑ.BÓCˆ    ài‰i‹kˆÜ×јs I¨yÔ9؈
rxcó6—|tjur&tjdtt «¬«d}t |«s t|«sJ‚|jj|«}tj|jdk(«}tj}|€Q|rOt |«r|tj«n-|jtjtj«}|jra|j sU|tjurCt#||j$¬«}|j'|jj)«|d¬«S|r|j+t-|«|«}tj.||j«S)a
        Map categories using an input mapping or function.
 
        Maps the categories to new categories. If the mapping correspondence is
        one-to-one the result is a :class:`~pandas.Categorical` which has the
        same order property as the original, otherwise a :class:`~pandas.Index`
        is returned. NaN values are unaffected.
 
        If a `dict` or :class:`~pandas.Series` is used any unmapped category is
        mapped to `NaN`. Note that if this happens an :class:`~pandas.Index`
        will be returned.
 
        Parameters
        ----------
        mapper : function, dict, or Series
            Mapping correspondence.
        na_action : {None, 'ignore'}, default 'ignore'
            If 'ignore', propagate NaN values, without passing them to the
            mapping correspondence.
 
            .. deprecated:: 2.1.0
 
               The default value of 'ignore' has been deprecated and will be changed to
               None in the future.
 
        Returns
        -------
        pandas.Categorical or pandas.Index
            Mapped categorical.
 
        See Also
        --------
        CategoricalIndex.map : Apply a mapping correspondence on a
            :class:`~pandas.CategoricalIndex`.
        Index.map : Apply a mapping correspondence on an
            :class:`~pandas.Index`.
        Series.map : Apply a mapping correspondence on a
            :class:`~pandas.Series`.
        Series.apply : Apply more complex functions on a
            :class:`~pandas.Series`.
 
        Examples
        --------
        >>> cat = pd.Categorical(['a', 'b', 'c'])
        >>> cat
        ['a', 'b', 'c']
        Categories (3, object): ['a', 'b', 'c']
        >>> cat.map(lambda x: x.upper(), na_action=None)
        ['A', 'B', 'C']
        Categories (3, object): ['A', 'B', 'C']
        >>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'}, na_action=None)
        ['first', 'second', 'third']
        Categories (3, object): ['first', 'second', 'third']
 
        If the mapping is one-to-one the ordering of the categories is
        preserved:
 
        >>> cat = pd.Categorical(['a', 'b', 'c'], ordered=True)
        >>> cat
        ['a', 'b', 'c']
        Categories (3, object): ['a' < 'b' < 'c']
        >>> cat.map({'a': 3, 'b': 2, 'c': 1}, na_action=None)
        [3, 2, 1]
        Categories (3, int64): [3 < 2 < 1]
 
        If the mapping is not one-to-one an :class:`~pandas.Index` is returned:
 
        >>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}, na_action=None)
        Index(['first', 'second', 'first'], dtype='object')
 
        If a `dict` is used, all unmapped categories are mapped to `NaN` and
        the result is an :class:`~pandas.Index`:
 
        >>> cat.map({'a': 'first', 'b': 'second'}, na_action=None)
        Index(['first', 'second', nan], dtype='object')
        zÝThe default value of 'ignore' for the `na_action` parameter in pandas.Categorical.map is deprecated and will be changed to 'None' in a future version. Please set na_action to the desired value to avoid seeing this warningr˜ÚignorerTr‘F©rgrþ)rr r¡r¢rãrrrr^ÚmaprircrbÚnanrÚ    is_uniqueÚhasnansr!rYrÿrSÚinsertrWr1)rkÚmapperÚ    na_actionrÚhas_nansÚna_valr    s       rvr8zCategorical.map¸s2€ðb œŸ™Ñ &Ü M‰Mð=ôÜ+Ó-õ  ð!ˆIä˜Ô¤<°Ô#7Ð7Ð7àŸ™×,Ñ,¨VÓ4ˆä—6‘6˜$Ÿ+™+¨Ñ+Ó,ˆä—‘ˆØ Ð ¡Ü'/°Ô'7‘VœBŸF™F”^¸V¿Z¹ZÌÏÉÔPR×PVÑPVÓ=WˆFà × #Ò #¨N×,BÒ,BÀvÔQS×QWÑQWÑGWÜ(¨ÀÇÁÔNˆIØ—?‘? 4§;¡;×#3Ñ#3Ó#5¸YÐQV?ÓWÐ Wá Ø+×2Ñ2´3°~Ó3FÈÓOˆNäw‰w~ t§{¡{Ó3Ð3rxcó\—t|«s|j|«S|j|«Sr)rÚ_validate_listlikeÚ_validate_scalar)rkr s  rvÚ_validate_setitem_valuez#Categorical._validate_setitem_value1s,€Ü˜5Ô!à×*Ñ*¨5Ó1Ð 1à×(Ñ(¨Ó/Ð /rxcó¬—t||jj«rd}|S||jvr|j|«}|St    d|›d«d‚)aK
        Convert a user-facing fill_value to a representation to use with our
        underlying ndarray, raising TypeError if this is not possible.
 
        Parameters
        ----------
        fill_value : object
 
        Returns
        -------
        fill_value : int
 
        Raises
        ------
        TypeError
        rTz5Cannot setitem on a Categorical with a new category (z), set the categories firstN)r&r^rgrdrZ)rkrss  rvrCzCategorical._validate_scalar8sr€ô$ ! ¨T¯_©_×-BÑ-BÔ C؈JðÐð˜4Ÿ?™?Ñ *Ø×+Ñ+¨JÓ7ˆJð Ðô    ðØ'˜LÐ(CðEóðð rxcóþ—t|t«rZt|j«rEt    |«j «r t d«‚|jtj¬«}ntj|«}t|«r#|jjdvr t d«‚t|«rD|j«t|j«k\s|j«dkr t d«‚|S)Nzcodes cannot contain NA valuesršrØz$codes need to be array-like integersrTz1codes need to be between -1 and len(categories)-1)r[r1rrgr'rcrXr³riÚint64rÜrWrÛÚmaxr^Úmin)r•rargs   rvrýz%Categorical._validate_codes_for_dtypeUs¶€ä eœ^Ô ,Ô1AÀ%Ç+Á+Ô1NäE‹{‰Ô Ü Ð!AÓBÐBØ—N‘N¬¯©NÓ2‰Eä—J‘J˜uÓ%ˆEÜ ˆuŒ:˜%Ÿ+™+×*Ñ*°$Ñ6ÜÐCÓDÐ Dä ˆuŒ:˜5Ÿ9™9›;¬#¨e×.>Ñ.>Ó*?Ò?À5Ç9Á9Ã;ÐQSÒCSÜÐPÓQÐ Q؈ rxcóԗ|dur$tjdtt«¬«t    |j
j |j«}tj||¬«S)a
        The numpy array interface.
 
        Users should not call this directly. Rather, it is invoked by
        :func:`numpy.array` and :func:`numpy.asarray`.
 
        Parameters
        ----------
        dtype : np.dtype or None
            Specifies the the dtype for the array.
 
        copy : bool or None, optional
            See :func:`numpy.asarray`.
 
        Returns
        -------
        numpy.array
            A numpy array of either the specified dtype or,
            if dtype==None (default), the same dtype as
            categorical.categories.dtype.
 
        Examples
        --------
 
        >>> cat = pd.Categorical(['a', 'b'], ordered=True)
 
        The following calls ``cat.__array__``
 
        >>> np.asarray(cat)
        array(['a', 'b'], dtype=object)
        FaSStarting with NumPy 2.0, the behavior of the 'copy' keyword has changed and passing 'copy=False' raises an error when returning a zero-copy NumPy array is not possible. pandas will follow this behavior starting with pandas 3.0.
This conversion to NumPy requires a copy, but 'copy=False' was passed. Consider using 'np.asarray(..)' instead.r˜rš)
r¡r¢rãrr.r^rÝrbrirÜ)rkrgrSrps    rvÚ    __array__zCategorical.__array__gsW€ðF 5‰=Ü M‰Mð2ô Ü+Ó-õ     ôd—o‘o×-Ñ-¨t¯{©{Ó;ˆô z‰z˜# UÔ+Ð+rxcó(—tj|||g|¢­i|¤Ž}|tur|Sd|vrtj|||g|¢­i|¤ŽS|dk(r%tj|||g|¢­i|¤Ž}|tur|St d|j ›d|j›«‚)NÚoutÚreducezObject with dtype z cannot perform the numpy op )r)Ú!maybe_dispatch_ufunc_to_dunder_opÚNotImplementedÚdispatch_ufunc_with_outÚdispatch_reduction_ufuncrZrgry)rkÚufuncÚmethodÚinputsÚkwargsràs      rvÚ__array_ufunc__zCategorical.__array_ufunc__žs׀ä×<Ñ<Ø %˜ð
Ø"(ò
Ø,2ñ
ˆð œÑ '؈Mà F‰?ä×4Ñ4ؐe˜VðØ&,òØ06ñð ð XÒ ä×7Ñ7ؐe˜VðØ&,òØ06ñˆFðœ^Ñ+ؐ ôØ  §¡  ð-Ø!ŸN™NÐ+ð -ó
ð    
rxcó̕—t|t«st‰| |«Sd|vrt    |d|d«|d<d|vrd|vr|j d«|d<t‰| |«y)z*Necessary for making this object picklablerÚ _categoriesÚ_orderedrbrÇN)r[Údictr“Ú __setstate__r!Úpop)rkÚstater–s  €rvr\zCategorical.__setstate__»snø€ä˜%¤Ô&Ü‘7Ñ'¨Ó.Ð .à ˜5Ñ  Ü.¨u°]Ñ/CÀUÈ:ÑEVÓWˆE(‰Oà uÑ  °5Ñ!8à %§    ¡    ¨(Ó 3ˆE*Ñ ä ‰Ñ˜UÕ#rxcó„—|jj|jjjjzSr)rbÚnbytesrgr^r¸rÄs rvr`zCategorical.nbytesÉs-€à{‰{×!Ñ! D§J¡J×$9Ñ$9×$@Ñ$@×$GÑ$GÑGÐGrxcó|—|jj|jjj    |¬«zS)aè
        Memory usage of my values
 
        Parameters
        ----------
        deep : bool
            Introspect the data deeply, interrogate
            `object` dtypes for system-level memory consumption
 
        Returns
        -------
        bytes used
 
        Notes
        -----
        Memory usage does not include memory consumed by elements that
        are not components of the array if deep=False
 
        See Also
        --------
        numpy.ndarray.nbytes
        )Údeep)rbr`rgr^Ú memory_usage)rkrbs  rvrczCategorical.memory_usageÍs1€ð.{‰{×!Ñ! D§J¡J×$9Ñ$9×$FÑ$FÈDÐ$FÓ$QÑQÐQrxcó —|jdk(S)aX
        Detect missing values
 
        Missing values (-1 in .codes) are detected.
 
        Returns
        -------
        np.ndarray[bool] of whether my values are null
 
        See Also
        --------
        isna : Top-level isna.
        isnull : Alias of isna.
        Categorical.notna : Boolean inverse of Categorical.isna.
 
        rT)rbrÄs rvr'zCategorical.isnaæs€ð"{‰{˜bѠРrxcó$—|j«S)a„
        Inverse of isna
 
        Both missing values (-1 in .codes) and NA as a category are detected as
        null.
 
        Returns
        -------
        np.ndarray[bool] of whether my values are not null
 
        See Also
        --------
        notna : Top-level notna.
        notnull : Alias of notna.
        Categorical.isna : Boolean inverse of Categorical.notna.
 
        )r'rÄs rvÚnotnazCategorical.notnaûs€ð$—    ‘    “ ˆ|Ðrxcó—ddlm}m}|j|j}}t |«|dk\}}t j|«|j«}    }|s|    r%|    r|n||}
t j|
|xsd¬«} n@t jt j|||««} t j|d«}t||jj«}|j|«}|| ||«ddd¬«S)    a{
        Return a Series containing counts of each category.
 
        Every category will have an entry, even those with a count of 0.
 
        Parameters
        ----------
        dropna : bool, default True
            Don't include counts of NaN.
 
        Returns
        -------
        counts : Series
 
        See Also
        --------
        Series.value_counts
        r)ÚCategoricalIndexrJ)Ú    minlengthrTrGÚcountF)ÚindexrgÚnamerS)rðrhrJrbr^rWriÚarangerÎÚbincountr¬ÚappendrrgÚ_from_backing_data) rkr*rhrJÚcoderˆÚncatrqÚixÚcleanÚobsrjs             rvÚ value_countszCategorical.value_countss؀÷&    
ð
—K‘K §¡ˆcˆÜ˜#“h ¨¡    ˆdˆÜ—I‘I˜d“O T§X¡X£ZˆEˆá ‘UÙ‘$ T¨$¡ZˆCÜ—K‘K ¨tªy°qÔ9‰Eä—K‘K¤§¡¨¨t°TÓ :Ó;ˆEÜ—‘˜2˜rÓ"ˆBä ! " d§j¡j×&;Ñ&;Ó <ˆØ × $Ñ $ RÓ (ˆáØ Ñ)¨"Ó-°WÀ7ÐQVô
ð    
rxcó —|jg|¬«}tj||jj¬«}|j |«S)zž
        Analogous to np.empty(shape, dtype=dtype)
 
        Parameters
        ----------
        shape : tuple[int]
        dtype : CategoricalDtype
        rš)rÌriÚzerosrÇrgrp)r•r·rgr¼Úbackings     rvÚ_emptyzCategorical._empty>sF€ð× Ñ  ¨5РÓ1ˆô
—(‘(˜5¨¯ © ×(:Ñ(:Ô;ˆà×%Ñ% gÓ.Ð.rxcóÊ—t|jj«r5|jj|jt
¬«j St|jj«r\d|jvrN|jjd«j|jtj¬«j Stj|«S)a
        Return the values.
 
        For internal compatibility with pandas formatting.
 
        Returns
        -------
        np.ndarray or ExtensionArray
            A numpy array or ExtensionArray of the same dtype as
            categorical.categories.dtype.
        rÙrTrœ) rr^rgr1rbr rÝrrÓrir9rjrÄs rvÚ_internal_get_valuesz Categorical._internal_get_valuesSs™€ô ˜tŸ™×4Ñ4Ô 5Ø—?‘?×'Ñ'¨¯ © ÄÐ'ÓD×LÑLÐ LÜ ˜dŸo™o×3Ñ3Ô 4¸¸t¿{¹{Ñ9Jà—‘×&Ñ& xÓ0ß‘d—k‘k¬b¯f©fÓ5ß‘ð ô
x‰x˜‹~Ðrxcó:—|jstd|›d«‚y)zassert that we are orderedz)Categorical is not ordered for operation zG
you can use .as_ordered() to change the Categorical to an ordered one
N)rYrZ)rkrts  rvÚcheck_for_orderedzCategorical.check_for_orderedjs-€à|Š|ÜØ;¸B¸4ð@2ð2óð ðrxÚ    quicksort©Ú    ascendingrÛc ó(•—t‰|d||dœ|¤ŽS)a¡
        Return the indices that would sort the Categorical.
 
        Missing values are sorted at the end.
 
        Parameters
        ----------
        ascending : bool, default True
            Whether the indices should result in an ascending
            or descending sort.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
            Sorting algorithm.
        **kwargs:
            passed through to :func:`numpy.argsort`.
 
        Returns
        -------
        np.ndarray[np.intp]
 
        See Also
        --------
        numpy.ndarray.argsort
 
        Notes
        -----
        While an ordering is applied to the category values, arg-sorting
        in this context refers more to organizing and grouping together
        based on matching category values. Thus, this function can be
        called on an unordered Categorical instance unlike the functions
        'Categorical.min' and 'Categorical.max'.
 
        Examples
        --------
        >>> pd.Categorical(['b', 'b', 'a', 'c']).argsort()
        array([2, 0, 1, 3])
 
        >>> cat = pd.Categorical(['b', 'b', 'a', 'c'],
        ...                      categories=['c', 'b', 'a'],
        ...                      ordered=True)
        >>> cat.argsort()
        array([3, 0, 1, 2])
 
        Missing values are placed at the end
 
        >>> cat = pd.Categorical([2, None, 1])
        >>> cat.argsort()
        array([2, 0, 1])
        r€r€)r“Úargsort)rkrrÛrVr–s    €rvrƒzCategorical.argsortssø€ôf‰w‰ÐH¨¸ÑHÀÑHÐHrx)ÚinplacerÚ na_positioncó—yrr€©rkr„rr…s    rvrôzCategorical.sort_values¨s€ð     rx©rr…có—yrr€r‡s    rvrôzCategorical.sort_values²s€ð     rxÚlastcóê—t|d«}|dvrtdt|«›«‚t|||¬«}|s |j|}|j |«S|j||jddy)a†
        Sort the Categorical by category value returning a new
        Categorical by default.
 
        While an ordering is applied to the category values, sorting in this
        context refers more to organizing and grouping together based on
        matching category values. Thus, this function can be called on an
        unordered Categorical instance unlike the functions 'Categorical.min'
        and 'Categorical.max'.
 
        Parameters
        ----------
        inplace : bool, default False
            Do operation in place.
        ascending : bool, default True
            Order ascending. Passing False orders descending. The
            ordering parameter provides the method by which the
            category values are organized.
        na_position : {'first', 'last'} (optional, default='last')
            'first' puts NaNs at the beginning
            'last' puts NaNs at the end
 
        Returns
        -------
        Categorical or None
 
        See Also
        --------
        Categorical.sort
        Series.sort_values
 
        Examples
        --------
        >>> c = pd.Categorical([1, 2, 2, 1, 5])
        >>> c
        [1, 2, 2, 1, 5]
        Categories (3, int64): [1, 2, 5]
        >>> c.sort_values()
        [1, 1, 2, 2, 5]
        Categories (3, int64): [1, 2, 5]
        >>> c.sort_values(ascending=False)
        [5, 2, 2, 1, 1]
        Categories (3, int64): [1, 2, 5]
 
        >>> c = pd.Categorical([1, 2, 2, 1, 5])
 
        'sort_values' behaviour with NaNs. Note that 'na_position'
        is independent of the 'ascending' parameter:
 
        >>> c = pd.Categorical([np.nan, 2, 2, np.nan, 5])
        >>> c
        [NaN, 2, 2, NaN, 5]
        Categories (2, int64): [2, 5]
        >>> c.sort_values()
        [2, 2, 5, NaN, NaN]
        Categories (2, int64): [2, 5]
        >>> c.sort_values(ascending=False)
        [5, 2, 2, NaN, NaN]
        Categories (2, int64): [2, 5]
        >>> c.sort_values(na_position='first')
        [NaN, NaN, 2, 2, 5]
        Categories (2, int64): [2, 5]
        >>> c.sort_values(ascending=False, na_position='first')
        [NaN, NaN, 5, 2, 2]
        Categories (2, int64): [2, 5]
        r„)rŠÚfirstzinvalid na_position: rˆN)rrXÚreprr7rbrp)rkr„rr…Ú
sorted_idxras      rvrôzCategorical.sort_values¸s|€ôR& g¨yÓ9ˆØ Ð/Ñ /ÜÐ4´T¸+Ó5FÐ4GÐHÓIÐ Iä˜d¨iÀ[ÔQˆ
áØ—K‘K 
Ñ+ˆEØ×*Ñ*¨5Ó1Ð 1ØŸ™ ZÑ0ˆ ‰ ‘AˆØrxrÚaverageÚkeep©ÚaxisrTÚ    na_optionrÚpctcón—|dk7rt‚|j«}tj||||||¬«S)z*
        See Series.rank.__doc__.
        rr‘)r«Ú_values_for_rankr(Úrank)rkr’rTr“rr”Úvffs       rvÚ_rankzCategorical._rank sB€ð 1Š9Ü%Ð %Ø×#Ñ#Ó%ˆÜ‰Ø ØØØØØô 
ð    
rxcóÀ—ddlm}|jrG|j}|dk(}|j    «r$|j d«}t j||<|St|jj«rt j|«}|St j|j||jd¬«j«j««}|S)zð
        For correctly ranking ordered categorical data. See GH#15420
 
        Ordered categorical data should be ranked on the basis of
        codes with -1 translated to NaN.
 
        Returns
        -------
        numpy.array
 
        rr"rTÚfloat64FrR)rðrJrYrarcrÓrir9rr^rgrjrr—r¸)rkrJr¸rqs    rvr–zCategorical._values_for_rank%sµ€õ    "à <Š<Ø—Z‘ZˆFؘR‘<ˆD؏x‰xŒzØŸ™ yÓ1Ü!Ÿv™vt‘ ðˆ ô' t§¡×'<Ñ'<Ô =Ü—X‘X˜d“^ˆFðˆ ô —X‘XØ×&Ñ&Ù˜4Ÿ?™?°Ô7×<Ñ<Ó>×EÑEóóˆFð
ˆ rxcóp—ddlm}tj|jj
«}||||d¬«}|j «}t|«r|j|j«}n tjt|«d¬«}|j«rtj||<|S)aA
        Hash a Categorical by hashing its categories, and then mapping the codes
        to the hashes.
 
        Parameters
        ----------
        encoding : str
        hash_key : str
        categorize : bool
            Ignored for Categorical.
 
        Returns
        -------
        np.ndarray[uint64]
        r)Ú
hash_arrayF)Ú
categorizeÚuint64rš)Úpandas.core.util.hashingrrirÜr^rÝr'rWr1rbrxrcrÚu8max)    rkÚencodingÚhash_keyržrr¸Úhashedrqràs             rvÚ_hash_pandas_objectzCategorical._hash_pandas_objectEs†€õ&    8ô—‘˜DŸO™O×3Ñ3Ó4ˆÙ˜F H¨hÀ5ÔIˆðy‰y‹{ˆÜ ˆvŒ;Ø—[‘[ §¡Ó-‰Fä—X‘Xœc $›i¨xÔ8ˆFà 8‰8Œ:ÜŸ9™9ˆF4‰Làˆ rxcó—|jSr)rÇrÄs rvrbzCategorical._codesss €à}‰}ÐrxcóJ—|dk(rtjS|j|SrÆ)rir9r^)rkrrs  rvÚ    _box_funczCategorical._box_funcws!€Ø Š7Ü—6‘6ˆM؏‰˜qÑ!Ð!rxcó†—|jj|«}|jjj    |«}|Sr)r^r†rÇrgrf)rkr‰rqs   rvrdzCategorical._unbox_scalar|s7€ð‰×&Ñ& sÓ+ˆØ}‰}×"Ñ"×'Ñ'¨Ó-ˆØˆ rxc󪇗‰jdk(r't‰j«j««Sˆfd„t    t ‰««D«S)zJ
        Returns an Iterator over the values of this Categorical.
        r›c3ó(•K—|]    }‰|–—Œ y­wrr€)rÚnrks  €rvr„z'Categorical.__iter__.<locals>.<genexpr>Œsøèø€Ò6 D˜•GÑ6ùsƒ)rªÚiterr|rÚrangerWrÄs`rvÚ__iter__zCategorical.__iter__…sAø€ð 9‰9˜Š>ܘ×1Ñ1Ó3×:Ñ:Ó<Ó=Ð =ã6¤U¬3¨t«9Ó%5Ô6Ð 6rxcóÀ—t||jj«r't|j    «j ««St |||j¬«S)z?
        Returns True if `key` is in this Categorical.
        )rƒ)r&r^rgÚboolr'rcr‹rb)rkr‰s  rvÚ __contains__zCategorical.__contains__ŽsC€ô
!  d§o¡o×&;Ñ&;Ô <ܘŸ    ™    › Ÿ™Ó)Ó*Ð *䘘c¨T¯[©[Ô9Ð9rxcó—yrr€)rkÚboxeds  rvÚ
_formatterzCategorical._formatter›s€àrxcóf—td«dk(rdn
td«}ddlm}d}|jjdk(r4t t |jj«jd¬«}t|j|t¬    «}t|j«|kDrN|d
z}||jd|j«}||j| dj«}|d gz|z}n||jj«}|D    cgc]}    |    j«‘Œ}}    |Scc}    w) z9
        return the base repr for the categories
        zdisplay.max_categoriesré
©ÚformatNÚstrF)r´)Ú    formatterÚquotingéz...)r Úpandas.io.formatsr¹r^rgr    r1rÝrµrÚ format_arrayrrWÚstrip)
rkÚmax_categoriesÚfmtr»r¿ÚnumÚheadÚtailÚ category_strsÚxs
          rvÚ_repr_categorieszCategorical._repr_categoriesŸs&€ô Ð2Ó3°qÒ8ñ äÐ4Ó5ð    õ
    4àˆ    Ø ?‰?×  Ñ   EÒ )ôœ^¨T¯_©_×-DÑ-DÓE×PÑPØðQóˆIôØ × Ñ ¨    Ô;Kô
ˆ ô ˆt‰Ó  .Ò 0Ø  AÑ%ˆCÙ §¡°°Р5× =Ñ =Ó>ˆDÙ §¡°°°Р6× >Ñ >Ó?ˆDØ  E 7™N¨TÑ1‰Má(¨¯©×)@Ñ)@ÓAˆMð-:Ö: q˜Ÿ™Ð:ˆ Ð:ØÐùò;sÄD.cóZ—|j«}t|jj«}dt    |j«›d|›d}t «\}}t d«xs|}tj«rd}d}d}t    |«}    |jrdnd    \}
} | j«›d
} |D]]} |dk7r:|    |
zt    | «z|kDr&|| d t    |«d zzzz }t    |«d z}    n|s|| z }|    t    | «z }    || z }d }Œ_|›d|jdd«›dS)z@
        Returns a string representation of the footer.
        z Categories (ú, z): z display.widthrÚT)éz < )r½rÊú
ú r›Fú[z     < ... < z ... ú]) rÈrºr^rgrWrr r9Úin_ipython_frontendrYÚrstripÚreplace)rkrÆrgÚ    levheaderÚwidthÚ_Ú    max_widthÚ    levstringÚstartÚ cur_col_lenÚsep_lenÚsepÚlinesepÚvals              rvÚ_get_repr_footerzCategorical._get_repr_footerÁsI€ð×-Ñ-Ó/ˆ ܐD—O‘O×)Ñ)Ó*ˆØ"¤3 t§¡Ó#7Ð"8¸¸5¸'ÀÐEˆ    Ü$Ó&‰ˆˆqܘÓ/Ò8°5ˆ    Ü × &Ñ &Ô (àˆI؈    ØˆÜ˜)“nˆ Ø%)§\¢\‘z°y‰ ˆØ—Z‘Z“\N "Ð%ˆØ ò    ˆCؘAŠ~ +°Ñ"7¼#¸c»(Ñ"BÀYÒ"NؘW¨¬s°9«~ÀÑ/AÑ(BÑCÑC    Ü! )›n¨qÑ0‘ ÙØ˜SÑ     Øœs 3›xÑ' Ø ˜Ñ ˆI؉Eð    ð˜A˜i×/Ñ/° ¸WÓEÐFÀaÐHÐHrxcóü—ddlm}t|«dkDsJ‚|j«}|j    |dddt
¬«}|Dcgc]}|j «‘Œ}}dj|«}d|zdz}|Scc}w)Nrr¸ÚNaN)Ú float_formatÚna_repr¼rÊrÏrÐ)r¾r¹rWr|r¿rrÀÚjoin)rkrÂÚvalsÚ
fmt_valuesrrÚjoinedràs       rvÚ_get_values_reprzCategorical._get_values_reprÞsˆ€Ý3ä4‹y˜1Š}Ј}à×(Ñ(Ó*ˆØ×%Ñ%Ø Ø ØØÜ$ð &ó
ˆ
ð*4Ö4 Aa—g‘g•iÐ4ˆ
Ð4Ø—‘˜:Ó&ˆØv‘ Ñ#ˆØˆ ùò5sÁA9cóD—|j«}t|«}d}||kDrV|dz}|d|j«}|||z
dj«}|dd›d|dd›}dt|«›}|›d|›d|›}    |    S|d    kDr|j«}|›d|›}    |    Sd
}|›d |›}    |    S) z(
        String representation.
        r·r½NrTz, ..., r›zLength: rÍrz[]rÊ)rßrWrè)
rkÚfooterÚlengthÚmax_lenrÃrÄrÅÚbodyÚ length_inforàs
          rvÚ__repr__zCategorical.__repr__ñs÷€ð×&Ñ&Ó(ˆÜT“ˆØˆØ GÒ ð˜Q‘,ˆCؘ˜:×.Ñ.Ó0ˆDؘ' C™-Ð(Ð*Ð+×<Ñ<Ó>ˆDؘ3˜Bi[ ¨¨Q¨R¨ zÐ2ˆDØ$¤S¨£Y KÐ0ˆKؐv˜R  ˜}¨B¨v¨hÐ7ˆFðˆ ðaŠZØ×(Ñ(Ó*ˆDؐv˜R ˜xÐ(ˆFðˆ ðˆDؐv˜R ˜xÐ(ˆFàˆ rxcó—t|d¬«}t|t«rA|j|jk7r t    d«‚|j |«}|j Sddlm}|j|d¬«j|j«}t|«r$t|«j«s t    d«‚|jj|«}|j!|j"jd¬    «S)
NT)Ú extract_numpyzCCannot set a Categorical with another, without identical categoriesrr(F)Ú tupleize_colszMCannot setitem on a Categorical with a new category, set the categories firstrR)r4r[r\rgrZÚ_encode_with_my_categoriesrbrðrIÚ _with_inferrr^rWr'rÎÚ get_indexerrÓrÇ)rkr rIÚto_addras     rvrBzCategorical._validate_listlike    sà€ä˜e°4Ô8ˆô eœ[Ô )؏z‰z˜UŸ[™[Ò(Üð3óðð
×3Ñ3°EÓ:ˆEØ—<‘<Ð å ð#×"Ñ" 5¸Ô>×IÑIØ O‰Oó
ˆô ˆvŒ;œt F›|×/Ñ/Ô1Üð5óð ð
—‘×+Ñ+¨EÓ2ˆØ|‰|˜DŸM™M×/Ñ/°eˆ|Ó<Ð<rxcó‡—|j}tjt|j«|j
«\Š}t |«j«}ˆfd„t||dd«D«}tt||««S)a§
        Compute the inverse of a categorical, returning
        a dict of categories -> indexers.
 
        *This is an internal function*
 
        Returns
        -------
        Dict[Hashable, np.ndarray[np.intp]]
            dict of categories -> indexers
 
        Examples
        --------
        >>> c = pd.Categorical(list('aabca'))
        >>> c
        ['a', 'a', 'b', 'c', 'a']
        Categories (3, object): ['a', 'b', 'c']
        >>> c.categories
        Index(['a', 'b', 'c'], dtype='object')
        >>> c.codes
        array([0, 0, 1, 2, 0], dtype=int8)
        >>> c._reverse_indexer()
        {'a': array([0, 1, 4]), 'b': array([2]), 'c': array([3])}
 
        c3ó.•K—|] \}}‰||–—Œy­wrr€)rrÙÚendÚrs   €rvr„z/Categorical._reverse_indexer.<locals>.<genexpr>N    søèø€ÒJ¡J E¨31U˜3”<ÑJùsƒr›N)
r^ÚlibalgosÚgroupsort_indexerrrar0rÚcumsumÚzipr[)rkr^ÚcountsÚ_resultrús    @rvÚ_reverse_indexerzCategorical._reverse_indexer/    srø€ð4—_‘_ˆ
Ü×.Ñ.Ü  §
¡
Ó +¨Z¯_©_ó
‰    ˆˆ6ô˜fÓ%×,Ñ,Ó.ˆÛJ´#°f¸fÀQÀR¸jÓ2IÔJˆÜ”C˜
 GÓ,Ó-Ð-rx©ÚskipnaÚkeepdimsc óx•—t‰||f||dœ|¤Ž}|dvr|S|rt|«||j¬«S|S)Nr)ÚargmaxÚargminrš)r“Ú_reducerfrg)rkrlrrrVràr–s      €rvrzCategorical._reduceT    sLø€ô‘‘ ÐR¨f¸xÑRÈ6ÑRˆØ Ð'Ñ 'àˆMÙ Ø”4˜“:˜f¨D¯J©JÔ7Ð 7àˆMrx)rc ó—tj|jdd««tjd|«|j    d«t |j «s|jjS|j dk7}|j«s@|r.|j«r|j |j«}n*tjS|j j«}|jd|«S)a/
        The minimum value of the object.
 
        Only ordered `Categoricals` have a minimum!
 
        Raises
        ------
        TypeError
            If the `Categorical` is not `ordered`.
 
        Returns
        -------
        min : the minimum of this `Categorical`, NA value if empty
        r’rr€rIrTN)ÚnvÚvalidate_minmax_axisrÚ validate_minr~rWrbrgÚna_valuerÎrcrIrir9Ú_wrap_reduction_result©rkrrVÚgoodÚpointers     rvrIzCategorical.min`    óº€ô     ×Ñ §
¡
¨6°1Ó 5Ô6Ü
‰˜˜FÔ#Ø ×јuÔ%ä4—;‘;ÔØ—:‘:×&Ñ&Ð &à{‰{˜bÑ ˆØx‰xŒzÙ˜$Ÿ(™(œ*ØŸ+™+ dÑ+×/Ñ/Ó1‘ä—v‘v à—k‘k—o‘oÓ'ˆGØ×*Ñ*¨4°Ó9Ð9rxc ó—tj|jdd««tjd|«|j    d«t |j «s|jjS|j dk7}|j«s@|r.|j«r|j |j«}n*tjS|j j«}|jd|«S)a2
        The maximum value of the object.
 
        Only ordered `Categoricals` have a maximum!
 
        Raises
        ------
        TypeError
            If the `Categorical` is not `ordered`.
 
        Returns
        -------
        max : the maximum of this `Categorical`, NA if array is empty
        r’rr€rHrTN)r
r rÚ validate_maxr~rWrbrgr rÎrcrHrir9rrs     rvrHzCategorical.max€    rrxcó—|j}d}|r|j«}tj||¬«}t    t
j |«}|j|jk(sJ‚|j|«}|S)N)rq)    rbr'r(Úmoder    rir©rgrp)rkr*rarqÚ    res_codesrÏs      rvÚ_modezCategorical._mode     si€Ø— ‘ ˆØˆÙ Ø—9‘9“;ˆDä—O‘O E°Ô5ˆ    ÜœŸ™ YÓ/ˆ    Ø‰ %§+¡+Ò-Ð-Ð-Ø×%Ñ% iÓ0ˆØˆ
rxcó •—t‰|«S)aß
        Return the ``Categorical`` which ``categories`` and ``codes`` are
        unique.
 
        .. versionchanged:: 1.3.0
 
            Previously, unused categories were dropped from the new categories.
 
        Returns
        -------
        Categorical
 
        See Also
        --------
        pandas.unique
        CategoricalIndex.unique
        Series.unique : Return unique values of Series object.
 
        Examples
        --------
        >>> pd.Categorical(list("baabc")).unique()
        ['b', 'a', 'c']
        Categories (3, object): ['a', 'b', 'c']
        >>> pd.Categorical(list("baab"), categories=list("abc"), ordered=True).unique()
        ['b', 'a']
        Categories (3, object): ['a' < 'b' < 'c']
        )r“r))rkr–s €rvr)zCategorical.unique¯    sø€ô:‰w‰~ÓÐrxrœcó¾—t|t«sy|j|«r;|j|«}t    j
|j |j «Sy)z²
        Returns True if categorical arrays are equal.
 
        Parameters
        ----------
        other : `Categorical`
 
        Returns
        -------
        bool
        F)r[r\r]róriÚ array_equalrb©rkrls  rvr_zCategorical.equalsΠ   sK€ô˜%¤Ô-ØØ × 5Ñ 5°eÔ <Ø×3Ñ3°EÓ:ˆEÜ—>‘> $§+¡+¨u¯|©|Ó<Ð <Ørxc    ó²—ddlm}|d}||jk\rtd|›d|j›«‚|dk(rt    d„|D««st‚g}|D]>}|j t |jd«Dcgc] }|dd…|f‘Œ c}«Œ@|j|d¬«}|jt|«dd    ¬
«}    |    S||«}    |    Scc}w) Nr)Úunion_categoricalszaxis z) is out of bounds for array of dimension r›c3ó:K—|]}|jdk(–—Œy­w)r½N)rª)rrÇs  rvr„z0Categorical._concat_same_type.<locals>.<genexpr>í    sèø€Ò6 qq—v‘v •{Ñ6ùs‚©r’rTÚF)Úorder) Úpandas.core.dtypes.concatrrªrXrÎÚextendr®r·Ú_concat_same_typeÚreshaperW)
r•Ú    to_concatr’rrŒÚtc_flatÚobjrrÚres_flatràs
          rvr%zCategorical._concat_same_typeá    sé€å@à˜!‘ ˆØ 5—:‘:Ò ÜØ˜vÐFÀuÇzÁzÀlÐSóð ð 1Š9äÑ6¨IÔ6Ô6ܠРðˆGØ ò IØ—‘´5¸¿¹À1¹Ó3FÖG¨a ¢A q D£    ÒGÕHð Ið×,Ñ,¨W¸1Ð,Ó=ˆHà×%Ñ%¤c¨%£j°"¸CÐ%Ó@ˆF؈Má# IÓ.ˆØˆ ùò HsÁ?C
có~—t|j|j|jd¬«}|j|«S)z×
        Re-encode another categorical using this Categorical's categories.
 
        Notes
        -----
        This assumes we have already checked
        self._categories_match_up_to_permutation(other).
        FrR)r`rar^rp)rkrlras   rvróz&Categorical._encode_with_my_categoriesÿ    s8€ô&Ø K‰K˜×)Ñ)¨4¯?©?Àô
ˆð×&Ñ& uÓ-Ð-rxcóX—t|j«t|j«k(S)zÞ
        Returns True if categoricals are the same dtype
          same categories, and same ordered
 
        Parameters
        ----------
        other : Categorical
 
        Returns
        -------
        bool
        )r…rgrs  rvr]z/Categorical._categories_match_up_to_permutation
s!€ôD—J‘JÓ¤4¨¯ © Ó#4Ñ4Ð4rxcóÀ—|jd¬«}||j«z }ddlm}ddlm}|||gd¬«}|dd    g«|_d
|j_|S) z­
        Describes this Categorical
 
        Returns
        -------
        description: `DataFrame`
            A dataframe with frequency and counts by category.
        F)r*rr()Úconcatr›r rÿÚfreqsr^)    rvÚsumrðrIÚpandas.core.reshape.concatr.Úcolumnsrkrl)rkrÿr/rIr.ràs      rvÚdescribezCategorical.describe
s_€ð×"Ñ"¨%Ð"Ó0ˆØ˜Ÿ™›Ñ%ˆå Ý5ᘠ˜¨aÔ0ˆÙ ¨'Ð2Ó3ˆŒØ(ˆ ‰ Ôàˆ rxcóʗtjt|««}|jj    |«}|||dk\z}t j |j|«S)a­
        Check whether `values` are contained in Categorical.
 
        Return a boolean NumPy Array showing whether each element in
        the Categorical matches an element in the passed sequence of
        `values` exactly.
 
        Parameters
        ----------
        values : np.ndarray or ExtensionArray
            The sequence of values to test. Passing in a single string will
            raise a ``TypeError``. Instead, turn a single string into a
            list of one element.
 
        Returns
        -------
        np.ndarray[bool]
 
        Raises
        ------
        TypeError
          * If `values` is not a set or list-like
 
        See Also
        --------
        pandas.Series.isin : Equivalent method on Series.
 
        Examples
        --------
        >>> s = pd.Categorical(['lama', 'cow', 'lama', 'beetle', 'lama',
        ...                'hippo'])
        >>> s.isin(['cow', 'lama'])
        array([ True,  True,  True, False,  True, False])
 
        Passing a single string as ``s.isin('lama')`` will raise an error. Use
        a list of one element instead:
 
        >>> s.isin(['lama'])
        array([ True, False,  True, False,  True, False])
        r)rirÜr'r^Úget_indexer_forr(ròra)rkr¸rºÚ code_valuess    rvròzCategorical.isin4
sT€ôR—J‘Jœt F›|Ó,ˆ    Ø—o‘o×5Ñ5°fÓ=ˆ Ø! )¨{¸aÑ/?Ñ"@ÑAˆ ܏‰˜tŸz™z¨;Ó7Ð7rx)r„có>—ddlm}|j}t|d«}|r|n|j    «}t t j|««}|j«r|t j|«|}|j|jj|«}|j|«}    tj||    j|    j«|jj«}
|
j!||¬«}
||
«} |jj#| «} t j$t'|
««} t j(| dk(| | «} | j+«} |
j-| «}|j/d¬«}||«}t1|j2| |d¬    «}t5||jj6¬
«}tj|||«||k7r$t9j:d t<t?«¬ «|s|Sy) Nrr(r„)Ú
to_replacer rTrŒ)rFrRr‘zóThe behavior of Series.replace (and DataFrame.replace) with CategoricalDtype is deprecated. In a future version, replace will only be used for cases that preserve the categories. To change the categories, use ser.cat.rename_categories instead.r˜) rðrIrgrrSr'rirÜrcr^ròr-rr¥raÚ    to_seriesrÓr5rmrWr¬rƒr1Údrop_duplicatesr`rbr!rYr¡r¢rãr)rkr8r r„rIÚ
orig_dtyperˆrqr+Únew_catÚserÚ
all_valuesÚidxrÚlocsrr3r    s                 rvÚ_replacezCategorical._replaceb
s³€Ý à—Z‘Zˆ
ä% g¨yÓ9ˆÙ‰d 4§9¡9£;ˆä”B—J‘J˜uÓ%Ó&ˆØ 8‰8Œ:Ü—z‘z *Ó-¨dÑ3ˆHØ—~‘~ c§n¡n×&9Ñ&9¸(Ó&CÑDˆHØ×+Ñ+¨HÓ5ˆGÜ × "Ñ " 3¨¯ © °w·}±}Ô Eàn‰n×&Ñ&Ó(ˆØk‰k Z°uˆkÓ=ˆá˜3“Zˆ
ð~‰~×-Ñ-¨jÓ9ˆÜy‰yœ˜S›Ó"ˆÜx‰x˜ ™
 D¨$Ó/ˆØ|‰|‹~ˆàŸ™ $›ˆØ'×7Ñ7¸WÐ7ÓEˆÙ˜~Ó.ˆÜ)Ø J‰J˜
 N¸ô
ˆ    ô% ^¸T¿Z¹Z×=OÑ=OÔPˆ    Ü×јs I¨yÔ9à ˜
Ò "Ü M‰Mðô
Ü+Ó-õ     ñ؈Jðrxcó¢—|j}|j}|jdk(rn|jj    |||«}|jj
t jurXt|«rM|tjus t|«r0d}n-ddl m }||j««j    |||«}t|||¬«S)NÚstringFr©ÚNumpyExtensionArrayrÙ)r^rargrjÚ_str_mapr rir9rrr r'Úpandas.core.arraysrEr³r.)    rkÚfr rgÚconvertr^raràrEs             rvrFzCategorical._str_map•
s°€ð —_‘_ˆ
Ø—
‘
ˆØ × Ñ ˜xÒ 'Ø×%Ñ%×.Ñ.¨q°(¸EÓBˆFà× Ñ ×)Ñ)¬R¯V©VÑ3Ü! %Ô(ؤ§¡Ñ/´4¸´>ð!‘å >á(¨×)<Ñ)<Ó)>Ó?×HÑHؐ8˜UóˆFôv˜u°Ô:Ð:rxcóf—ddlm}||jtd¬««j    |«S)NrrDrá)r )rGrEr³rºÚ_str_get_dummies)rkrÜrEs   rvrKzCategorical._str_get_dummies®
s-€å:á" 4§=¡=´¸u =Ó#EÓF×WÑWØ ó
ð    
rxc     óŽ—ddlm}|j|«}||||¬«}    |j}
|dvrt    |
›d|›d«‚|dvr|
j
st    d|›d    «‚|d
vr'|d k(rt    |
›d|›d«‚t    |
›d |›d «‚d} |j «} |dk(r|j
sJ‚|j} nA|dvr(|j} tj|t¬«} n|jt«} |    j| f|||| | dœ|¤Ž}||    jvr|S|dvrd|| dk(<|j|«S)Nr)ÚWrappedCythonOp)ÚhowrÛÚhas_dropped_na)r0ÚprodrýÚcumprodÚskewz type does not support z  operations)rIrHr—ÚidxminÚidxmaxzCannot perform z with non-ordered Categorical)    r—rcrÎrŒrŠrIrHrSrTÚ    transformz% dtype does not support aggregation 'ú'r—)rŒrŠrIrHrSrTrš)Ú    min_countÚngroupsÚcomp_idsrqÚ result_mask)rŒrŠrIrHrTr›)Úpandas.core.groupby.opsrMÚget_kind_from_howrgrZrYr'rÇrirxr±rÓÚ_cython_op_ndim_compatÚcast_blocklistrp)rkrNrOrWrXÚidsrVrMrÛrtrgrZrqÚnpvaluesÚ
res_valuess               rvÚ _groupby_opzCategorical._groupby_op¹
s€õ    <à×0Ñ0°Ó5ˆÙ  ¨4ÀÔ Oˆà—
‘
ˆØ Ð>Ñ >ܘu˜gÐ%<¸S¸EÀÐMÓNÐ NØ Ð<Ñ <ÀUÇ]Â]ô˜o¨c¨UÐ2OÐPÓQÐ QØ ð
 
ñ
 
ð{Ò"Ü 5 'Ð)@ÀÀÀ[РQÓRÐRܘu˜gÐ%JÈ3È%ÈqÐQÓRÐ Ràˆ Øy‰y‹{ˆØ &Š=Ø—<’<Ð <Ø—}‘}‰HØ ÐGÑ GØ—}‘}ˆHÜŸ(™( 7´$Ô7‰Kð—{‘{¤4Ó(ˆHà.R×.Ñ.Ø ð
àØØØØ#ñ 
ðñ
ˆ
ð "×#Ñ#Ñ #ØÐ Ø Ð3Ñ 3Ø+-ˆJ{ aÑ'Ñ (Ø×&Ñ& zÓ2Ð2rx)raú
np.ndarrayrgr!ÚreturnrD)rgú Dtype | Noner¹zbool | lib.NoDefaultrSr±rdÚNone)rdr!)rdÚint)rgrerSr±rdrD)rgrArdrD).)rgz npt.DTypeLikerSr±rdrc)rgr#rSr±rdr1)rgr>rSr±rdr=©Tr)rdrD)NNNT)rgrerþr±rdrD)rdrI)rdrC)rdrc)F)r¹r±rdrf)rgr!rdrD)r r±rdrD)NF)rr±)r>z(Literal['ignore'] | None | lib.NoDefault)rgr!rdrc)NN)rgzNpDtype | NonerSz bool | Nonerdrc)rSznp.ufuncrTrº©rdrf)rbr±rdrg)rdúnpt.NDArray[np.bool_])r*r±rdrJ)r·rErgr!rdrD)rdr=)rr±rÛrF)r„zLiteral[False]rr±r…rºrdrD)r„z Literal[True]rr±r…rºrdrf)r„r±rr±r…rºrdz Self | None)
r’r?rTrºr“rºrr±r”r±)r¢rºr£rºržr±rdznpt.NDArray[np.uint64])rrrg)rdr;©rdr±)r´r±)rdz    list[str])rdrº)rdz$dict[Hashable, npt.NDArray[np.intp]])rlrºrr±rr±)rr±)r*r±rdr\)rlrœrdr±)r)r'zSequence[Self]r’r?rdrD)rlr\rdr\)rlr\rdr±)rdrH)r¸r=rdrj)r„r±)rIr±)ú|)rÜrº)
rNrºrOr±rWrgrXrgr_znpt.NDArray[np.intp])iryÚ
__module__Ú __qualname__Ú__doc__Ú__array_priority__r3Ú _hidden_attrsÚ    frozensetÚ_typÚ__annotations__Ú classmethodr”rr r¥ÚpropertyrgrÈrÌrÐr
rÓrärûrÿr^rYrar
rÚrrrrrr r&r-r4r8r|rzÚeqrUr{rVÚltrNÚgtrOÚlerPÚgerQrDrCrýr0rKrWr\r`rcr'ÚisnullrfÚnotnullrvrzr|r~rƒrôr™r–r¥rbr¨rdr¯r²rµrÈrßrèrïrBrrrIrHrr)r_r%rór]r3ròrArirFrKrbÚ __classcell__)r–s@rvr\r\ös    ø…ñeðRÐà ×.Ñ.±¸H¸:Ó1FÑF€MØ €Dà Óàð1Øð1Ø'7ð1à     ô1ó    ð1ðØØ"Ø),¯©Øðy%ð
ð y%ð 'ð y%ððy%ð
õy%ðvò óð ðòóðð à/3À%ñ4Ø ,ð4Ø;?ð4à     ò4óð4ð
ò óð ðó óð ðó óð ðó óð ö:òx ðàEIðB3à     òB3óðB3ðHðØØ"Øð B3ð
ð B3ð ð B3ð
òB3óðB3ðNò7%óð7%ðrò%"óð%"ðNò#óð#öJ#3óJ:ó  ó&ó>'ô@hóTFôPIDóVCóJ:Wóx/ðl?B¿n¹nðm4ð<óm4ñ^˜XŸ[™[Ó )€FÙ ˜XŸ[™[Ó )€FÙ ˜XŸ[™[Ó )€FÙ ˜XŸ[™[Ó )€FÙ ˜XŸ[™[Ó )€FÙ ˜XŸ[™[Ó )€Fò
0òð:ò óð ð"à@Dð4,Ø#ð4,Ø2=ð4,à    ò4,óð4,ól
õ: $ðòHóðHôRó2!ð&€Fóð(€Gô(
ðZð/Øð/Ø"2ð/à     ò/óð/ó(ó.ð$(¸+ñ3IØ ð3IØ/7õ3Iðjð#&ØØñ  ð ð ðð     ð
ð  ð
ò  óð ðà;>ÐSVñ Ø'ð Ø48ð ØMPð à     ò óð ðØØ!ñ SððSðð    Sð
ð Sð
ó SðpØØØØñ
ðð
ðð    
ð
ð 
ð ð 
ðó
ó0ð@)Øð)Ø*-ð)Ø;?ð)à    ó)ð\òóðó"ó
ó7ó:ôó óDIó:ó&ò:=óB .ðL,0À%ñ
Øð
Ø$(ð
Ø;?õ
ð%)õ:ð@%)õ:ô@
õ ó>ð&óóðó:.ó" 5óó*,8ð\>Cõ/ðhŸ.™.°°·±¸Ó0BÐTXð;ØMQó;ô2
ð@3ðð@3ðð    @3ð
ð @3ð ð @3ð"÷@3rxr\r^rYrv)ÚdelegateÚ    accessorsÚtyp)rr r&r-r4rrrrTcóR—eZdZdZd    d„Zed„«Zd
d„Zd
d„Ze    d d„«Z
d
d„Z y) ÚCategoricalAccessoraP
    Accessor object for categorical properties of the Series values.
 
    Parameters
    ----------
    data : Series or CategoricalIndex
 
    Examples
    --------
    >>> s = pd.Series(list("abbccc")).astype("category")
    >>> s
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, object): ['a', 'b', 'c']
 
    >>> s.cat.categories
    Index(['a', 'b', 'c'], dtype='object')
 
    >>> s.cat.rename_categories(list("cba"))
    0    c
    1    b
    2    b
    3    a
    4    a
    5    a
    dtype: category
    Categories (3, object): ['c', 'b', 'a']
 
    >>> s.cat.reorder_categories(list("cba"))
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, object): ['c', 'b', 'a']
 
    >>> s.cat.add_categories(["d", "e"])
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (5, object): ['a', 'b', 'c', 'd', 'e']
 
    >>> s.cat.remove_categories(["a", "c"])
    0    NaN
    1      b
    2      b
    3    NaN
    4    NaN
    5    NaN
    dtype: category
    Categories (1, object): ['b']
 
    >>> s1 = s.cat.add_categories(["d", "e"])
    >>> s1.cat.remove_unused_categories()
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, object): ['a', 'b', 'c']
 
    >>> s.cat.set_categories(list("abcde"))
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (5, object): ['a', 'b', 'c', 'd', 'e']
 
    >>> s.cat.as_ordered()
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, object): ['a' < 'b' < 'c']
 
    >>> s.cat.as_unordered()
    0    a
    1    b
    2    b
    3    c
    4    c
    5    c
    dtype: category
    Categories (3, object): ['a', 'b', 'c']
    có¬—|j|«|j|_|j|_|j
|_|j«yr)Ú    _validater¸Ú_parentrkÚ_indexrlÚ_nameÚ_freeze)rkÚdatas  rvr¥zCategoricalAccessor.__init__z s8€Ø ‰tÔØ—{‘{ˆŒ Ø—j‘jˆŒ Ø—Y‘YˆŒ
Ø  ‰ rxcóN—t|jt«s td«‚y)Nz2Can only use .cat accessor with a 'category' dtype)r[rgr!ÚAttributeError)rŠs rvr…zCategoricalAccessor._validate s"€ä˜$Ÿ*™*Ô&6Ô7Ü Ð!UÓVÐ Vð8rxcó.—t|j|«Sr)rhr†)rkrls  rvÚ_delegate_property_getz*CategoricalAccessor._delegate_property_get† s€Üt—|‘| TÓ*Ð*rxcó0—t|j||«Sr)Úsetattrr†)rkrlÚ
new_valuess   rvÚ_delegate_property_setz*CategoricalAccessor._delegate_property_set‹ s€Üt—|‘| T¨:Ó6Ð6rxcó^—ddlm}||jj|j¬«S)a@
        Return Series of codes as well as the index.
 
        Examples
        --------
        >>> raw_cate = pd.Categorical(["a", "b", "c", "a"], categories=["a", "b"])
        >>> ser = pd.Series(raw_cate)
        >>> ser.cat.codes
        0   0
        1   1
        2  -1
        3   0
        dtype: int8
        rr")rk)rðrJr†rar‡)rkrJs  rvrazCategoricalAccessor.codesŽ s"€õ     "ád—l‘l×(Ñ(°· ± Ô<Ð<rxcóŽ—ddlm}t|j|«}||i|¤Ž}||||j|j
¬«Sy)Nrr")rkrl)rðrJrhr†r‡rˆ)rkrlÚargsrVrJrTrÏs       rvÚ_delegate_methodz$CategoricalAccessor._delegate_method¢ sE€Ý!䘟™ tÓ,ˆÙdÐ%˜fÑ%ˆØ ˆ?Ù˜# T§[¡[°t·z±zÔBÐ Bð rxNri)rlrº)rdrJ) ryrmrnror¥Ú staticmethodr…rŽr’rvrar–r€rxrvrƒrƒÿ
sH„ñ$góRðñWóðWó+ó
7ðò=óð=ô&Crxrƒcó<—|j|«}t||«S)z¤
    utility routine to turn values into codes given the specified categories
 
    If `values` is known to be a Categorical, use recode_for_categories instead.
    )r5r)r¸r^ras   rvrµrµ® s!€ð × &Ñ & vÓ .€EÜ   zÓ 2Ð2rxcóæ—t|«dk(r|r|j«S|S|j|«r|r|j«S|St|j    |«|«}t ||d¬«}|S)a#
    Convert a set of codes for to a new set of categories
 
    Parameters
    ----------
    codes : np.ndarray
    old_categories, new_categories : Index
    copy: bool, default True
        Whether to copy if the codes are unchanged.
 
    Returns
    -------
    new_codes : np.ndarray[np.int64]
 
    Examples
    --------
    >>> old_cat = pd.Index(['b', 'a', 'c'])
    >>> new_cat = pd.Index(['a', 'b'])
    >>> codes = np.array([0, 1, 1, 2])
    >>> recode_for_categories(codes, old_cat, new_cat)
    array([ 1,  0,  0, -1], dtype=int8)
    rrTrÙ)rWrSr_rr5r.)raÚold_categoriesrrSÚindexerr3s      rvr`r`» sw€ô2 ˆ>Ó˜aÒá Ø—:‘:“<Р؈ Ø    ×    Ñ    ˜~Ô    .á Ø—:‘:“<Р؈ ä"Ø×&Ñ& ~Ó6¸ó€Gô˜ °2Ô6€IØ ÐrxcóÌ—ddlm}t|«s td«‚t    |dd«}t |t «rƒt|«}tjt|j«|jj¬«}tj||jd¬«}||«}|j}||fSt|d¬    «}|j}|j}||fS)
az
    Factorize an input `values` into `categories` and `codes`. Preserves
    categorical dtype in `categories`.
 
    Parameters
    ----------
    values : list-like
 
    Returns
    -------
    codes : ndarray
    categories : Index
        If `values` has a categorical dtype, then `categories` is
        a CategoricalIndex keeping the categories and order of `values`.
    r)rhzInput must be list-likergNršFr7r‘)rðrhrrZrhr[r!r4rirmrWr^rargr\rÿ)r¸rhr»Ú    cat_codesrˆr^ras       rvÚfactorize_from_iterableržæ s̀õ (ä ˜Ô ÜÐ1Ó2Ð2ôV˜W dÓ +€Fܐ&Ô*Ô+ܘvÓ&ˆô—I‘Iœc &×"3Ñ"3Ó4¸F¿L¹L×<NÑ<NÔOˆ    Ü×$Ñ$ Y°f·l±lÈUÐ$ÓSˆá% cÓ*ˆ
Ø— ‘ ˆð *Ð Ðô˜&¨%Ô0ˆØ—^‘^ˆ
Ø—    ‘    ˆØ *Ð Ðrxcóv—t|«dk(rggfStd„|D«Ž\}}t|«t|«fS)a$
    A higher-level wrapper over `factorize_from_iterable`.
 
    Parameters
    ----------
    iterables : list-like of list-likes
 
    Returns
    -------
    codes : list of ndarrays
    categories : list of Indexes
 
    Notes
    -----
    See `factorize_from_iterable` for more info.
    rc3ó2K—|]}t|«–—Œy­wr)rž)rÚits  rvr„z+factorize_from_iterables.<locals>.<genexpr>& sèø€ÒN¸bÔ5°b×9ÑNùs‚)rWrþr¨)Ú    iterablesrar^s   rvÚfactorize_from_iterablesr£ sB€ô" ˆ9ƒ~˜Òà2ˆvˆ äÑNÀIÔNÐOÑ€Eˆ:Ü ‹;œ˜ZÓ(Ð (Ð(rxrk)r¸z,Index | Series | ExtensionArray | np.ndarrayr^rIrdrcrh)rarcrSr±rdrc)rdztuple[np.ndarray, Index])rdz$tuple[list[np.ndarray], list[Index]])wÚ
__future__rÚcsvrÚ    functoolsrrzÚshutilrÚtypingrrr    r
r¡ÚnumpyriÚpandas._configr Ú pandas._libsr r rûrÚpandas._libs.arraysrÚpandas.compat.numpyrr
Úpandas.util._exceptionsrÚpandas.util._validatorsrÚpandas.core.dtypes.castrrÚpandas.core.dtypes.commonrrrrrrrrrrrÚpandas.core.dtypes.dtypesr r!r"r#Úpandas.core.dtypes.genericr$r%Úpandas.core.dtypes.missingr&r'Ú pandas.corer(r)r*Úpandas.core.accessorr+r,Úpandas.core.algorithmsr-r.Úpandas.core.arrays._mixinsr/r0Úpandas.core.baser1r2r3Úpandas.core.commonÚcoreÚcommonr¦Úpandas.core.constructionr4r5Úpandas.core.ops.commonr6Úpandas.core.sortingr7Ú pandas.core.strings.object_arrayr8r¾r9Úcollections.abcr:r;r<Úpandas._typingr=r>r?r@rArBrCrDrErFrGrðrHrIrJr|r‹r\rƒrµr`ržr£r€rxrvú<module>rÃsðÝ"å ÝÛÝ$÷óó ãå%÷ñõ
.Ý.Ý4Ý7÷÷ ÷ ÷ ñ ÷ó÷ ÷÷
ñ÷
÷÷÷ñ÷
!Р÷õ<Ý(ÝCå%á÷ñ÷ ÷ ÷ ñ ÷ñòFóR06ôfC(3Ð-¨|Ð=SôC(3ñRPØ  \°9Ð$=À:ôñØ ò    ð    ô ôXC˜.¨,Ð8LóXCó óð"XCð|
3Ø 8ð
3àð
3ðó
3ðEIð(Ø ð(Ø=Að(àó(óV(ôV)rx