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
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
U
¬ý°dr”ã@sþUddlmZddlZddlZddlmZddlZddlm    Z    ddl
Z
ddl Z ddl Z ddl mZmZmZmZmZmZmZmZmZmZmZmZmZmZddlZddlZddlZddl m!Z!m"Z"ddl#m$Z$ddl%m&Z&dd    l'm(Z(m)Z)m*Z*m+Z+dd
l,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRdd lSmTZTdd lUmVZWdd lXmYZYmZZZm[Z[m\Z\ddl]m^Z^ddl_m`Z`ddlambZbmcZcmdZdmeZemfZfddlgmhZhddlimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{ddl|m}Z}m~Z~ddlm€Z€mZddl‚mƒZƒm„Z„ddl…m†Z‡mˆZˆm‰Z‰mŠZŠm‹Z‹mŒZŒddlmŽZŽddlmZddl‘m’Z’ddl“m”Z”ddl•m–Z–ddl—m˜Z˜m™Z™mšZšm›Z›mœZœmZmžZžddlŸm Z m¡Z¡m¢Z¢ddl£m¤Z¤m¥Z¥ddl¦m§Z§dd l¨m©Z©mªZªm«Z«dd!l¬m­Z­dd"l®m¯Z¯dd#l°m±Z±dd$l²m³Z³dd%l´mµZµm¶Z¶m·Z·m¸Z¸dd&l¹mºZºm»Z»dd'l¼m½Z½erôdd(l'm¾Z¾dd)l¿mÀZÀdd*lÁmÂZÂdd+lÃmÄZÄdd,lÅmÆZÆdd-lÇmÈZÈe±–Z±d.d/d0d1d2d3d4d5œZÉeÊZËGd6d7„d7e’eŠj̃ZÍd8d9„ZÎd:ZÏd;ZÐd<ZÑd=ZÒd>ZÓd?ZÔd@ZÕdAZÖdBZ×dCZØdDZÙdEZÚdFZÛdGZÜdHZÝdIZÞdJZßdKe±dL<e±dLjàdMdNdOdPdQdRZáeádS7Záe±dLjàdTdUdQdVdQdRZâdWeãdX<e±dLjàdYdZdd[ddRZädWeãd\<d]Zåd^Zæd_Zçd`d`dadbdcœddde„ZèdS)fé)Ú annotationsN©Úpartial)Úloads)Ú TYPE_CHECKINGÚAnyÚCallableÚClassVarÚHashableÚIteratorÚLiteralÚMappingÚNoReturnÚSequenceÚTypeÚcastÚfinalÚoverload)ÚconfigÚusing_copy_on_write)Úlib)Úis_range_indexer)ÚPeriodÚTickÚ    TimestampÚ    to_offset)&Ú    AlignJoinÚ AnyArrayLikeÚ    ArrayLikeÚAxisÚAxisIntÚCompressionOptionsÚDtypeÚDtypeArgÚ DtypeBackendÚDtypeObjÚFilePathÚ FillnaOptionsÚFloatFormatTypeÚFormattersTypeÚ    FrequencyÚ IgnoreRaiseÚ IndexKeyFuncÚ
IndexLabelÚIntervalClosedTypeÚJSONSerializableÚLevelÚManagerÚ
NaPositionÚNDFrameTÚ RandomStateÚRenamerÚScalarÚSortKindÚStorageOptionsÚSuffixesÚTÚ TimeAmbiguousÚTimedeltaConvertibleTypesÚTimeNonexistentÚTimestampConvertibleTypesÚ ValueKeyFuncÚ WriteBufferÚnpt)Úimport_optional_dependency)Úfunction)ÚAbstractMethodErrorÚInvalidIndexErrorÚSettingWithCopyErrorÚSettingWithCopyWarning)Údoc)Úfind_stack_level)Úcheck_dtype_backendÚvalidate_ascendingÚvalidate_bool_kwargÚvalidate_fillna_kwargsÚvalidate_inclusive)Úastype_is_view)Ú ensure_objectÚensure_platform_intÚ
ensure_strÚis_boolÚ is_bool_dtypeÚis_datetime64_any_dtypeÚis_datetime64tz_dtypeÚ is_dict_likeÚis_dtype_equalÚis_extension_array_dtypeÚis_floatÚ is_list_likeÚ    is_numberÚis_numeric_dtypeÚis_re_compilableÚ    is_scalarÚis_timedelta64_dtypeÚ pandas_dtype)Ú ABCDataFrameÚ    ABCSeries)Ú is_hashableÚis_nested_list_like)ÚisnaÚnotna)Ú
algorithmsÚ    arraylikeÚcommonÚindexingÚnanopsÚsample)Úshould_use_regex)ÚExtensionArray)Ú PandasObject)Ú extract_array)ÚFlags)Ú DatetimeIndexÚIndexÚ
MultiIndexÚ PeriodIndexÚ
RangeIndexÚ default_indexÚ ensure_index)Ú ArrayManagerÚ BlockManagerÚSingleArrayManager)Ú
mgr_to_mgrÚndarray_to_mgr©Údescribe_ndframe)Úclean_fill_methodÚclean_reindex_fill_methodÚfind_valid_index)Úalign_method_FRAME)Úconcat)Ú _shared_docs)Úget_indexer_indexer)Ú    ExpandingÚExponentialMovingWindowÚRollingÚWindow)ÚDataFrameFormatterÚDataFrameRenderer)Ú pprint_thing)Ú
BaseOffset)Ú    DataFrame)Ú BaseIndexer)Ú    Resampler©ÚSeries)ÚHDFStorezkeywords for axeszSeries/DataFramezint or labels for objectz)axes to permute (int or label for object)z`
    inplace : bool, default False
        If True, performs operation inplace and returns None.zM
        by : str or list of str
            Name or list of names to sort byz‚
    This differs from updating with ``.loc`` or ``.iloc``, which require
    you to specify a location to update with some value.)ÚaxesÚklassZaxes_single_argZargs_transposeÚinplaceZ optional_byÚ replace_iloccs>"eZdZUdZdddddddd    d
d d d dg Zded<eeƒZded<eƒZded<e    gƒZ
ded<gZ ded <dZ ded<ded<ded<ded<ddddd d!œd"d#„Z eddd$ddd%œd&d'„ƒZdd)ddd)d*œd+d,„Zedd-œd.d/„ƒZejd0d d1œd2d/„ƒZeed3d-œd4d5„ƒƒZeddd6œd)dd7d)d8œd9d:„ƒZeed;d-œd<d=„ƒƒZed)d>d?œd@dA„ƒZeedBdC„ƒƒZdDZdEZdFedG<dDdDdDdHœZdIedJ<dKedL<dMedN<dKedO<eddPdQœdRdS„ƒZeedTdUdVœdWdX„ƒƒZeedTdMdVœdYdZ„ƒƒZedTd[dVœd\d]„ƒZ eedTdUdVœd^d_„ƒƒZ!edd`dVœdadb„ƒZ"edcd-œddde„ƒZ#edfd-œdgdh„ƒZ$ed[d-œdidj„ƒZ%ed[d-œdkdl„ƒZ&edmd-œdndo„ƒZ'edpd-œdqdr„ƒZ(edKd-œdsdt„ƒZ)edKd-œdudv„ƒZ*dDddwœd)dTd7d)dxœdydz„Z+edTdd7d{œd|d}„ƒZ,edUd~d dœd€d„ƒZ-edd)dTdTd7d)d‚œdƒd„„ƒZ.ee/e0d…d†dd)d‡dTd)dˆœd‰dŠ„ƒƒZ1d‹dŒdœdŽd„Z2eddd‘œd’d“„ƒZ3d    ddddddd”d•œd)d–d–d–dd7dd—dd˜d™œ
dšd›„Z4e5d
dœdœdœdœdœdœd)dždTd7dŸd)d œd¡d¢„ƒZ6e5d dœdœdœdœd£œdždTd7d¤d d¥œd¦d¢„ƒZ6e5d dœdœdœdœdœdœd)dždTd7dd˜d œd§d¢„ƒZ6e7j8fe7j8e7j8dDdddœd)dždTd7dd˜d œd¨d¢„Z6ed dTdd7d{œd©dª„ƒZ9edd-œd«d¬„ƒZ:ed­dd®œd¯d°„ƒZ;ed)d)d?œd±d²„ƒZ<ed)d)d?œd³d´„ƒZ=ed)d)d?œdµd¶„ƒZ>ed·d-œd¸d¹„ƒZ?e?Z@edd-œdºd»„ƒZAed)d)d?œd¼d½„ƒZBed)d)d?œd¾d¿„ƒZCedd)dKd)dÀœdÁd„ƒZDeddÃdTddĜdÅdƄƒZEeddÃdTddĜdÇdȄƒZFeddÃdUddĜdÉdʄƒZGeddÃdTd dĜdËd̄ƒZHeddÃdUdÍdĜdÎdτƒZIeddUd‘œdÐdфƒZJdÒedÓ<dÔd-œdÕdքZKd[d-œd×d؄ZLdÙdڄZMdKd-œdÛd܄ZNedd-œdÝdބƒZOedd-œdßdà„ƒZPdáZQdKedâ<ddãdädåœdædç„ZRedèddédédêœdëd섃ZSedíd-œdîdZTed d-œdðdñ„ƒZUdd-œdòdó„ZVedôdõ„ƒZWedöd÷„ƒZXee/d­eYdødùdúddddþdÿddd‡dKdKdþddddd dœdd„ƒƒZZee/eYdøeYddddd dþdþdKddddddddddþdœdd„ƒƒZ[eddddddþddþddd7dddd dœdd„ƒZ\edddþddd‡dd dþdd!œ    d"d#„ƒZ]ee/eYdøeYdd$dd e^j_dfd%ddKdd d&œd'd(„ƒƒZ`edddþd d)œd*d+„ƒZaed,d-„ƒZbe5dd dÿd.ddd/d0d7dddþd7d7dþdd7dþd7d1dþdþdd2œd3d4„ƒZce5dd5dÿd.ddd/d0d7dddþd7d7dþdd7dþd7d1dþdþd d2œd6d4„ƒZcedd9dÿd.ddd/d0d7dddþd7d7dþdd7dþd7d1dþdþdþd2œd:d4„ƒZcddddddd;œd<d<d<d<d=d;œd>d?„Zde5dd ddd@dÿdAddBddþddddþddþddþdddddCœdDdE„ƒZee5d dFddd@dÿdAddBddþddddþddþddþdddd dCœdGdE„ƒZeee/eYdøeYdddd!d ddd@dÿdAddBddþddddþddþddþddddþdCœdJdE„ƒƒZed d-œdKdL„Zfd"dddd dMœdNdO„Zgd d-œdPdQ„Zhd#d)dTd)dRœdSdT„Zid$d)dTdd)dUœdVdW„Zjd%d)dTd)dRœdXdY„Zked&d)d‡dTd‡dd)dZœd[d\„ƒZld]d^„Zmd'd)d_dTd)d`œdadb„Zned(ddd dcœddde„ƒZodd-œdfdg„Zped)dddiœdjdk„ƒZqd d-œdldm„Zredndo„ƒZsed*dpdq„ƒZteedd-œdrds„ƒƒZued+d)dtd7d)duœdvdw„ƒZve5d,dœdœdœdœdœdxœd‡dTd‡d‡d—d¤dyd dzœd{d|„ƒZwe5d-dœdœdœdœdœdœd}œd)d‡dTd‡d‡d—dŸdyd)d~œ    dd|„ƒZwe5d.dœdœdœdœdœdœd}œd)d‡dTd‡d‡d—ddyd˜d~œ    d€d|„ƒZwd/dDdddddd}œd)d‡dTd‡d‡d—ddyd˜d~œ    d‚d|„Zwed0d)dydd)dƒœd„d…„ƒZxed1dd d†œd‡dˆ„ƒZyed2d)ddd)d‰œdАd‹„ƒZzed3d)ddd)dŒœddŽ„ƒZ{e5dœdœdœdœdœdœdœdœd)dTddŸdddd‘d)d’œ    d“d”„ƒZ|e5dœdœdœdœdœdœd•œdTdd¤dddd‘d d–œd—d”„ƒZ|e5dœdœdœdœdœdœdœdœd)dTdddddd‘d˜d’œ    d˜d”„ƒZ|dDd(dd™dšdddœd)dTdddddd‘d˜d’œ    d›d”„Z|e5dœdœdœdœdœdœdœdœdœœdTd‡dd¤ddždddŸd d œ
d¡d¢„ƒZ}e5dœdœdœdœdœdœdœdœdœd£œ    d)dTd‡ddŸddždddŸd)d¤œ d¥d¢„ƒZ}e5dœdœdœdœdœdœdœdœdœd£œ    d)dTd‡ddddždddŸd˜d¤œ d¦d¢„ƒZ}dDdd(dd™dšd(ddd£œ    d)dTd‡ddddždddŸd˜d¤œ d§d¢„Z}e/e0d…düd¨ddddddde~jddf
d)ddþd7d—d©dd)dªœd«d¬„ƒZ€d)d)d?œd­d®„Zdd-œd¯d°„Z‚d±d²„Zƒed4d)d7dd)d³œd´dµ„ƒZ„d5d)dþdþdd)d¶œd·d¸„Z…ed6d)dKd)dºœd»d¼„ƒZ†ed7d)dKd)dºœd½d¾„ƒZ‡ed8d)dd¿ddÀddd)dÁœddăZˆee/e0d…d†dĐdŐdƜdǐdȄƒƒZ‰ed9d)dþd)dɜdʐd˄ƒZŠdd̜d͐d΄Z‹dd dϜdАdфZŒedd-œ‡fdҐdӄ ƒZedԐdՄƒZŽed d-œd֐dׄƒZedؐdلƒZedd-œdڐdۄƒZ‘edd-œdܐd݄ƒZ’ed)d)d?œdސd߄ƒZ“edàdᄃZ”edâd㄃Z•edÍd-œdäd儃Z–edæd焃Z—d:d)d7dyd)d蜐dédê„Z˜ed;d)d7d)d뜐dìd턃Z™ed<d)dd)d뜐dîdZšed=d)d)d?œdðdñ„ƒZ›ed>d)d7d)dòœdódô„ƒZœed?d)ddddddöd)d÷œdødù„ƒZe5d@dœdœdœdœdœdúœd)dûdüddŸdd=d)dýœdþdÿ„ƒZže5dAdœdœdœdœdœdûdüdd¤dd=d dœddÿ„ƒZže5dBdœdœdœdœdœdúœd)dûdüdddd=d˜dýœddÿ„ƒZže/fe0ސdCddddddúœd)dûdüdddd=d˜dýœddÿ„ƒZže5dœdœdœdœdœd)ddŸdd=d)dœd    d
„ƒZŸe5dœdœdœd œdd¤dd=d d œd d
„ƒZŸe5dœdœdœdœdœd)dddd=d˜dœdd
„ƒZŸe/e0d…d†dddddœd)dddd=d˜dœdd
„ƒZŸe/e0d…d†dddddœd)dddd=d˜dœdd„ƒZ e5dœdœdœdœdœd)ddŸdd=d)dœdd„ƒZ¡e5dœdœdœd œdd¤dd=d d œdd„ƒZ¡e5dœdœdœdœdœd)dddd=d˜dœdd„ƒZ¡e/e0d…d†dddddœd)dddd=d˜dœdd„ƒZ¡e/e0d…d†dddddœd)dddd=d˜dœdd„ƒZ¢e5dDdœdœdœdœdœd)dŸdddd)dœdd„ƒZ£e5dEdœdœdœdœd¤dddd dœd d„ƒZ£e5dFdœdœdœdœdœd)ddddd˜dœd!d„ƒZ£e/eYd"e0d…e0d#e0d$d%de7j8fddde7j8dœd)ddddd˜dœd&d„ƒZ£dGdDdddddd(œd)ddTdddþdþdþd˜d)œ    d*d+„Z¤edHd,d-„ƒZ¥e/e0d…d†d)d)d?œd.d/„ƒZ¦e/e¦e0d…d†d)d)d?œd0d1„ƒZ§e/e0d…d†d)d)d?œd2d3„ƒZ¨e/e¨e0d…d†d)d)d?œd4d5„ƒZ©edIdd6œd7d8„ƒZªed9d:„ƒZ«dJddd;œd)ddd˜d<œd=d>„Z¬e/fe0ސdKd)d?düdþdd‹d)d@œdAdB„ƒZ­edLd)ddd)dCœdDdE„ƒZ®edMd)dGdd)dHœdIdJ„ƒZ¯e/fe0ސdNdTdþdþddþdÃdÐdMdNddOdPœ dQdR„ƒZ°ed)d)d?œdSdT„ƒZ±ed)d)d?œdUdV„ƒZ²edOd)dTdddddd)dYœdZd[„ƒZ³e/eYd\e0d…d†dPdTddd_d`œdadb„ƒZ´e/fe0ސdQd)d)ddddÃd7d‹düddTdd)deœ dfdg„ƒZµedRdddd7dTdhœdidj„ƒZ¶edSdddd7dTdhœdkdl„ƒZ·ee7j8dddfdddmœdndo„ƒZ¸e5dTdœdœdœdpœd)dŸddÃd)dqœdrds„ƒZ¹e5dUdœdœdtœd¤ddÃd duœdvds„ƒZ¹e5dVdœdœdœdpœd)dddÃd˜dqœdwds„ƒZ¹e/e0d…dxdydzd{d|e~jfddddpœd)dddÃd˜dqœd}ds„ƒZ¹e5dWdœdœdœdpœd)dŸddÃd)dqœd~d„ƒZºe5dXdœdœdtœd¤ddÃd duœd€d„ƒZºe5dYdœdœdœdpœd)dddÃd˜dqœdd„ƒZºe/e¹e0d…dydxd{dzd|e7j8fddddpœd)dddÃd˜dqœd‚d„ƒZºe/e0d…d†dZd)dKdTd‹d)dƒœd„d…„ƒZ»d[d)dd7d)dxœd†d‡„Z¼ee/e0d…d†d\d)dTd7d)dxœdˆd‰„ƒƒZ½ee/e0d…d†d]d)dTd7dАd‹d)dŒœddŽ„ƒƒZ¾ed^d)d)d?œdd„ƒZ¿ed_d)dKd’d)d“œd”d•„ƒZÀed`ddTddd–d—œd˜d™„ƒZÁdadTdddšd›œdœd„ZdbdTddd–d›œdždŸ„ZÃedcdddd œd¡d¢„ƒZĐddddd£œd¤d¥„ZŐdeddd£œd¦d§„ZƐdfddd£œd¨d©„Zǐdgddd£œdªd«„ZÈedhddddKdd¬d­œd®d¯„ƒZɐdidddKdd¬d°œd±d²„ZʐdjdddKdd¬d°œd³d´„ZːdkdddKdd¬d°œdµd¶„ZÌedlddddd·œd¸d¹„ƒZ͐dmddddºœd»d¼„Zΐdnddddºœd½d¾„Zϐdodddd¬d¿œdÀdÁ„ZАdpdddd¬d¿œddÄZѐdqdddd¬d¿œdĐdńZҐdrdddd¬d¿œdƐdDŽZÓeÓZÔedsdddddKdȜdɐdʄƒZՐdtddddKd˜d̐d̈́Z֐duddddKd˜dΐdτZ×e×ZØed d-œdАdфƒZÙee/eڃdvdӐdddþdþdTdþdddԐd՜
d֐dׄƒƒZÛee/e܃dwdKdTddؐdٜdڐdۄƒƒZÝee/eރdxd¿d¿dܐd¿ddddTdÝddސdߜ dàdᄃƒZßedâd㄃Zàd)d)d?œdädå„Zád)d)d?œdædç„Zâd)d)d?œdèdé„Zãd)d)d?œdêdë„Zäd)d)d?œdìdí„Zåd)d)d?œdîdï„Zæd)d)d?œdðdñ„Zçd)d)d?œdòdó„Zèd)d)d?œdôdõ„Zéd)d)d?œdöd÷„Zêeddødùœdúdû„ƒZëee/düe0d…dýdød-œdþdÿ„ƒƒZìee/eìdše0d…dýdød-œdd„ƒƒZí‡ZîS(yÚNDFramezÚ
    N-dimensional analogue of DataFrame. Store multi-dimensional in a
    size-mutable, labeled data structure
 
    Parameters
    ----------
    data : BlockManager
    axes : list
    copy : bool, default False
    Ú_mgrZ_cacherÚ _item_cacheÚ_cacheÚ_is_copyZ_subtypÚ_nameZ _default_kindZ_default_fill_valueÚ    _metadataZ__array_struct__Z__array_interface__Ú_flagsz    list[str]Ú_internal_nameszset[str]Ú_internal_names_setÚ
_accessorszfrozenset[str]Ú _hidden_attrsNz%weakref.ReferenceType[NDFrame] | Noner1zdict[Hashable, Any]Ú_attrsÚstrÚ_typFÚbool_tzMapping[Hashable, Any] | NoneÚNone)ÚdataÚcopyÚattrsÚreturncCsht |dd¡t |d|¡t |di¡|dkr8i}nt|ƒ}t |d|¡t |dt|dd¡dS)Nržr›rœr¦r¡T)Úallows_duplicate_labels)ÚobjectÚ __setattr__Údictrr)Úselfr«r¬r­©r´úJd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/core/generic.pyÚ__init__    szNDFrame.__init__z Dtype | None)ÚmgrÚdtyper¬r®cCsŒ| ¡D]0\}}|dk    rt|ƒ}| |¡}|j||d}q|rF| ¡}|dk    rˆt|tƒr|t|jƒdkr|t    |jdj
j |ƒr|n |j |d}|S)z passed a manager and a axes dictN©Úaxisér©r¸) ÚitemsryÚ_get_block_manager_axisZ reindex_axisr¬Ú
isinstancer{ÚlenÚblocksrXÚvaluesr¸Úastype)Úclsr·r–r¸r¬ÚaZaxeÚbm_axisr´r´rµÚ    _init_mgrs"    
ÿ þý zNDFrame._init_mgrTr3)r³Útypr¬r®cCs t|j||d}| |¡ |¡S)aö
        Private helper function to create a DataFrame with specific manager.
 
        Parameters
        ----------
        typ : {"block", "array"}
        copy : bool, default True
            Only controls whether the conversion from Block->ArrayManager
            copies the 1D arrays (to ensure proper/contiguous memory layout).
 
        Returns
        -------
        DataFrame
            New DataFrame using specified manager type. Is not guaranteed
            to be a copy or not.
        )rÈr¬)r}r›Ú _constructorÚ __finalize__)r³rÈr¬Únew_mgrr´r´rµÚ _as_manager9szNDFrame._as_manager©r®cCs|jdkri|_|jS)zý
        Dictionary of global attributes of this dataset.
 
        .. warning::
 
           attrs is experimental and may change without warning.
 
        See Also
        --------
        DataFrame.flags : Global flags applying to this object.
        N)r¦©r³r´r´rµr­Rs
z NDFrame.attrszMapping[Hashable, Any])Úvaluer®cCst|ƒ|_dS©N)r²r¦©r³rÏr´r´rµr­csrrcCs|jS)aù
        Get the properties associated with this pandas object.
 
        The available flags are
 
        * :attr:`Flags.allows_duplicate_labels`
 
        See Also
        --------
        Flags : Flags that apply to pandas objects.
        DataFrame.attrs : Global metadata applying to this dataset.
 
        Notes
        -----
        "Flags" differ from "metadata". Flags reflect properties of the
        pandas object (the Series or DataFrame). Metadata refer to properties
        of the dataset, and should be stored in :attr:`DataFrame.attrs`.
 
        Examples
        --------
        >>> df = pd.DataFrame({"A": [1, 2]})
        >>> df.flags
        <Flags(allows_duplicate_labels=True)>
 
        Flags can be get or set using ``.``
 
        >>> df.flags.allows_duplicate_labels
        True
        >>> df.flags.allows_duplicate_labels = False
 
        Or by slicing with a key
 
        >>> df.flags["allows_duplicate_labels"]
        False
        >>> df.flags["allows_duplicate_labels"] = True
        )r¡rÎr´r´rµÚflagsgs'z NDFrame.flags)r¬r¯z bool_t | None)r³r¬r¯r®cCs*|j|otƒ d}|dk    r&||jd<|S)a+
        Return a new object with updated flags.
 
        Parameters
        ----------
        copy : bool, default False
            Specify if a copy of the object should be made.
        allows_duplicate_labels : bool, optional
            Whether the returned object allows duplicate labels.
 
        Returns
        -------
        Series or DataFrame
            The same type as the caller.
 
        See Also
        --------
        DataFrame.attrs : Global metadata applying to this dataset.
        DataFrame.flags : Global flags applying to this object.
 
        Notes
        -----
        This method returns a new object that's a view on the same data
        as the input. Mutating the input or the output values will be reflected
        in the other.
 
        This method is intended to be used in method chains.
 
        "Flags" differ from "metadata". Flags reflect properties of the
        pandas object (the Series or DataFrame). Metadata refer to properties
        of the dataset, and should be stored in :attr:`DataFrame.attrs`.
 
        Examples
        --------
        >>> df = pd.DataFrame({"A": [1, 2]})
        >>> df.flags.allows_duplicate_labels
        True
        >>> df2 = df.set_flags(allows_duplicate_labels=False)
        >>> df2.flags.allows_duplicate_labels
        False
        ©ÚdeepNr¯)r¬rrÒ)r³r¬r¯Údfr´r´rµÚ    set_flagss0
zNDFrame.set_flagszDtypeObj | NonecCs0|dk    r,t|ƒ}|jdkr,td|j›dƒ‚|S)zvalidate the passed dtypeNÚVz+compound dtypes are not implemented in the z  constructor)raÚkindÚNotImplementedErrorÚ__name__)rÄr¸r´r´rµÚ_validate_dtypeÅs
 ÿzNDFrame._validate_dtypezCallable[..., NDFrameT])r³r®cCs t|ƒ‚dS)zb
        Used when a manipulation result has the same dimensions as the
        original.
        N©rDrÎr´r´rµrÉØszNDFrame._constructorcCs|jSrÐ)r›rÎr´r´rµÚ_dataãsz NDFrame._datarÚindexz#list[Literal[('index', 'columns')]]Ú _AXIS_ORDERS)rrÞÚrowszdict[Axis, AxisInt]Ú_AXIS_TO_AXIS_NUMBERÚintÚ_info_axis_numberzLiteral[('index', 'columns')]Ú_info_axis_nameÚ    _AXIS_LENzSequence[Axis] | None©r–c s&‡fdd„|pˆjDƒ}| |¡|S)z%Return an axes dictionary for myself.csi|]}|ˆ |¡“qSr´©Ú    _get_axis©Ú.0rÅrÎr´rµÚ
<dictcomp>÷sz0NDFrame._construct_axes_dict.<locals>.<dictcomp>)rßÚupdate)r³r–ÚkwargsÚdr´rÎrµÚ_construct_axes_dictôs
zNDFrame._construct_axes_dictrr )rºr®cCs<z |j|WStk
r6td|›d|j›ƒ‚YnXdS)NzNo axis named z for object type )ráÚKeyErrorÚ
ValueErrorrÚ)rÄrºr´r´rµÚ_get_axis_numberýs zNDFrame._get_axis_numbercCs| |¡}|j|SrÐ)ròrß)rÄrºÚ axis_numberr´r´rµÚ_get_axis_names
zNDFrame._get_axis_namertcCs*| |¡}|dkst‚|dkr$|jS|jS)N>rr»r)ròÚAssertionErrorrÞÚcolumns)r³rºrór´r´rµrè s
 zNDFrame._get_axiscCs$| |¡}|j}|dkr d|S|S)z'Map the axis to the block_manager axis.ér»)ròrå)rÄrºÚndimr´r´rµr¾s
 
zNDFrame._get_block_manager_axiszdict[str, Series | MultiIndex]c Cs’t||ƒ}i}|d}t|jƒD]L\}}|dk    r:|}}n|›d|›}|}| |¡}    |     ¡}
||
_|
||<q t|tƒr~|} n| ¡} | ||<|S)NrZlevel_)ÚgetattrÚ    enumerateÚnamesÚget_level_valuesZ    to_seriesrÞr¿ru) r³rºZ
axis_indexrîÚprefixÚiÚnameÚkeyÚlevelZ level_valuesÚsZdindexr´r´rµÚ_get_axis_resolverss"
 
 
 
 
zNDFrame._get_axis_resolversz#dict[Hashable, Series | MultiIndex]csBddlm‰i}|jD]}| | |¡¡q‡fdd„| ¡DƒS)Nr©Úclean_column_namecs$i|]\}}t|tƒsˆ|ƒ|“qSr´©r¿râ©rêÚkÚvrr´rµrëCs
z0NDFrame._get_index_resolvers.<locals>.<dictcomp>)Úpandas.core.computation.parsingrrßrìrr½)r³rîÚ    axis_namer´rrµÚ_get_index_resolvers;s
 
zNDFrame._get_index_resolverszdict[Hashable, Series]cs:ddlm‰t|tƒr$ˆ|jƒ|iS‡fdd„| ¡DƒS)zø
        Return the special character free column resolvers of a dataframe.
 
        Column names with special characters are 'cleaned up' so that they can
        be referred to by backtick quoting.
        Used in :meth:`DataFrame.eval`.
        rrcs$i|]\}}t|tƒsˆ|ƒ|“qSr´rrrr´rµrëSs
z9NDFrame._get_cleaned_column_resolvers.<locals>.<dictcomp>)r
rr¿rcrÿr½rÎr´rrµÚ_get_cleaned_column_resolversEs      
 
ÿz%NDFrame._get_cleaned_column_resolverscCs t||jƒSrÐ)rùrärÎr´r´rµÚ
_info_axisWszNDFrame._info_axiscCs t||jƒSrÐ)rùÚ_stat_axis_namerÎr´r´rµÚ
_stat_axis[szNDFrame._stat_axisztuple[int, ...]cst‡fdd„ˆjDƒƒS)z3
        Return a tuple of axis dimensions
        c3s|]}tˆ |¡ƒVqdSrЩrÀrèrérÎr´rµÚ    <genexpr>dsz NDFrame.shape.<locals>.<genexpr>)ÚtuplerßrÎr´rÎrµÚshape_sz NDFrame.shapez list[Index]cs‡fdd„ˆjDƒS)z?
        Return index label(s) of the internal NDFrame
        csg|]}ˆ |¡‘qSr´rçrérÎr´rµÚ
<listcomp>msz NDFrame.axes.<locals>.<listcomp>)rßrÎr´rÎrµr–fsz NDFrame.axescCs|jjS)aº
        Return an int representing the number of axes / array dimensions.
 
        Return 1 if Series. Otherwise return 2 if DataFrame.
 
        See Also
        --------
        ndarray.ndim : Number of array dimensions.
 
        Examples
        --------
        >>> s = pd.Series({'a': 1, 'b': 2, 'c': 3})
        >>> s.ndim
        1
 
        >>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
        >>> df.ndim
        2
        )r›rørÎr´r´rµrøosz NDFrame.ndimcCs t |j¡S)a
        Return an int representing the number of elements in this object.
 
        Return the number of rows if Series. Otherwise return the number of
        rows times number of columns if DataFrame.
 
        See Also
        --------
        ndarray.size : Number of elements in the array.
 
        Examples
        --------
        >>> s = pd.Series({'a': 1, 'b': 2, 'c': 3})
        >>> s.size
        3
 
        >>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
        >>> df.size
        4
        )ÚnpÚprodrrÎr´r´rµÚsize†sz NDFrame.size©rºr¬)r³rºr¬r®cCs|j||d|dS)a
        Assign desired index to given axis.
 
        Indexes for%(extended_summary_sub)s row labels can be changed by assigning
        a list-like or Index.
 
        Parameters
        ----------
        labels : list-like, Index
            The values for the new index.
 
        axis : %(axes_single_arg)s, default 0
            The axis to update. The value 0 identifies the rows. For `Series`
            this parameter is unused and defaults to 0.
 
        copy : bool, default True
            Whether to make a copy of the underlying data.
 
            .. versionadded:: 1.5.0
 
        Returns
        -------
        %(klass)s
            An object of type %(klass)s.
 
        See Also
        --------
        %(klass)s.rename_axis : Alter the name of the index%(see_also_sub)s.
        F)r˜r¬)Ú_set_axis_nocheck)r³Úlabelsrºr¬r´r´rµÚset_axis s$zNDFrame.set_axis©rºr˜r¬cCsF|rt|| |¡|ƒn*|j|o&tƒ d}t|| |¡|ƒ|SdS©NrÓ)Úsetattrrôr¬r)r³rrºr˜r¬Úobjr´r´rµrÆs
zNDFrame._set_axis_nocheckzAnyArrayLike | list)rºrr®cCs"t|ƒ}|j ||¡| ¡dS)zŠ
        This is called from the cython code when we set the `index` attribute
        directly, e.g. `series.index = [1, 2, 3]`.
        N)ryr›rÚ_clear_item_cache)r³rºrr´r´rµÚ    _set_axisÓszNDFrame._set_axis)r³Úaxis1Úaxis2r¬r®c    s<ˆ |¡}ˆ |¡}||kr0ˆj|o*tƒ dS||||i‰‡‡fdd„tˆjƒDƒ}ˆj ||¡}tƒrúˆjjrút    ˆjt
ƒrút ||d|ddddd    }t    |t
ƒs¨t ‚t    ˆjt
ƒs¸t ‚ˆjj dj|j d_|j dj |j d¡ˆ |¡jˆd
d S|s
|dkrˆjjr| ¡}ˆj|f|žd diŽjˆd
d S) z}
        Interchange axes and swap values axes appropriately.
 
        Returns
        -------
        same as input
        rÓcsg|]}ˆ ˆ ||¡¡‘qSr´)rèÚget©rêr©Úmappingr³r´rµrðsz$NDFrame.swapaxes.<locals>.<listcomp>rr»NFÚblock)r¸r¬rÈÚswapaxes©Úmethodr¬)ròr¬rÚrangeråÚ_valuesr*r›Úis_single_blockr¿r{r~rõrÁÚrefsZ add_referencerÉrÊ)    r³r#r$r¬rþÚjZnew_axesZ
new_valuesrËr´r'rµr*ÝsP
 
 ÿþ
ýú ÿÿþüûzNDFrame.swapaxesr—)r—r-)r³rrºr®cCs$| |¡}| |¡}|j||ddS)aü
        Return {klass} with requested index / column level(s) removed.
 
        Parameters
        ----------
        level : int, str, or list-like
            If a string is given, must be the name of a level
            If list-like, elements must be names or positional indexes
            of levels.
 
        axis : {{0 or 'index', 1 or 'columns'}}, default 0
            Axis along which the level(s) is removed:
 
            * 0 or 'index': remove level(s) in column.
            * 1 or 'columns': remove level(s) in row.
 
            For `Series` this parameter is unused and defaults to 0.
 
        Returns
        -------
        {klass}
            {klass} with requested index / column level(s) removed.
 
        Examples
        --------
        >>> df = pd.DataFrame([
        ...     [1, 2, 3, 4],
        ...     [5, 6, 7, 8],
        ...     [9, 10, 11, 12]
        ... ]).set_index([0, 1]).rename_axis(['a', 'b'])
 
        >>> df.columns = pd.MultiIndex.from_tuples([
        ...     ('c', 'e'), ('d', 'f')
        ... ], names=['level_1', 'level_2'])
 
        >>> df
        level_1   c   d
        level_2   e   f
        a b
        1 2      3   4
        5 6      7   8
        9 10    11  12
 
        >>> df.droplevel('a')
        level_1   c   d
        level_2   e   f
        b
        2        3   4
        6        7   8
        10      11  12
 
        >>> df.droplevel('level_2', axis=1)
        level_1   c   d
        a b
        1 2      3   4
        5 6      7   8
        9 10    11  12
        Nr)rèÚ    droplevelr)r³rrºrZ
new_labelsr´r´rµr2s=
 
zNDFrame.droplevelr
z Series | Any)Úitemr®cCs||}||=|SrÐr´)r³r3Úresultr´r´rµÚpopTsz NDFrame.popú Axis | Noner¹cs@|dkrt|jƒn
| |¡f‰|jt‡fdd„t|jƒDƒƒS)aø
 
        Squeeze 1 dimensional axis objects into scalars.
 
        Series or DataFrames with a single element are squeezed to a scalar.
        DataFrames with a single column or a single row are squeezed to a
        Series. Otherwise the object is unchanged.
 
        This method is most useful when you don't know if your
        object is a Series or DataFrame, but you do know it has just a single
        column. In that case you can safely call `squeeze` to ensure you have a
        Series.
 
        Parameters
        ----------
        axis : {0 or 'index', 1 or 'columns', None}, default None
            A specific axis to squeeze. By default, all length-1 axes are
            squeezed. For `Series` this parameter is unused and defaults to `None`.
 
        Returns
        -------
        DataFrame, Series, or scalar
            The projection after squeezing `axis` or all the axes.
 
        See Also
        --------
        Series.iloc : Integer-location based indexing for selecting scalars.
        DataFrame.iloc : Integer-location based indexing for selecting Series.
        Series.to_frame : Inverse of DataFrame.squeeze for a
            single-column DataFrame.
 
        Examples
        --------
        >>> primes = pd.Series([2, 3, 5, 7])
 
        Slicing might produce a Series with a single value:
 
        >>> even_primes = primes[primes % 2 == 0]
        >>> even_primes
        0    2
        dtype: int64
 
        >>> even_primes.squeeze()
        2
 
        Squeezing objects with more than one value in every axis does nothing:
 
        >>> odd_primes = primes[primes % 2 == 1]
        >>> odd_primes
        1    3
        2    5
        3    7
        dtype: int64
 
        >>> odd_primes.squeeze()
        1    3
        2    5
        3    7
        dtype: int64
 
        Squeezing is even more effective when used with DataFrames.
 
        >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['a', 'b'])
        >>> df
           a  b
        0  1  2
        1  3  4
 
        Slicing a single column will produce a DataFrame with the columns
        having only one value:
 
        >>> df_a = df[['a']]
        >>> df_a
           a
        0  1
        1  3
 
        So the columns can be squeezed down, resulting in a Series:
 
        >>> df_a.squeeze('columns')
        0    1
        1    3
        Name: a, dtype: int64
 
        Slicing a single row from a single column will produce a single
        scalar DataFrame:
 
        >>> df_0a = df.loc[df.index < 1, ['a']]
        >>> df_0a
           a
        0  1
 
        Squeezing the rows produces a single scalar Series:
 
        >>> df_0a.squeeze('rows')
        a    1
        Name: 0, dtype: int64
 
        Squeezing all axes will project directly into a scalar:
 
        >>> df_0a.squeeze()
        1
        Nc3s2|]*\}}|ˆkr"t|ƒdkr"dntdƒVqdS)r»rN)rÀÚslice©rêrþrÅrær´rµrÄsÿz"NDFrame.squeeze.<locals>.<genexpr>)r-råròÚilocrrúr–)r³rºr´rærµÚsqueezeZs h þÿzNDFrame.squeezeÚignore)rÞrörºr¬r˜rÚerrorszRenamer | Nonez Level | NonezNDFrameT | None)
r³ÚmapperrÞrörºr¬r˜rr<r®cs |dkr |dkr |dkr tdƒ‚|dk    s0|dk    rR|dk    r@tdƒ‚|dk    rntdƒ‚n|rj| |¡dkrj|}n|}| |¡|r€|n|j|oŽtƒ d}    t||fƒD]Ø\}
} | dkr²q | |
¡} t | ¡} |dk    rØ|      |¡}t
| ƒsP| j r|dk    r|   |¡  | ¡‰n
|   | ¡‰|dkrPtˆˆdkƒrP‡fdd    „t| ƒDƒ}t|›d
ƒ‚| j| |d }|    j||
d d d|     ¡q |rŽ| |    ¡dS|    j|ddSdS)Nzmust pass an index to renameú:Cannot specify both 'axis' and any of 'index' or 'columns'z<Cannot specify both 'mapper' and any of 'index' or 'columns'r»rÓÚraiseéÿÿÿÿcs g|]\}}ˆ|dkr|‘qS)r@r´)rêrÞÚlabel©Úindexerr´rµrs þz#NDFrame._rename.<locals>.<listcomp>ú not found in axis©rTFrÚrenamer+)Ú    TypeErrorròÚ*_check_inplace_and_allows_duplicate_labelsr¬rrúrèrjÚget_rename_functionÚ_get_level_numberÚcallableZ    _is_multirüÚget_indexer_forrÀrðZ_transform_indexrr!Ú_update_inplacerÊ)r³r=rÞrörºr¬r˜rr<r4Zaxis_noÚ replacementsÚaxÚfZmissing_labelsÚ    new_indexr´rBrµÚ_renameÍsNÿÿ
 
 
 
 
 
 
þ
 
zNDFrame._rename.)rÞrörºr¬r˜zIndexLabel | lib.NoDefaultzLiteral[False])r³r=rºr¬r˜r®cCsdSrÐr´©r³r=rÞrörºr¬r˜r´r´rµÚ rename_axiss zNDFrame.rename_axis)rÞrörºr¬z Literal[True])r=rºr¬r˜r®cCsdSrÐr´rSr´r´rµrT!s cCsdSrÐr´rSr´r´rµrT.s c s(||dœ}|dk    r| |¡}t|dƒ}|r4tƒr4d}|tjk    rxt|ƒpVt|ƒoVt|ƒ }|rn|j||||dSt    dƒ‚n¬|r€|n
|j
|d}    t |j ƒD]~}|  | |¡¡}
|
tjkr¶q–t|
ƒpÎt|
ƒoÎt|
ƒ }|rÚ|
} n(t |
¡‰| |¡j} ‡fdd    „| Dƒ} |    j| |d
|dq–|s |    SdSdS) ar
        Set the name of the axis for the index or columns.
 
        Parameters
        ----------
        mapper : scalar, list-like, optional
            Value to set the axis name attribute.
        index, columns : scalar, list-like, dict-like or function, optional
            A scalar, list-like, dict-like or functions transformations to
            apply to that axis' values.
            Note that the ``columns`` parameter is not allowed if the
            object is a Series. This parameter only apply for DataFrame
            type objects.
 
            Use either ``mapper`` and ``axis`` to
            specify the axis to target with ``mapper``, or ``index``
            and/or ``columns``.
        axis : {0 or 'index', 1 or 'columns'}, default 0
            The axis to rename. For `Series` this parameter is unused and defaults to 0.
        copy : bool, default None
            Also copy underlying data.
        inplace : bool, default False
            Modifies the object directly, instead of creating a new Series
            or DataFrame.
 
        Returns
        -------
        Series, DataFrame, or None
            The same type as the caller or None if ``inplace=True``.
 
        See Also
        --------
        Series.rename : Alter Series index labels or name.
        DataFrame.rename : Alter DataFrame index labels or name.
        Index.rename : Set new names on index.
 
        Notes
        -----
        ``DataFrame.rename_axis`` supports two calling conventions
 
        * ``(index=index_mapper, columns=columns_mapper, ...)``
        * ``(mapper, axis={'index', 'columns'}, ...)``
 
        The first calling convention will only modify the names of
        the index and/or the names of the Index object that is the columns.
        In this case, the parameter ``copy`` is ignored.
 
        The second calling convention will modify the names of the
        corresponding index if mapper is a list or a scalar.
        However, if mapper is dict-like or a function, it will use the
        deprecated behavior of modifying the axis *labels*.
 
        We *highly* recommend using keyword arguments to clarify your
        intent.
 
        Examples
        --------
        **Series**
 
        >>> s = pd.Series(["dog", "cat", "monkey"])
        >>> s
        0       dog
        1       cat
        2    monkey
        dtype: object
        >>> s.rename_axis("animal")
        animal
        0    dog
        1    cat
        2    monkey
        dtype: object
 
        **DataFrame**
 
        >>> df = pd.DataFrame({"num_legs": [4, 4, 2],
        ...                    "num_arms": [0, 0, 2]},
        ...                   ["dog", "cat", "monkey"])
        >>> df
                num_legs  num_arms
        dog            4         0
        cat            4         0
        monkey         2         2
        >>> df = df.rename_axis("animal")
        >>> df
                num_legs  num_arms
        animal
        dog            4         0
        cat            4         0
        monkey         2         2
        >>> df = df.rename_axis("limbs", axis="columns")
        >>> df
        limbs   num_legs  num_arms
        animal
        dog            4         0
        cat            4         0
        monkey         2         2
 
        **MultiIndex**
 
        >>> df.index = pd.MultiIndex.from_product([['mammal'],
        ...                                        ['dog', 'cat', 'monkey']],
        ...                                       names=['type', 'name'])
        >>> df
        limbs          num_legs  num_arms
        type   name
        mammal dog            4         0
               cat            4         0
               monkey         2         2
 
        >>> df.rename_axis(index={'type': 'class'})
        limbs          num_legs  num_arms
        class  name
        mammal dog            4         0
               cat            4         0
               monkey         2         2
 
        >>> df.rename_axis(columns=str.upper)
        LIMBS          num_legs  num_arms
        type   name
        mammal dog            4         0
               cat            4         0
               monkey         2         2
        ©rÞröNr˜Frz,Use `.rename` to alter labels with a mapper.rÓcsg|] }ˆ|ƒ‘qSr´r´)rêrÿ©rPr´rµräsz'NDFrame.rename_axis.<locals>.<listcomp>T)ròrLrrÚ
no_defaultr_r[rWÚ_set_axis_namerñr¬r-rår%rôrjrIrèrû) r³r=rÞrörºr¬r˜r–Z
non_mapperr4r    ZnewnamesZcurnamesr´rVrµrT;sD
 
 
 
 
ÿÿ
 
 
 cCsZ| |¡}| |¡ |¡}t|dƒ}|r,|n
|j|d}|dkrH||_n||_|sV|SdS)at
        Set the name(s) of the axis.
 
        Parameters
        ----------
        name : str or list of str
            Name(s) to set.
        axis : {0 or 'index', 1 or 'columns'}, default 0
            The axis to set the label. The value 0 or 'index' specifies index,
            and the value 1 or 'columns' specifies columns.
        inplace : bool, default False
            If `True`, do operation inplace and return None.
        copy:
            Whether to make a copy of the result.
 
        Returns
        -------
        Series, DataFrame, or None
            The same type as the caller or `None` if `inplace` is `True`.
 
        See Also
        --------
        DataFrame.rename : Alter the axis labels of :class:`DataFrame`.
        Series.rename : Alter the index labels or set the index name
            of :class:`Series`.
        Index.rename : Set the name of :class:`Index` or :class:`MultiIndex`.
 
        Examples
        --------
        >>> df = pd.DataFrame({"num_legs": [4, 4, 2]},
        ...                   ["dog", "cat", "monkey"])
        >>> df
                num_legs
        dog            4
        cat            4
        monkey         2
        >>> df._set_axis_name("animal")
                num_legs
        animal
        dog            4
        cat            4
        monkey         2
        >>> df.index = pd.MultiIndex.from_product(
        ...                [["mammal"], ['dog', 'cat', 'monkey']])
        >>> df._set_axis_name(["type", "name"])
                       num_legs
        type   name
        mammal dog        4
               cat        4
               monkey     2
        r˜rÓrN)ròrèZ    set_namesrLr¬rÞrö)r³rÿrºr˜r¬ÚidxZrenamedr´r´rµrXês7
 
zNDFrame._set_axis_namecst‡‡fdd„ˆjDƒƒS)Nc3s$|]}ˆ |¡ ˆ |¡¡VqdSrÐ)rèÚequalsré©Úotherr³r´rµr3sz(NDFrame._indexed_same.<locals>.<genexpr>)Úallrß©r³r\r´r[rµÚ _indexed_same1sÿzNDFrame._indexed_samer°)r\r®cCs8t|t|ƒƒs t|t|ƒƒs dStt|ƒ}|j |j¡S)a.
        Test whether two objects contain the same elements.
 
        This function allows two Series or DataFrames to be compared against
        each other to see if they have the same shape and elements. NaNs in
        the same location are considered equal.
 
        The row/column index do not need to have the same type, as long
        as the values are considered equal. Corresponding columns must be of
        the same dtype.
 
        Parameters
        ----------
        other : Series or DataFrame
            The other Series or DataFrame to be compared with the first.
 
        Returns
        -------
        bool
            True if all elements are the same in both objects, False
            otherwise.
 
        See Also
        --------
        Series.eq : Compare two Series objects of the same length
            and return a Series where each element is True if the element
            in each Series is equal, False otherwise.
        DataFrame.eq : Compare two DataFrame objects of the same shape and
            return a DataFrame where each element is True if the respective
            element in each DataFrame is equal, False otherwise.
        testing.assert_series_equal : Raises an AssertionError if left and
            right are not equal. Provides an easy interface to ignore
            inequality in dtypes, indexes and precision among others.
        testing.assert_frame_equal : Like assert_series_equal, but targets
            DataFrames.
        numpy.array_equal : Return True if two arrays have the same shape
            and elements, False otherwise.
 
        Examples
        --------
        >>> df = pd.DataFrame({1: [10], 2: [20]})
        >>> df
            1   2
        0  10  20
 
        DataFrames df and exactly_equal have the same types and values for
        their elements and column labels, which will return True.
 
        >>> exactly_equal = pd.DataFrame({1: [10], 2: [20]})
        >>> exactly_equal
            1   2
        0  10  20
        >>> df.equals(exactly_equal)
        True
 
        DataFrames df and different_column_type have the same element
        types and values, but have different types for the column labels,
        which will still return True.
 
        >>> different_column_type = pd.DataFrame({1.0: [10], 2.0: [20]})
        >>> different_column_type
           1.0  2.0
        0   10   20
        >>> df.equals(different_column_type)
        True
 
        DataFrames df and different_data_type have different types for the
        same values for their elements, and will return False even though
        their column labels are the same values and types.
 
        >>> different_data_type = pd.DataFrame({1: [10.0], 2: [20.0]})
        >>> different_data_type
              1     2
        0  10.0  20.0
        >>> df.equals(different_data_type)
        False
        F)r¿Útyperršr›rZr^r´r´rµrZ7sO
zNDFrame.equalscCs2ddœdd„}|j |¡}| |¡}|j|ddS)Nr©rÂcSs"t|jƒrt |¡St |¡SdSrÐ)rTr¸ÚoperatorÚinvÚnegrar´r´rµÚblk_funcs
 
z!NDFrame.__neg__.<locals>.blk_funcÚ__neg__r+©r›ÚapplyrÉrÊ©r³reÚnew_dataÚresr´r´rµrfŽs 
zNDFrame.__neg__cCs2ddœdd„}|j |¡}| |¡}|j|ddS)NrracSs t|jƒr| ¡St |¡SdSrÐ)rTr¸r¬rbÚposrar´r´rµre¢s
z!NDFrame.__pos__.<locals>.blk_funcÚ__pos__r+rgrir´r´rµrm s     
zNDFrame.__pos__cCs4|js|jddS|j tj¡}| |¡j|ddS)NFrÓÚ
__invert__r+)rr¬r›rhrbÚinvertrÉrÊ)r³rjr´r´rµrn¯s zNDFrame.__invert__rcCstdt|ƒj›dƒ‚dS)NzThe truth value of a zC is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().)rñr`rÚrÎr´r´rµÚ __nonzero__¸sÿzNDFrame.__nonzero__cCsH| ¡}t|ttjfƒr t|ƒSt|ƒr<tdt|ƒj›ƒ‚|     ¡dS)a"
        Return the bool of a single element Series or DataFrame.
 
        This must be a boolean scalar value, either True or False. It will raise a
        ValueError if the Series or DataFrame does not have exactly 1 element, or that
        element is not boolean (integer values 0 and 1 will also raise an exception).
 
        Returns
        -------
        bool
            The value in the Series or DataFrame.
 
        See Also
        --------
        Series.astype : Change the data type of a Series, including to boolean.
        DataFrame.astype : Change the data type of a DataFrame, including to boolean.
        numpy.bool_ : NumPy boolean data type, used by pandas for boolean values.
 
        Examples
        --------
        The method will only work for single element objects with a boolean value:
 
        >>> pd.Series([True]).bool()
        True
        >>> pd.Series([False]).bool()
        False
 
        >>> pd.DataFrame({'col': [True]}).bool()
        True
        >>> pd.DataFrame({'col': [False]}).bool()
        False
        z0bool cannot act on a non-boolean single element T)
r:r¿ÚboolrÚbool_r_rñr`rÚrp)r³r    r´r´rµrqÁs"ÿz NDFrame.boolcCs"|j tj¡}| |¡j|ddS)aÎ
        Return a Series/DataFrame with absolute numeric value of each element.
 
        This function only applies to elements that are all numeric.
 
        Returns
        -------
        abs
            Series/DataFrame containing the absolute value of each element.
 
        See Also
        --------
        numpy.absolute : Calculate the absolute value element-wise.
 
        Notes
        -----
        For ``complex`` inputs, ``1.2 + 1j``, the absolute value is
        :math:`\sqrt{ a^2 + b^2 }`.
 
        Examples
        --------
        Absolute numeric values in a Series.
 
        >>> s = pd.Series([-1.10, 2, -3.33, 4])
        >>> s.abs()
        0    1.10
        1    2.00
        2    3.33
        3    4.00
        dtype: float64
 
        Absolute numeric values in a Series with complex numbers.
 
        >>> s = pd.Series([1.2 + 1j])
        >>> s.abs()
        0    1.56205
        dtype: float64
 
        Absolute numeric values in a Series with a Timedelta element.
 
        >>> s = pd.Series([pd.Timedelta('1 days')])
        >>> s.abs()
        0   1 days
        dtype: timedelta64[ns]
 
        Select rows with data closest to certain value using argsort (from
        `StackOverflow <https://stackoverflow.com/a/17758115>`__).
 
        >>> df = pd.DataFrame({
        ...     'a': [4, 5, 6, 7],
        ...     'b': [10, 20, 30, 40],
        ...     'c': [100, 50, -30, -50]
        ... })
        >>> df
             a    b    c
        0    4   10  100
        1    5   20   50
        2    6   30  -30
        3    7   40  -50
        >>> df.loc[(df.c - 43).abs().argsort()]
             a    b    c
        1    5   20   50
        0    4   10  100
        2    6   30  -30
        3    7   40  -50
        Úabs©rÿ)r›rhrrsrÉrÊ)r³Zres_mgrr´r´rµrsðsDz NDFrame.abscCs| ¡SrÐ)rsrÎr´r´rµÚ__abs__7szNDFrame.__abs__)r³Údecimalsr®cCs| |¡j|ddS)NÚ    __round__r+)ÚroundrÊ)r³rvr´r´rµrw;szNDFrame.__round__r0)rrºr®cCs:| |¡}|dk    o8t|ƒo8||j|jko8|j||d S)a|
        Test whether a key is a level reference for a given axis.
 
        To be considered a level reference, `key` must be a string that:
          - (axis=0): Matches the name of an index level and does NOT match
            a column label.
          - (axis=1): Matches the name of a column level and does NOT match
            an index label.
 
        Parameters
        ----------
        key : Hashable
            Potential level name for the given axis
        axis : int, default 0
            Axis that levels are associated with (0 for index, 1 for columns)
 
        Returns
        -------
        is_level : bool
        Nr¹)ròrdr–rûÚ_is_label_reference)r³rrºÚaxis_intr´r´rµÚ_is_level_referenceGs
ÿþüzNDFrame._is_level_referencecsJˆ |¡‰‡fdd„tˆjƒDƒ}ˆdk    oHtˆƒoHt‡‡fdd„|DƒƒS)aR
        Test whether a key is a label reference for a given axis.
 
        To be considered a label reference, `key` must be a string that:
          - (axis=0): Matches a column label
          - (axis=1): Matches an index label
 
        Parameters
        ----------
        key : Hashable
            Potential label name, i.e. Index entry.
        axis : int, default 0
            Axis perpendicular to the axis that labels are associated with
            (0 means search for column labels, 1 means search for index labels)
 
        Returns
        -------
        is_label: bool
        c3s|]}|ˆkr|VqdSrÐr´©rêrO©rzr´rµr|sz.NDFrame._is_label_reference.<locals>.<genexpr>Nc3s|]}ˆˆj|kVqdSrÐrær|©rr³r´rµrs)ròr-rårdÚany)r³rrºÚ
other_axesr´©rzrr³rµryfs
ÿýzNDFrame._is_label_referencecCs|j||dp|j||dS)a8
        Test whether a key is a label or level reference for a given axis.
 
        To be considered either a label or a level reference, `key` must be a
        string that:
          - (axis=0): Matches a column label or an index level
          - (axis=1): Matches an index label or a column level
 
        Parameters
        ----------
        key : Hashable
            Potential label or level name
        axis : int, default 0
            Axis that levels are associated with (0 for index, 1 for columns)
 
        Returns
        -------
        bool
        r¹)r{ry)r³rrºr´r´rµÚ_is_label_or_level_reference„sÿz$NDFrame._is_label_or_level_referencec     s²ˆ |¡‰‡fdd„tˆjƒDƒ}ˆdk    r®tˆƒr®ˆˆjˆjkr®t‡‡fdd„|Dƒƒr®ˆdkrfdnd\}}ˆdkrzdnd\}}dˆ›d    |›d
|›d |›d
|›d  }t|ƒ‚dS) a¼
        Check whether `key` is ambiguous.
 
        By ambiguous, we mean that it matches both a level of the input
        `axis` and a label of the other axis.
 
        Parameters
        ----------
        key : Hashable
            Label or level name.
        axis : int, default 0
            Axis that levels are associated with (0 for index, 1 for columns).
 
        Raises
        ------
        ValueError: `key` is ambiguous
        c3s|]}|ˆkr|VqdSrÐr´r|r}r´rµr²sz:NDFrame._check_label_or_level_ambiguity.<locals>.<genexpr>Nc3s|]}ˆˆj|kVqdSrÐrær|r~r´rµr¸sr)ZanrÞ)rÅÚcolumnú'z
' is both ú z  level and z label, which is ambiguous.)ròr-rårdr–rûrrñ)    r³rrºr€Z level_articleZ
level_typeZ label_articleZ
label_typeÚmsgr´rrµÚ_check_label_or_level_ambiguitys"
ÿþýüÿÿ"ÿz'NDFrame._check_label_or_level_ambiguityrcsØ| ˆ¡‰‡fdd„t|jƒDƒ}|j|ˆdrT|j|ˆd|j||ddj}n*|j|ˆdrv|jˆ     |¡j}nt
|ƒ‚|j dkrÔ|r¦t |  |d¡tƒr¦d}nd}ˆdkr¶dnd    }td
|›d |›d |›ƒ‚|S) a˜
        Return a 1-D array of values associated with `key`, a label or level
        from the given `axis`.
 
        Retrieval logic:
          - (axis=0): Return column values if `key` matches a column label.
            Otherwise return index level values if `key` matches an index
            level.
          - (axis=1): Return row values if `key` matches an index label.
            Otherwise return column level values if 'key' matches a column
            level
 
        Parameters
        ----------
        key : Hashable
            Label or level name.
        axis : int, default 0
            Axis that levels are associated with (0 for index, 1 for columns)
 
        Returns
        -------
        np.ndarray or ExtensionArray
 
        Raises
        ------
        KeyError
            if `key` matches neither a label nor a level
        ValueError
            if `key` matches multiple labels
        csg|]}|ˆkr|‘qSr´r´r|r¹r´rµrêsz6NDFrame._get_label_or_level_values.<locals>.<listcomp>r¹rr»zX
For a multi-index, the label must be a tuple with elements corresponding to each level.ÚrƒrÞzThe z label 'z' is not unique.)ròr-råryr‡Úxsr.r{r–rürðrør¿rèrurñ)r³rrºr€rÂZ multi_messageZlabel_axis_namer´r¹rµÚ_get_label_or_level_valuesÉs$ 
 
ÿÿz"NDFrame._get_label_or_level_valuescs술ˆ¡‰t |¡}‡‡fdd„|Dƒ}|r@tdˆ›d|›ƒ‚‡‡fdd„|Dƒ}‡‡fdd„|Dƒ}ˆjdd}ˆd    kr¦|r|j|d
d
d |rè|j|d d
d nB|rÔt|jt    ƒrÆ|j 
|¡|_nt |jj ƒ|_|rè|j|d    d
d |S)a    
        Drop labels and/or levels for the given `axis`.
 
        For each key in `keys`:
          - (axis=0): If key matches a column label then drop the column.
            Otherwise if key matches an index level then drop the level.
          - (axis=1): If key matches an index label then drop the row.
            Otherwise if key matches a column level then drop the level.
 
        Parameters
        ----------
        keys : str or list of str
            labels or levels to drop
        axis : int, default 0
            Axis that levels are associated with (0 for index, 1 for columns)
 
        Returns
        -------
        dropped: DataFrame
 
        Raises
        ------
        ValueError
            if any `keys` match neither a label nor a level
        csg|]}ˆj|ˆds|‘qS©r¹)r‚r&©rºr³r´rµr%sz2NDFrame._drop_labels_or_levels.<locals>.<listcomp>z;The following keys are not valid labels or levels for axis z: csg|]}ˆj|ˆdr|‘qSr‹©r{r&rŒr´rµr0scsg|]}ˆj|ˆds|‘qSr‹rr&rŒr´rµr2sFrÓrT)Údropr˜r»©rºr˜) ròrjZmaybe_make_listrñr¬Z reset_indexrŽr¿rörur2rwr)r³ÚkeysrºZ invalid_keysZlevels_to_dropZlabels_to_dropZdroppedr´rŒrµÚ_drop_labels_or_levelss0
 
 ÿÿ  zNDFrame._drop_labels_or_levelszClassVar[None]Ú__hash__r cCs
t|jƒS)z~
        Iterate over info axis.
 
        Returns
        -------
        iterator
            Info axis as iterator.
        )ÚiterrrÎr´r´rµÚ__iter__Zs    zNDFrame.__iter__cCs|jS)z¾
        Get the 'info axis' (see Indexing for more).
 
        This is index for Series, columns for DataFrame.
 
        Returns
        -------
        Index
            Info axis.
        ©rrÎr´r´rµrfs z NDFrame.keysccs|jD]}|||fVqdS)z«
        Iterate over (label, values) on info axis
 
        This is index for Series and columns for DataFrame.
 
        Returns
        -------
        Generator
        Nr•)r³Úhr´r´rµr½ss
 
z NDFrame.itemscCs
t|jƒS)zReturns length of info axis)rÀrrÎr´r´rµÚ__len__€szNDFrame.__len__cCs
||jkS)z#True if the key is in the info axisr•)r³rr´r´rµÚ __contains__„szNDFrame.__contains__cst‡fdd„ˆjDƒƒS)aË
        Indicator whether Series/DataFrame is empty.
 
        True if Series/DataFrame is entirely empty (no items), meaning any of the
        axes are of length 0.
 
        Returns
        -------
        bool
            If Series/DataFrame is empty, return True, if not return False.
 
        See Also
        --------
        Series.dropna : Return series without null values.
        DataFrame.dropna : Return DataFrame with labels on given axis omitted
            where (all or any) data are missing.
 
        Notes
        -----
        If Series/DataFrame contains only NaNs, it is still not considered empty. See
        the example below.
 
        Examples
        --------
        An example of an actual empty DataFrame. Notice the index is empty:
 
        >>> df_empty = pd.DataFrame({'A' : []})
        >>> df_empty
        Empty DataFrame
        Columns: [A]
        Index: []
        >>> df_empty.empty
        True
 
        If we only have NaNs in our DataFrame, it is not considered empty! We
        will need to drop the NaNs to make the DataFrame empty:
 
        >>> df = pd.DataFrame({'A' : [np.nan]})
        >>> df
            A
        0 NaN
        >>> df.empty
        False
        >>> df.dropna().empty
        True
 
        >>> ser_empty = pd.Series({'A' : []})
        >>> ser_empty
        A    []
        dtype: object
        >>> ser_empty.empty
        False
        >>> ser_empty = pd.Series()
        >>> ser_empty.empty
        True
        c3s |]}tˆ |¡ƒdkVqdS)rNrrérÎr´rµrÃsz NDFrame.empty.<locals>.<genexpr>)rrßrÎr´rÎrµÚempty‰s:z NDFrame.emptyièÚ__array_priority__znpt.DTypeLike | Nonez
np.ndarray)r¸r®cCsf|j}tj||d}t|j|jƒrbtƒrb|jjrbt|jj    d|jƒrbt|j|jƒrb| 
¡}d|j _ |S)Nr¼rF) r.rÚasarrayrOr¸rr›r/Údtypesr9ÚviewrÒZ    writeable)r³r¸rÂZarrr´r´rµÚ    __array__Ìs ÿþýÿzNDFrame.__array__znp.ufuncr)Úufuncr,ÚinputsrícOstj|||f|ž|ŽSrÐ)riZ array_ufunc)r³rŸr,r rír´r´rµÚ__array_ufunc__ÜszNDFrame.__array_ufunc__zdict[str, Any]csB‡fdd„ˆjDƒ}ˆjˆjˆjˆj‡fdd„ˆjjDƒdœ|–S)Ncsi|]}|tˆ|dƒ“qSrÐ)rùr&rÎr´rµrëçsz(NDFrame.__getstate__.<locals>.<dictcomp>csi|]}|ˆj|“qSr´)rÒr&rÎr´rµrëís)r›r¨r r­r¡)r r›r¨r­rÒÚ_keys)r³Úmetar´rÎrµÚ __getstate__åsûúzNDFrame.__getstate__cCs(t|tƒr||_n
t|tƒrd|kr>d|kr>| d¡|d<| d¡}|dk    rþ| di¡}t |d|¡| dddi¡}t |dt|f|Ž¡t    |j
|j ƒ}t |ƒD]*}||kr¨|dkr¨||}t |||¡q¨|  ¡D]\}}||krÜt |||¡qÜntdƒ‚nt|ƒd    krtdƒ‚i|_dS)
NrÝr›r¨r¦r¡r¯Tz(Pre-0.12 pickles are no longer supportedr÷)r¿r{r›r²r5r%r°r±rrÚsetr¢r Úlistr½rÙrÀrœ)r³ÚstaterÈr­rÒr£rr    r´r´rµÚ __setstate__ñs.
 
 
 
zNDFrame.__setstate__cCs.dd tt|ƒ¡›d}t|ƒj›d|›dS)Nú[ú,ú]ú(ú))ÚjoinÚmaprŽr`rÚ)r³Zpreprr´r´rµÚ__repr__szNDFrame.__repr__cCst d¡dkr| ¡SdSdS)z•
        Returns a LaTeX representation for a particular object.
        Mainly for use with nbconvert (jupyter notebook conversion to pdf).
        zstyler.render.reprÚlatexN)rÚ
get_optionÚto_latexrÎr´r´rµÚ _repr_latex_szNDFrame._repr_latex_cCsBt d¡r>| t d¡¡}|jdd}tt|ƒ}t|tjdSdS)zh
        Not a real Jupyter special repr method, but we use the same
        naming convention.
        zdisplay.html.table_schemazdisplay.max_rowsÚtable)Úorient)Úobject_pairs_hookN)    rr²ÚheadÚto_jsonrr§rÚ collectionsÚ OrderedDict)r³r«Zas_jsonr´r´rµÚ_repr_data_resource_)s
 
 
zNDFrame._repr_data_resource_Ústorage_optionsz1.2.0)r—r½Zstorage_options_versionaddedÚSheet1rˆÚinfz
str | NonezSequence[Hashable] | NonezSequence[Hashable] | bool_tztuple[int, int] | Noner8)Ú
sheet_nameÚna_repÚ float_formatröÚheaderrÞÚ index_labelÚstartrowÚstartcolÚengineÚ merge_cellsÚinf_repÚ freeze_panesr½r®c CsXt|tƒr|n| ¡}ddlm}||||||||| | d    }|j|||    |
|| |ddS)aG
        Write {klass} to an Excel sheet.
 
        To write a single {klass} to an Excel .xlsx file it is only necessary to
        specify a target file name. To write to multiple sheets it is necessary to
        create an `ExcelWriter` object with a target file name, and specify a sheet
        in the file to write to.
 
        Multiple sheets may be written to by specifying unique `sheet_name`.
        With all data written to the file it is necessary to save the changes.
        Note that creating an `ExcelWriter` object with a file name that already
        exists will result in the contents of the existing file being erased.
 
        Parameters
        ----------
        excel_writer : path-like, file-like, or ExcelWriter object
            File path or existing ExcelWriter.
        sheet_name : str, default 'Sheet1'
            Name of sheet which will contain DataFrame.
        na_rep : str, default ''
            Missing data representation.
        float_format : str, optional
            Format string for floating point numbers. For example
            ``float_format="%.2f"`` will format 0.1234 to 0.12.
        columns : sequence or list of str, optional
            Columns to write.
        header : bool or list of str, default True
            Write out the column names. If a list of string is given it is
            assumed to be aliases for the column names.
        index : bool, default True
            Write row names (index).
        index_label : str or sequence, optional
            Column label for index column(s) if desired. If not specified, and
            `header` and `index` are True, then the index names are used. A
            sequence should be given if the DataFrame uses MultiIndex.
        startrow : int, default 0
            Upper left cell row to dump data frame.
        startcol : int, default 0
            Upper left cell column to dump data frame.
        engine : str, optional
            Write engine to use, 'openpyxl' or 'xlsxwriter'. You can also set this
            via the options ``io.excel.xlsx.writer`` or
            ``io.excel.xlsm.writer``.
 
        merge_cells : bool, default True
            Write MultiIndex and Hierarchical Rows as merged cells.
        inf_rep : str, default 'inf'
            Representation for infinity (there is no native representation for
            infinity in Excel).
        freeze_panes : tuple of int (length 2), optional
            Specifies the one-based bottommost row and rightmost column that
            is to be frozen.
        {storage_options}
 
            .. versionadded:: {storage_options_versionadded}
 
        See Also
        --------
        to_csv : Write DataFrame to a comma-separated values (csv) file.
        ExcelWriter : Class for writing DataFrame objects into excel sheets.
        read_excel : Read an Excel file into a pandas DataFrame.
        read_csv : Read a comma-separated values (csv) file into DataFrame.
        io.formats.style.Styler.to_excel : Add styles to Excel sheet.
 
        Notes
        -----
        For compatibility with :meth:`~DataFrame.to_csv`,
        to_excel serializes lists and dicts to strings before writing.
 
        Once a workbook has been saved it is not possible to write further
        data without rewriting the whole workbook.
 
        Examples
        --------
 
        Create, write to and save a workbook:
 
        >>> df1 = pd.DataFrame([['a', 'b'], ['c', 'd']],
        ...                    index=['row 1', 'row 2'],
        ...                    columns=['col 1', 'col 2'])
        >>> df1.to_excel("output.xlsx")  # doctest: +SKIP
 
        To specify the sheet name:
 
        >>> df1.to_excel("output.xlsx",
        ...              sheet_name='Sheet_name_1')  # doctest: +SKIP
 
        If you wish to write to more than one sheet in the workbook, it is
        necessary to specify an ExcelWriter object:
 
        >>> df2 = df1.copy()
        >>> with pd.ExcelWriter('output.xlsx') as writer:  # doctest: +SKIP
        ...     df1.to_excel(writer, sheet_name='Sheet_name_1')
        ...     df2.to_excel(writer, sheet_name='Sheet_name_2')
 
        ExcelWriter can also be used to append to an existing Excel file:
 
        >>> with pd.ExcelWriter('output.xlsx',
        ...                     mode='a') as writer:  # doctest: +SKIP
        ...     df.to_excel(writer, sheet_name='Sheet_name_3')
 
        To set the library that is used to write the Excel file,
        you can pass the `engine` keyword (the default engine is
        automatically chosen depending on the file extension):
 
        >>> df1.to_excel('output1.xlsx', engine='xlsxwriter')  # doctest: +SKIP
        r)ÚExcelFormatter)rÁÚcolsrÃrÂrÞrÄrÈrÉ)rÀrÅrÆrÊrÇr½N)r¿rbÚto_frameZpandas.io.formats.excelrËÚwrite)r³Z excel_writerrÀrÁrÂrörÃrÞrÄrÅrÆrÇrÈrÉrÊr½rÕrËÚ    formatterr´r´rµÚto_excel9s. ÷ ùzNDFrame.to_excelÚcompression_optionsÚ path_or_buf)r½rÑé
ÚmsÚinferÚwz7FilePath | WriteBuffer[bytes] | WriteBuffer[str] | Nonez(Callable[[Any], JSONSerializable] | Noner!z
int | NonezLiteral[('a', 'w')])rÒr¶Ú date_formatÚdouble_precisionÚ force_asciiÚ    date_unitÚdefault_handlerÚlinesÚ compressionrÞÚindentr½Úmoder®cCsfddlm}|dkr"|dkr"d}n |dkr.d}t | ¡| p>d} |j||||||||||    |
| | | dS)a»
        Convert the object to a JSON string.
 
        Note NaN's and None will be converted to null and datetime objects
        will be converted to UNIX timestamps.
 
        Parameters
        ----------
        path_or_buf : str, path object, file-like object, or None, default None
            String, path object (implementing os.PathLike[str]), or file-like
            object implementing a write() function. If None, the result is
            returned as a string.
        orient : str
            Indication of expected JSON string format.
 
            * Series:
 
                - default is 'index'
                - allowed values are: {{'split', 'records', 'index', 'table'}}.
 
            * DataFrame:
 
                - default is 'columns'
                - allowed values are: {{'split', 'records', 'index', 'columns',
                  'values', 'table'}}.
 
            * The format of the JSON string:
 
                - 'split' : dict like {{'index' -> [index], 'columns' -> [columns],
                  'data' -> [values]}}
                - 'records' : list like [{{column -> value}}, ... , {{column -> value}}]
                - 'index' : dict like {{index -> {{column -> value}}}}
                - 'columns' : dict like {{column -> {{index -> value}}}}
                - 'values' : just the values array
                - 'table' : dict like {{'schema': {{schema}}, 'data': {{data}}}}
 
                Describing the data, where data component is like ``orient='records'``.
 
        date_format : {{None, 'epoch', 'iso'}}
            Type of date conversion. 'epoch' = epoch milliseconds,
            'iso' = ISO8601. The default depends on the `orient`. For
            ``orient='table'``, the default is 'iso'. For all other orients,
            the default is 'epoch'.
        double_precision : int, default 10
            The number of decimal places to use when encoding
            floating point values.
        force_ascii : bool, default True
            Force encoded string to be ASCII.
        date_unit : str, default 'ms' (milliseconds)
            The time unit to encode to, governs timestamp and ISO8601
            precision.  One of 's', 'ms', 'us', 'ns' for second, millisecond,
            microsecond, and nanosecond respectively.
        default_handler : callable, default None
            Handler to call if object cannot otherwise be converted to a
            suitable format for JSON. Should receive a single argument which is
            the object to convert and return a serialisable object.
        lines : bool, default False
            If 'orient' is 'records' write out line-delimited json format. Will
            throw ValueError if incorrect 'orient' since others are not
            list-like.
        {compression_options}
 
            .. versionchanged:: 1.4.0 Zstandard support.
 
        index : bool, default True
            Whether to include the index values in the JSON string. Not
            including the index (``index=False``) is only supported when
            orient is 'split' or 'table'.
        indent : int, optional
           Length of whitespace used to indent each record.
 
        {storage_options}
 
            .. versionadded:: 1.2.0
 
        mode : str, default 'w' (writing)
            Specify the IO mode for output when supplying a path_or_buf.
            Accepted args are 'w' (writing) and 'a' (append) only.
            mode='a' is only supported when lines is True and orient is 'records'.
 
        Returns
        -------
        None or str
            If path_or_buf is None, returns the resulting json format as a
            string. Otherwise returns None.
 
        See Also
        --------
        read_json : Convert a JSON string to pandas object.
 
        Notes
        -----
        The behavior of ``indent=0`` varies from the stdlib, which does not
        indent the output but does insert newlines. Currently, ``indent=0``
        and the default ``indent=None`` are equivalent in pandas, though this
        may change in a future release.
 
        ``orient='table'`` contains a 'pandas_version' field under 'schema'.
        This stores the version of `pandas` used in the latest revision of the
        schema.
 
        Examples
        --------
        >>> from json import loads, dumps
        >>> df = pd.DataFrame(
        ...     [["a", "b"], ["c", "d"]],
        ...     index=["row 1", "row 2"],
        ...     columns=["col 1", "col 2"],
        ... )
 
        >>> result = df.to_json(orient="split")
        >>> parsed = loads(result)
        >>> dumps(parsed, indent=4)  # doctest: +SKIP
        {{
            "columns": [
                "col 1",
                "col 2"
            ],
            "index": [
                "row 1",
                "row 2"
            ],
            "data": [
                [
                    "a",
                    "b"
                ],
                [
                    "c",
                    "d"
                ]
            ]
        }}
 
        Encoding/decoding a Dataframe using ``'records'`` formatted JSON.
        Note that index labels are not preserved with this encoding.
 
        >>> result = df.to_json(orient="records")
        >>> parsed = loads(result)
        >>> dumps(parsed, indent=4)  # doctest: +SKIP
        [
            {{
                "col 1": "a",
                "col 2": "b"
            }},
            {{
                "col 1": "c",
                "col 2": "d"
            }}
        ]
 
        Encoding/decoding a Dataframe using ``'index'`` formatted JSON:
 
        >>> result = df.to_json(orient="index")
        >>> parsed = loads(result)
        >>> dumps(parsed, indent=4)  # doctest: +SKIP
        {{
            "row 1": {{
                "col 1": "a",
                "col 2": "b"
            }},
            "row 2": {{
                "col 1": "c",
                "col 2": "d"
            }}
        }}
 
        Encoding/decoding a Dataframe using ``'columns'`` formatted JSON:
 
        >>> result = df.to_json(orient="columns")
        >>> parsed = loads(result)
        >>> dumps(parsed, indent=4)  # doctest: +SKIP
        {{
            "col 1": {{
                "row 1": "a",
                "row 2": "c"
            }},
            "col 2": {{
                "row 1": "b",
                "row 2": "d"
            }}
        }}
 
        Encoding/decoding a Dataframe using ``'values'`` formatted JSON:
 
        >>> result = df.to_json(orient="values")
        >>> parsed = loads(result)
        >>> dumps(parsed, indent=4)  # doctest: +SKIP
        [
            [
                "a",
                "b"
            ],
            [
                "c",
                "d"
            ]
        ]
 
        Encoding with Table Schema:
 
        >>> result = df.to_json(orient="table")
        >>> parsed = loads(result)
        >>> dumps(parsed, indent=4)  # doctest: +SKIP
        {{
            "schema": {{
                "fields": [
                    {{
                        "name": "index",
                        "type": "string"
                    }},
                    {{
                        "name": "col 1",
                        "type": "string"
                    }},
                    {{
                        "name": "col 2",
                        "type": "string"
                    }}
                ],
                "primaryKey": [
                    "index"
                ],
                "pandas_version": "1.4.0"
            }},
            "data": [
                {{
                    "index": "row 1",
                    "col 1": "a",
                    "col 2": "b"
                }},
                {{
                    "index": "row 2",
                    "col 1": "c",
                    "col 2": "d"
                }}
            ]
        }}
        r)ÚjsonNrµZisoÚepoch)rÒr r¶r×rØrÙrÚrÛrÜrÝrÞrÞr½rß)Ú    pandas.ioràrZis_nonnegative_intr¹)r³rÒr¶r×rØrÙrÚrÛrÜrÝrÞrÞr½rßràr´r´rµr¹Ös2 
òzNDFrame.to_jsonrÅÚstrictúUTF-8zFilePath | HDFStorezint | dict[str, int] | Nonez Literal[True] | list[str] | None)rÒrrßÚ    complevelÚcomplibÚappendÚformatrÞÚ min_itemsizeÚdropnaÚ data_columnsr<Úencodingr®cCs8ddlm}|j||||||||||    |
| | | |ddS)a~
        Write the contained data to an HDF5 file using HDFStore.
 
        Hierarchical Data Format (HDF) is self-describing, allowing an
        application to interpret the structure and contents of a file with
        no outside information. One HDF file can hold a mix of related objects
        which can be accessed as a group or as individual objects.
 
        In order to add another DataFrame or Series to an existing HDF file
        please use append mode and a different a key.
 
        .. warning::
 
           One can store a subclass of ``DataFrame`` or ``Series`` to HDF5,
           but the type of the subclass is lost upon storing.
 
        For more information see the :ref:`user guide <io.hdf5>`.
 
        Parameters
        ----------
        path_or_buf : str or pandas.HDFStore
            File path or HDFStore object.
        key : str
            Identifier for the group in the store.
        mode : {'a', 'w', 'r+'}, default 'a'
            Mode to open file:
 
            - 'w': write, a new file is created (an existing file with
              the same name would be deleted).
            - 'a': append, an existing file is opened for reading and
              writing, and if the file does not exist it is created.
            - 'r+': similar to 'a', but the file must already exist.
        complevel : {0-9}, default None
            Specifies a compression level for data.
            A value of 0 or None disables compression.
        complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib'
            Specifies the compression library to be used.
            As of v0.20.2 these additional compressors for Blosc are supported
            (default if no compressor specified: 'blosc:blosclz'):
            {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',
            'blosc:zlib', 'blosc:zstd'}.
            Specifying a compression library which is not available issues
            a ValueError.
        append : bool, default False
            For Table formats, append the input data to the existing.
        format : {'fixed', 'table', None}, default 'fixed'
            Possible values:
 
            - 'fixed': Fixed format. Fast writing/reading. Not-appendable,
              nor searchable.
            - 'table': Table format. Write as a PyTables Table structure
              which may perform worse but allow more flexible operations
              like searching / selecting subsets of the data.
            - If None, pd.get_option('io.hdf.default_format') is checked,
              followed by fallback to "fixed".
        index : bool, default True
            Write DataFrame index as a column.
        min_itemsize : dict or int, optional
            Map column names to minimum string sizes for columns.
        nan_rep : Any, optional
            How to represent null values as str.
            Not allowed with append=True.
        dropna : bool, default False, optional
            Remove missing values.
        data_columns : list of columns or True, optional
            List of columns to create as indexed data columns for on-disk
            queries, or True to use all columns. By default only the axes
            of the object are indexed. See
            :ref:`Query via data columns<io.hdf5-query-data-columns>`. for
            more information.
            Applicable only to format='table'.
        errors : str, default 'strict'
            Specifies how encoding and decoding errors are to be handled.
            See the errors argument for :func:`open` for a full list
            of options.
        encoding : str, default "UTF-8"
 
        See Also
        --------
        read_hdf : Read from HDF file.
        DataFrame.to_orc : Write a DataFrame to the binary orc format.
        DataFrame.to_parquet : Write a DataFrame to the binary parquet format.
        DataFrame.to_sql : Write to a SQL table.
        DataFrame.to_feather : Write out feather-format for DataFrames.
        DataFrame.to_csv : Write out to a csv file.
 
        Examples
        --------
        >>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]},
        ...                   index=['a', 'b', 'c'])  # doctest: +SKIP
        >>> df.to_hdf('data.h5', key='df', mode='w')  # doctest: +SKIP
 
        We can add another object to the same file:
 
        >>> s = pd.Series([1, 2, 3, 4])  # doctest: +SKIP
        >>> s.to_hdf('data.h5', key='s')  # doctest: +SKIP
 
        Reading from HDF file:
 
        >>> pd.read_hdf('data.h5', 'df')  # doctest: +SKIP
        A  B
        a  1  4
        b  2  5
        c  3  6
        >>> pd.read_hdf('data.h5', 's')  # doctest: +SKIP
        0    1
        1    2
        2    3
        3    4
        dtype: int64
        r)Úpytables) rßrårærçrèrÞréÚnan_reprêrër<rìN)râríÚto_hdf)r³rÒrrßrårærçrèrÞrérîrêrër<rìrír´r´rµrïõ    s& ñzNDFrame.to_hdfÚfailz&Literal[('fail', 'replace', 'append')]zDtypeArg | None)    rÿÚschemaÚ    if_existsrÞrÄÚ    chunksizer¸r,r®c
Cs*ddlm}
|
j||||||||||    d
S)aö
        Write records stored in a DataFrame to a SQL database.
 
        Databases supported by SQLAlchemy [1]_ are supported. Tables can be
        newly created, appended to, or overwritten.
 
        Parameters
        ----------
        name : str
            Name of SQL table.
        con : sqlalchemy.engine.(Engine or Connection) or sqlite3.Connection
            Using SQLAlchemy makes it possible to use any DB supported by that
            library. Legacy support is provided for sqlite3.Connection objects. The user
            is responsible for engine disposal and connection closure for the SQLAlchemy
            connectable. See `here                 <https://docs.sqlalchemy.org/en/20/core/connections.html>`_.
            If passing a sqlalchemy.engine.Connection which is already in a transaction,
            the transaction will not be committed.  If passing a sqlite3.Connection,
            it will not be possible to roll back the record insertion.
 
        schema : str, optional
            Specify the schema (if database flavor supports this). If None, use
            default schema.
        if_exists : {'fail', 'replace', 'append'}, default 'fail'
            How to behave if the table already exists.
 
            * fail: Raise a ValueError.
            * replace: Drop the table before inserting new values.
            * append: Insert new values to the existing table.
 
        index : bool, default True
            Write DataFrame index as a column. Uses `index_label` as the column
            name in the table.
        index_label : str or sequence, default None
            Column label for index column(s). If None is given (default) and
            `index` is True, then the index names are used.
            A sequence should be given if the DataFrame uses MultiIndex.
        chunksize : int, optional
            Specify the number of rows in each batch to be written at a time.
            By default, all rows will be written at once.
        dtype : dict or scalar, optional
            Specifying the datatype for columns. If a dictionary is used, the
            keys should be the column names and the values should be the
            SQLAlchemy types or strings for the sqlite3 legacy mode. If a
            scalar is provided, it will be applied to all columns.
        method : {None, 'multi', callable}, optional
            Controls the SQL insertion clause used:
 
            * None : Uses standard SQL ``INSERT`` clause (one per row).
            * 'multi': Pass multiple values in a single ``INSERT`` clause.
            * callable with signature ``(pd_table, conn, keys, data_iter)``.
 
            Details and a sample callable implementation can be found in the
            section :ref:`insert method <io.sql.method>`.
 
        Returns
        -------
        None or int
            Number of rows affected by to_sql. None is returned if the callable
            passed into ``method`` does not return an integer number of rows.
 
            The number of returned rows affected is the sum of the ``rowcount``
            attribute of ``sqlite3.Cursor`` or SQLAlchemy connectable which may not
            reflect the exact number of written rows as stipulated in the
            `sqlite3 <https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.rowcount>`__ or
            `SQLAlchemy <https://docs.sqlalchemy.org/en/20/core/connections.html#sqlalchemy.engine.CursorResult.rowcount>`__.
 
            .. versionadded:: 1.4.0
 
        Raises
        ------
        ValueError
            When the table already exists and `if_exists` is 'fail' (the
            default).
 
        See Also
        --------
        read_sql : Read a DataFrame from a table.
 
        Notes
        -----
        Timezone aware datetime columns will be written as
        ``Timestamp with timezone`` type with SQLAlchemy if supported by the
        database. Otherwise, the datetimes will be stored as timezone unaware
        timestamps local to the original timezone.
 
        References
        ----------
        .. [1] https://docs.sqlalchemy.org
        .. [2] https://www.python.org/dev/peps/pep-0249/
 
        Examples
        --------
        Create an in-memory SQLite database.
 
        >>> from sqlalchemy import create_engine
        >>> engine = create_engine('sqlite://', echo=False)
 
        Create a table from scratch with 3 rows.
 
        >>> df = pd.DataFrame({'name' : ['User 1', 'User 2', 'User 3']})
        >>> df
             name
        0  User 1
        1  User 2
        2  User 3
 
        >>> df.to_sql('users', con=engine)
        3
        >>> from sqlalchemy import text
        >>> with engine.connect() as conn:
        ...    conn.execute(text("SELECT * FROM users")).fetchall()
        [(0, 'User 1'), (1, 'User 2'), (2, 'User 3')]
 
        An `sqlalchemy.engine.Connection` can also be passed to `con`:
 
        >>> with engine.begin() as connection:
        ...     df1 = pd.DataFrame({'name' : ['User 4', 'User 5']})
        ...     df1.to_sql('users', con=connection, if_exists='append')
        2
 
        This is allowed to support operations that require that the same
        DBAPI connection is used for the entire operation.
 
        >>> df2 = pd.DataFrame({'name' : ['User 6', 'User 7']})
        >>> df2.to_sql('users', con=engine, if_exists='append')
        2
        >>> with engine.connect() as conn:
        ...    conn.execute(text("SELECT * FROM users")).fetchall()
        [(0, 'User 1'), (1, 'User 2'), (2, 'User 3'),
         (0, 'User 4'), (1, 'User 5'), (0, 'User 6'),
         (1, 'User 7')]
 
        Overwrite the table with just ``df2``.
 
        >>> df2.to_sql('users', con=engine, if_exists='replace',
        ...            index_label='id')
        2
        >>> with engine.connect() as conn:
        ...    conn.execute(text("SELECT * FROM users")).fetchall()
        [(0, 'User 6'), (1, 'User 7')]
 
        Specify the dtype (especially useful for integers with missing values).
        Notice that while pandas is forced to store the data as floating point,
        the database supports nullable integers. When fetching the data with
        Python, we get back integer scalars.
 
        >>> df = pd.DataFrame({"A": [1, None, 2]})
        >>> df
             A
        0  1.0
        1  NaN
        2  2.0
 
        >>> from sqlalchemy.types import Integer
        >>> df.to_sql('integers', con=engine, index=False,
        ...           dtype={"A": Integer()})
        3
 
        >>> with engine.connect() as conn:
        ...   conn.execute(text("SELECT * FROM integers")).fetchall()
        [(1,), (None,), (2,)]
        r)Úsql)rñròrÞrÄrór¸r,)rârôÚto_sql) r³rÿÚconrñròrÞrÄrór¸r,rôr´r´rµrõŒ
s1 özNDFrame.to_sqlÚpathzFilePath | WriteBuffer[bytes])r÷rÝÚprotocolr½r®cCs"ddlm}||||||ddS)aà
        Pickle (serialize) object to file.
 
        Parameters
        ----------
        path : str, path object, or file-like object
            String, path object (implementing ``os.PathLike[str]``), or file-like
            object implementing a binary ``write()`` function. File path where
            the pickled object will be stored.
        {compression_options}
        protocol : int
            Int which indicates which protocol should be used by the pickler,
            default HIGHEST_PROTOCOL (see [1]_ paragraph 12.1.2). The possible
            values are 0, 1, 2, 3, 4, 5. A negative value for the protocol
            parameter is equivalent to setting its value to HIGHEST_PROTOCOL.
 
            .. [1] https://docs.python.org/3/library/pickle.html.
 
        {storage_options}
 
            .. versionadded:: 1.2.0
 
        See Also
        --------
        read_pickle : Load pickled pandas object (or any object) from file.
        DataFrame.to_hdf : Write DataFrame to an HDF5 file.
        DataFrame.to_sql : Write DataFrame to a SQL database.
        DataFrame.to_parquet : Write a DataFrame to the binary parquet format.
 
        Examples
        --------
        >>> original_df = pd.DataFrame({{"foo": range(5), "bar": range(5, 10)}})  # doctest: +SKIP
        >>> original_df  # doctest: +SKIP
           foo  bar
        0    0    5
        1    1    6
        2    2    7
        3    3    8
        4    4    9
        >>> original_df.to_pickle("./dummy.pkl")  # doctest: +SKIP
 
        >>> unpickled_df = pd.read_pickle("./dummy.pkl")  # doctest: +SKIP
        >>> unpickled_df  # doctest: +SKIP
           foo  bar
        0    0    5
        1    1    6
        2    2    7
        3    3    8
        4    4    9
        r)Ú    to_pickle)rÝrør½N)Zpandas.io.picklerù)r³r÷rÝrør½rùr´r´rµrùK s> ûzNDFrame.to_pickle)ÚexcelÚsepr®cKs(ddlm}|j|f||dœ|—ŽdS)aÜ
        Copy object to the system clipboard.
 
        Write a text representation of object to the system clipboard.
        This can be pasted into Excel, for example.
 
        Parameters
        ----------
        excel : bool, default True
            Produce output in a csv format for easy pasting into excel.
 
            - True, use the provided separator for csv pasting.
            - False, write a string representation of the object to the clipboard.
 
        sep : str, default ``'\t'``
            Field delimiter.
        **kwargs
            These parameters will be passed to DataFrame.to_csv.
 
        See Also
        --------
        DataFrame.to_csv : Write a DataFrame to a comma-separated values
            (csv) file.
        read_clipboard : Read text from clipboard and pass to read_csv.
 
        Notes
        -----
        Requirements for your platform.
 
          - Linux : `xclip`, or `xsel` (with `PyQt4` modules)
          - Windows : none
          - macOS : none
 
        This method uses the processes developed for the package `pyperclip`. A
        solution to render any output string format is given in the examples.
 
        Examples
        --------
        Copy the contents of a DataFrame to the clipboard.
 
        >>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
 
        >>> df.to_clipboard(sep=',')  # doctest: +SKIP
        ... # Wrote the following to the system clipboard:
        ... # ,A,B,C
        ... # 0,1,2,3
        ... # 1,4,5,6
 
        We can omit the index by passing the keyword `index` and setting
        it to false.
 
        >>> df.to_clipboard(sep=',', index=False)  # doctest: +SKIP
        ... # Wrote the following to the system clipboard:
        ... # A,B,C
        ... # 1,2,3
        ... # 4,5,6
 
        Using the original `pyperclip` package for any string output format.
 
        .. code-block:: python
 
           import pyperclip
           html = df.style.to_html()
           pyperclip.copy(html)
        r)Ú
clipboards)rúrûN)rârüÚ to_clipboard)r³rúrûrírür´r´rµrý“ sE zNDFrame.to_clipboardcCs.tdƒ}|jdkr|j |¡S|j |¡SdS)a*
        Return an xarray object from the pandas object.
 
        Returns
        -------
        xarray.DataArray or xarray.Dataset
            Data in the pandas structure converted to Dataset if the object is
            a DataFrame, or a DataArray if the object is a Series.
 
        See Also
        --------
        DataFrame.to_hdf : Write DataFrame to an HDF5 file.
        DataFrame.to_parquet : Write a DataFrame to the binary parquet format.
 
        Notes
        -----
        See the `xarray docs <https://xarray.pydata.org/en/stable/>`__
 
        Examples
        --------
        >>> df = pd.DataFrame([('falcon', 'bird', 389.0, 2),
        ...                    ('parrot', 'bird', 24.0, 2),
        ...                    ('lion', 'mammal', 80.5, 4),
        ...                    ('monkey', 'mammal', np.nan, 4)],
        ...                   columns=['name', 'class', 'max_speed',
        ...                            'num_legs'])
        >>> df
             name   class  max_speed  num_legs
        0  falcon    bird      389.0         2
        1  parrot    bird       24.0         2
        2    lion  mammal       80.5         4
        3  monkey  mammal        NaN         4
 
        >>> df.to_xarray()
        <xarray.Dataset>
        Dimensions:    (index: 4)
        Coordinates:
          * index      (index) int64 0 1 2 3
        Data variables:
            name       (index) object 'falcon' 'parrot' 'lion' 'monkey'
            class      (index) object 'bird' 'bird' 'mammal' 'mammal'
            max_speed  (index) float64 389.0 24.0 80.5 nan
            num_legs   (index) int64 2 2 4 4
 
        >>> df['max_speed'].to_xarray()
        <xarray.DataArray 'max_speed' (index: 4)>
        array([389. ,  24. ,  80.5,   nan])
        Coordinates:
          * index    (index) int64 0 1 2 3
 
        >>> dates = pd.to_datetime(['2018-01-01', '2018-01-01',
        ...                         '2018-01-02', '2018-01-02'])
        >>> df_multiindex = pd.DataFrame({'date': dates,
        ...                               'animal': ['falcon', 'parrot',
        ...                                          'falcon', 'parrot'],
        ...                               'speed': [350, 18, 361, 15]})
        >>> df_multiindex = df_multiindex.set_index(['date', 'animal'])
 
        >>> df_multiindex
                           speed
        date       animal
        2018-01-01 falcon    350
                   parrot     18
        2018-01-02 falcon    361
                   parrot     15
 
        >>> df_multiindex.to_xarray()
        <xarray.Dataset>
        Dimensions:  (date: 2, animal: 2)
        Coordinates:
          * date     (date) datetime64[ns] 2018-01-01 2018-01-02
          * animal   (animal) object 'falcon' 'parrot'
        Data variables:
            speed    (date, animal) int64 350 18 361 15
        Úxarrayr»N)rBrøZ    DataArrayZ from_seriesZDatasetZfrom_dataframe)r³rþr´r´rµÚ    to_xarrayÜ sM
 zNDFrame.to_xarrayzbool_t | Sequence[str]zFormattersType | NonezFloatFormatType | Nonezstr | tuple[str, str] | None)ÚbufrörÃrÞrÁÚ
formattersrÂÚsparsifyÚ index_namesÚ    bold_rowsÚ column_formatÚ    longtableÚescaperìÚdecimalÚ multicolumnÚmulticolumn_formatÚmultirowÚcaptionrAÚpositionr®cCsdSrÐr´©r³rrörÃrÞrÁrrÂrrrrrrrìrr    r
r r rAr r´r´rµr³0 szNDFrame.to_latexzFilePath | WriteBuffer[str]cCsdSrÐr´rr´r´rµr³K sÚNaNÚ.z"FilePath | WriteBuffer[str] | Nonec#s4|jdkr| ¡}| dkr(t d¡dk} | dkr>t d¡dk} |dkrPt d¡}|dkrbt d¡}|dkrtt d    ¡}| dk    rŽt| tƒsŽtd
ƒ‚ˆdkr t|jƒntˆƒ}t|t    t
fƒrÜt|ƒ|krÜtd |›d t|ƒ›d ƒ‚|| rædnd|dœ}ddi|–}ddi|–}tˆtƒr"‡fdd„‰nˆ‰‡fdd„‰d}tˆt    ƒr^‡‡fdd„t |jƒDƒ}n´tˆt ƒr dd¡}ˆ  dd¡}|dk    rš| d|i¡|dk    r²| d|i¡ˆ}|jddj}|D]"}|ˆ ¡krÈ| |ˆi¡qÈn$ˆdkrˆdk    rtˆdd„d}||g}g} g}!ˆrH|  ‡fdd„|jDƒd d!œ¡|d"krb|  dd i¡n&t|t    t
fƒrˆ|! |d d#œ¡|g}|d"kr |  dd$i¡|    d"krº|  d%d$d&œ¡d%||| rÊdnd|rÖ|nd'|›|rèd(nd)||||| |r t|jtƒr d*nd|
d+œ }"|j|| |!d|i|–||"d,S)-a6
        Render object to a LaTeX tabular, longtable, or nested table.
 
        Requires ``\usepackage{{booktabs}}``.  The output can be copy/pasted
        into a main LaTeX document or read from an external file
        with ``\input{{table.tex}}``.
 
        .. versionchanged:: 1.2.0
           Added position argument, changed meaning of caption argument.
 
        .. versionchanged:: 2.0.0
           Refactored to use the Styler implementation via jinja2 templating.
 
        Parameters
        ----------
        buf : str, Path or StringIO-like, optional, default None
            Buffer to write to. If None, the output is returned as a string.
        columns : list of label, optional
            The subset of columns to write. Writes all columns by default.
        header : bool or list of str, default True
            Write out the column names. If a list of strings is given,
            it is assumed to be aliases for the column names.
        index : bool, default True
            Write row names (index).
        na_rep : str, default 'NaN'
            Missing data representation.
        formatters : list of functions or dict of {{str: function}}, optional
            Formatter functions to apply to columns' elements by position or
            name. The result of each function must be a unicode string.
            List must be of length equal to the number of columns.
        float_format : one-parameter function or str, optional, default None
            Formatter for floating point numbers. For example
            ``float_format="%.2f"`` and ``float_format="{{:0.2f}}".format`` will
            both result in 0.1234 being formatted as 0.12.
        sparsify : bool, optional
            Set to False for a DataFrame with a hierarchical index to print
            every multiindex key at each row. By default, the value will be
            read from the config module.
        index_names : bool, default True
            Prints the names of the indexes.
        bold_rows : bool, default False
            Make the row labels bold in the output.
        column_format : str, optional
            The columns format as specified in `LaTeX table format
            <https://en.wikibooks.org/wiki/LaTeX/Tables>`__ e.g. 'rcl' for 3
            columns. By default, 'l' will be used for all columns except
            columns of numbers, which default to 'r'.
        longtable : bool, optional
            Use a longtable environment instead of tabular. Requires
            adding a \usepackage{{longtable}} to your LaTeX preamble.
            By default, the value will be read from the pandas config
            module, and set to `True` if the option ``styler.latex.environment`` is
            `"longtable"`.
 
            .. versionchanged:: 2.0.0
               The pandas option affecting this argument has changed.
        escape : bool, optional
            By default, the value will be read from the pandas config
            module and set to `True` if the option ``styler.format.escape`` is
            `"latex"`. When set to False prevents from escaping latex special
            characters in column names.
 
            .. versionchanged:: 2.0.0
               The pandas option affecting this argument has changed, as has the
               default value to `False`.
        encoding : str, optional
            A string representing the encoding to use in the output file,
            defaults to 'utf-8'.
        decimal : str, default '.'
            Character recognized as decimal separator, e.g. ',' in Europe.
        multicolumn : bool, default True
            Use \multicolumn to enhance MultiIndex columns.
            The default will be read from the config module, and is set
            as the option ``styler.sparse.columns``.
 
            .. versionchanged:: 2.0.0
               The pandas option affecting this argument has changed.
        multicolumn_format : str, default 'r'
            The alignment for multicolumns, similar to `column_format`
            The default will be read from the config module, and is set as the option
            ``styler.latex.multicol_align``.
 
            .. versionchanged:: 2.0.0
               The pandas option affecting this argument has changed, as has the
               default value to "r".
        multirow : bool, default True
            Use \multirow to enhance MultiIndex rows. Requires adding a
            \usepackage{{multirow}} to your LaTeX preamble. Will print
            centered labels (instead of top-aligned) across the contained
            rows, separating groups via clines. The default will be read
            from the pandas config module, and is set as the option
            ``styler.sparse.index``.
 
            .. versionchanged:: 2.0.0
               The pandas option affecting this argument has changed, as has the
               default value to `True`.
        caption : str or tuple, optional
            Tuple (full_caption, short_caption),
            which results in ``\caption[short_caption]{{full_caption}}``;
            if a single string is passed, no short caption will be set.
 
            .. versionchanged:: 1.2.0
               Optionally allow caption to be a tuple ``(full_caption, short_caption)``.
 
        label : str, optional
            The LaTeX label to be placed inside ``\label{{}}`` in the output.
            This is used with ``\ref{{}}`` in the main ``.tex`` file.
 
        position : str, optional
            The LaTeX positional argument for tables, to be placed after
            ``\begin{{}}`` in the output.
 
            .. versionadded:: 1.2.0
 
        Returns
        -------
        str or None
            If buf is None, returns the result as a string. Otherwise returns None.
 
        See Also
        --------
        io.formats.style.Styler.to_latex : Render a DataFrame to LaTeX
            with conditional formatting.
        DataFrame.to_string : Render a DataFrame to a console-friendly
            tabular output.
        DataFrame.to_html : Render a DataFrame as an HTML table.
 
        Notes
        -----
        As of v2.0.0 this method has changed to use the Styler implementation as
        part of :meth:`.Styler.to_latex` via ``jinja2`` templating. This means
        that ``jinja2`` is a requirement, and needs to be installed, for this method
        to function. It is advised that users switch to using Styler, since that
        implementation is more frequently updated and contains much more
        flexibility with the output.
 
        Examples
        --------
        Convert a general DataFrame to LaTeX with formatting:
 
        >>> df = pd.DataFrame(dict(name=['Raphael', 'Donatello'],
        ...                        age=[26, 45],
        ...                        height=[181.23, 177.65]))
        >>> print(df.to_latex(index=False,
        ...                   formatters={"name": str.upper},
        ...                   float_format="{:.1f}".format,
        ... ))  # doctest: +SKIP
        \begin{tabular}{lrr}
        \toprule
        name & age & height \\
        \midrule
        RAPHAEL & 26 & 181.2 \\
        DONATELLO & 45 & 177.7 \\
        \bottomrule
        \end{tabular}
        r»Nzstyler.latex.environmentrzstyler.format.escaper±zstyler.sparse.columnszstyler.latex.multicol_alignzstyler.sparse.indexz&`column_format` must be str or unicodezWriting z cols but got z aliases)rÁrrrºrcsˆ|SrÐr´©Úx)rÂr´rµÚ<lambda>9 óz"NDFrame.to_latex.<locals>.<lambda>cs*t|ttfƒrˆdk    rˆ|ƒS||ƒSdSrÐ)r¿ÚfloatÚcomplex)rÚ alt_format_)Ú float_format_r´rµÚ_wrap= szNDFrame.to_latex.<locals>._wrapcs"i|]\}}|tˆˆ|d“qS)©rr)rêrþÚc)rrr´rµrëE sÿz$NDFrame.to_latex.<locals>.<dictcomp>Ú    __index__Z __columns__rÏr)ÚincludecSs|SrÐr´©r    r´r´rµrW rrcsg|]}|ˆkr|‘qSr´r´©rêr)rör´rµr` sz$NDFrame.to_latex.<locals>.<listcomp>rö)ÚsubsetrºF)rrºrÞT)rûrºznaive-ÚtZnaivezskip-last;data) ZhrulesZ sparse_indexZsparse_columnsÚ environmentZmulticol_alignZmultirow_alignrìr rAr rZclinesr©ÚhideÚ relabel_indexrèÚ format_indexÚ render_kwargs)rørÍrr²r¿r§rñrÀrör¦rrúr²r5rìZ select_dtypesrrrçrÞruÚ_to_latex_via_styler)#r³rrörÃrÞrÁrrÂrrrrrrrìrr    r
r r rAr ÚlengthZ base_format_Z index_format_Zcolumn_format_Z formatters_Zindex_formatterZcolumn_formatterZ float_columnsÚcolZ format_index_Zhide_Zrelabel_index_Zrender_kwargs_r´)rrörÂrrrµr³f sº7
 
 
 
 
ý      þ   
 
þÿ
 
 
 ÿ ÿ
ÿï
úr#zdict | list[dict] | Nonez dict | Nonec Cs²ddlm}td|ƒ}||dd}dD]N}    tƒ|    }
t|
tƒrPt||    ƒf|
Žq&t|
tƒr&|
D]} t||    ƒf| Žq^q&|dkr‚in|}| d¡rž|     d    d
„¡|j
fd |i|—ŽS) a"
        Render object to a LaTeX tabular, longtable, or nested table.
 
        Uses the ``Styler`` implementation with the following, ordered, method chaining:
 
        .. code-block:: python
           styler = Styler(DataFrame)
           styler.hide(**hide)
           styler.relabel_index(**relabel_index)
           styler.format(**format)
           styler.format_index(**format_index)
           styler.to_latex(buf=buf, **render_kwargs)
 
        Parameters
        ----------
        buf : str, Path or StringIO-like, optional, default None
            Buffer to write to. If None, the output is returned as a string.
        hide : dict, list of dict
            Keyword args to pass to the method call of ``Styler.hide``. If a list will
            call the method numerous times.
        relabel_index : dict, list of dict
            Keyword args to pass to the method of ``Styler.relabel_index``. If a list
            will call the method numerous times.
        format : dict, list of dict
            Keyword args to pass to the method call of ``Styler.format``. If a list will
            call the method numerous times.
        format_index : dict, list of dict
            Keyword args to pass to the method call of ``Styler.format_index``. If a
            list will call the method numerous times.
        render_kwargs : dict
            Keyword args to pass to the method call of ``Styler.to_latex``.
 
        Returns
        -------
        str or None
            If buf is None, returns the result as a string. Otherwise returns None.
        r)ÚStylerrrˆ)Úuuid)r$r%rèr&NrcSsdS)Nztextbf:--rwrap;r´rr´r´rµrË rz.NDFrame._to_latex_via_styler.<locals>.<lambda>r) Zpandas.io.formats.styler+rÚvarsr¿r²rùr¦r5Zapplymap_indexr³) r³rr$r%rèr&r'r+ZstylerZkw_nameÚkwZsub_kwr´r´rµr(Œ s/ 
 
 
 
 
zNDFrame._to_latex_via_stylerzstr | Callable | Nonezbool_t | list[str]zIndexLabel | None)rÒrûrÁrÂrörÃrÞrÄrßrìrÝÚquotingÚ    quotecharÚlineterminatorrór×Ú doublequoteÚ
escapecharrr<r½r®cCsdSrÐr´©r³rÒrûrÁrÂrörÃrÞrÄrßrìrÝr/r0r1rór×r2r3rr<r½r´r´rµÚto_csvÏ szNDFrame.to_csvz0FilePath | WriteBuffer[bytes] | WriteBuffer[str]cCsdSrÐr´r4r´r´rµr5ê srªú"cCsXt|tƒr|n| ¡}t||||||d}t|ƒj||||
|| | |||    || ||||dS)aÈ
        Write object to a comma-separated values (csv) file.
 
        Parameters
        ----------
        path_or_buf : str, path object, file-like object, or None, default None
            String, path object (implementing os.PathLike[str]), or file-like
            object implementing a write() function. If None, the result is
            returned as a string. If a non-binary file object is passed, it should
            be opened with `newline=''`, disabling universal newlines. If a binary
            file object is passed, `mode` might need to contain a `'b'`.
 
            .. versionchanged:: 1.2.0
 
               Support for binary file objects was introduced.
 
        sep : str, default ','
            String of length 1. Field delimiter for the output file.
        na_rep : str, default ''
            Missing data representation.
        float_format : str, Callable, default None
            Format string for floating point numbers. If a Callable is given, it takes
            precedence over other numeric formatting parameters, like decimal.
        columns : sequence, optional
            Columns to write.
        header : bool or list of str, default True
            Write out the column names. If a list of strings is given it is
            assumed to be aliases for the column names.
        index : bool, default True
            Write row names (index).
        index_label : str or sequence, or False, default None
            Column label for index column(s) if desired. If None is given, and
            `header` and `index` are True, then the index names are used. A
            sequence should be given if the object uses MultiIndex. If
            False do not print fields for index names. Use index_label=False
            for easier importing in R.
        mode : str, default 'w'
            Python write mode. The available write modes are the same as
            :py:func:`open`.
        encoding : str, optional
            A string representing the encoding to use in the output file,
            defaults to 'utf-8'. `encoding` is not supported if `path_or_buf`
            is a non-binary file object.
        {compression_options}
 
            .. versionchanged:: 1.0.0
 
               May now be a dict with key 'method' as compression mode
               and other entries as additional compression options if
               compression mode is 'zip'.
 
            .. versionchanged:: 1.1.0
 
               Passing compression options as keys in dict is
               supported for compression modes 'gzip', 'bz2', 'zstd', and 'zip'.
 
            .. versionchanged:: 1.2.0
 
                Compression is supported for binary file objects.
 
            .. versionchanged:: 1.2.0
 
                Previous versions forwarded dict entries for 'gzip' to
                `gzip.open` instead of `gzip.GzipFile` which prevented
                setting `mtime`.
 
        quoting : optional constant from csv module
            Defaults to csv.QUOTE_MINIMAL. If you have set a `float_format`
            then floats are converted to strings and thus csv.QUOTE_NONNUMERIC
            will treat them as non-numeric.
        quotechar : str, default '\"'
            String of length 1. Character used to quote fields.
        lineterminator : str, optional
            The newline character or character sequence to use in the output
            file. Defaults to `os.linesep`, which depends on the OS in which
            this method is called ('\\n' for linux, '\\r\\n' for Windows, i.e.).
 
            .. versionchanged:: 1.5.0
 
                Previously was line_terminator, changed for consistency with
                read_csv and the standard library 'csv' module.
 
        chunksize : int or None
            Rows to write at a time.
        date_format : str, default None
            Format string for datetime objects.
        doublequote : bool, default True
            Control quoting of `quotechar` inside a field.
        escapechar : str, default None
            String of length 1. Character used to escape `sep` and `quotechar`
            when appropriate.
        decimal : str, default '.'
            Character recognized as decimal separator. E.g. use ',' for
            European data.
        errors : str, default 'strict'
            Specifies how encoding and decoding errors are to be handled.
            See the errors argument for :func:`open` for a full list
            of options.
 
            .. versionadded:: 1.1.0
 
        {storage_options}
 
            .. versionadded:: 1.2.0
 
        Returns
        -------
        None or str
            If path_or_buf is None, returns the resulting csv format as a
            string. Otherwise returns None.
 
        See Also
        --------
        read_csv : Load a CSV file into a DataFrame.
        to_excel : Write DataFrame to an Excel file.
 
        Examples
        --------
        >>> df = pd.DataFrame({{'name': ['Raphael', 'Donatello'],
        ...                    'mask': ['red', 'purple'],
        ...                    'weapon': ['sai', 'bo staff']}})
        >>> df.to_csv(index=False)
        'name,mask,weapon\nRaphael,red,sai\nDonatello,purple,bo staff\n'
 
        Create 'out.zip' containing 'out.csv'
 
        >>> compression_opts = dict(method='zip',
        ...                         archive_name='out.csv')  # doctest: +SKIP
        >>> df.to_csv('out.zip', index=False,
        ...           compression=compression_opts)  # doctest: +SKIP
 
        To write a csv file to a new folder or nested folder you will first
        need to create it using either Pathlib or os:
 
        >>> from pathlib import Path  # doctest: +SKIP
        >>> filepath = Path('folder/subfolder/out.csv')  # doctest: +SKIP
        >>> filepath.parent.mkdir(parents=True, exist_ok=True)  # doctest: +SKIP
        >>> df.to_csv(filepath)  # doctest: +SKIP
 
        >>> import os  # doctest: +SKIP
        >>> os.makedirs('folder/subfolder', exist_ok=True)  # doctest: +SKIP
        >>> df.to_csv('folder/subfolder/out.csv')  # doctest: +SKIP
        )ÚframerÃrÞrÁrÂr)r1rûrìr<rÝr/rörÄrßrór0r×r2r3r½)r¿rbrÍrŒrr5)r³rÒrûrÁrÂrörÃrÞrÄrßrìrÝr/r0r1rór×r2r3rr<r½rÕrÏr´r´rµr5s8-ú    ðcCs t|ƒ‚dS)z#
        Reset the cacher.
        NrÜrÎr´r´rµÚ _reset_cacherÒszNDFrame._reset_cacher)ÚclearÚverify_is_copyr˜r®cCs*tƒr
dS|r|jdd|r&| ¡dS)a!
        See if we need to update our parent cacher if clear, then clear our
        cache.
 
        Parameters
        ----------
        clear : bool, default False
            Clear the item cache.
        verify_is_copy : bool, default True
            Provide is_copy checks.
        NÚreferent©r!)rÚ_check_setitem_copyr!)r³r9r:r˜r´r´rµÚ_maybe_update_cacherØs  zNDFrame._maybe_update_cachercCs t|ƒ‚dSrÐrÜrÎr´r´rµr!òszNDFrame._clear_item_cache)r³rºr®cKst d|¡| ||¡S)aÀ
 
        Return the elements in the given *positional* indices along an axis.
 
        This means that we are not indexing according to actual values in
        the index attribute of the object. We are indexing according to the
        actual position of the element in the object.
 
        Parameters
        ----------
        indices : array-like
            An array of ints indicating which positions to take.
        axis : {0 or 'index', 1 or 'columns', None}, default 0
            The axis on which to select elements. ``0`` means that we are
            selecting rows, ``1`` means that we are selecting columns.
            For `Series` this parameter is unused and defaults to 0.
        **kwargs
            For compatibility with :meth:`numpy.take`. Has no effect on the
            output.
 
        Returns
        -------
        same type as caller
            An array-like containing the elements taken from the object.
 
        See Also
        --------
        DataFrame.loc : Select a subset of a DataFrame by labels.
        DataFrame.iloc : Select a subset of a DataFrame by positions.
        numpy.take : Take elements from an array along an axis.
 
        Examples
        --------
        >>> df = pd.DataFrame([('falcon', 'bird', 389.0),
        ...                    ('parrot', 'bird', 24.0),
        ...                    ('lion', 'mammal', 80.5),
        ...                    ('monkey', 'mammal', np.nan)],
        ...                   columns=['name', 'class', 'max_speed'],
        ...                   index=[0, 2, 3, 1])
        >>> df
             name   class  max_speed
        0  falcon    bird      389.0
        2  parrot    bird       24.0
        3    lion  mammal       80.5
        1  monkey  mammal        NaN
 
        Take elements at positions 0 and 3 along the axis 0 (default).
 
        Note how the actual indices selected (0 and 1) do not correspond to
        our selected indices 0 and 3. That's because we are selecting the 0th
        and 3rd rows, not rows whose indices equal 0 and 3.
 
        >>> df.take([0, 3])
             name   class  max_speed
        0  falcon    bird      389.0
        1  monkey  mammal        NaN
 
        Take elements at indices 1 and 2 along the axis 1 (column selection).
 
        >>> df.take([1, 2], axis=1)
            class  max_speed
        0    bird      389.0
        2    bird       24.0
        3  mammal       80.5
        1  mammal        NaN
 
        We may take elements using negative integers for positive indices,
        starting from the end of the object, just like with Python lists.
 
        >>> df.take([-1, -2])
             name   class  max_speed
        1  monkey  mammal        NaN
        3    lion  mammal       80.5
        r´)ÚnvZ validate_takeÚ_take)r³Úindicesrºrír´r´rµÚtakeøsK z NDFrame.take)r³rºÚconvert_indicesr®cCszt|tƒsLtj|tjd}|dkrL|jdkrLtƒrLt|t|ƒƒrL|j    ddS|j
j ||  |¡d|d}|  |¡j|dd    S)
        Internal version of the `take` allowing specification of additional args.
 
        See the docstring of `take` for full explanation of the parameters.
        r¼rr»NrÓT)rºÚverifyrCrBr+)r¿r7rr›ZintprørrrÀr¬r›rBr¾rÉrÊ)r³rArºrCrjr´r´rµr@Gs$
ÿþý ü üz NDFrame._takecCs2|j||d}| |¡ | |¡¡s.| |¡|S)a
        Internal version of the `take` method that sets the `_is_copy`
        attribute to keep track of the parent dataframe (using in indexing
        for the SettingWithCopyWarning).
 
        See the docstring of `take` for full explanation of the parameters.
        )rArº)r@rèrZÚ _set_is_copy)r³rArºr4r´r´rµÚ_take_with_is_copyds
zNDFrame._take_with_is_copy)r³rrºrÚ
drop_levelr®cCs| |¡}| |¡}t|tƒr&tdƒ‚|dk    r”t|tƒs@tdƒ‚|j|||d\}}tdƒg|j}|||<t    |ƒ}    |j
|    }
t |
|
  |¡|ƒ|
S|dkr°|r¨||S|j } n|j} t| tƒrü| j|dd\}} |sút |¡rò| ||d…} n| |} n^|  |¡}t|tjƒrH|jtjkr:| ¡\} |j| |dS|j||dSt|ƒsZ| |} t|ƒr¬|dkr¬|jdkr„|j|S|j |¡}|j||j|d     |¡}
nVt|ƒrÔ|j
dd…t||dƒf}
n.|dkrò|j
dd…|f}
n|j
|}
| |
_|
j||
j  d
|
S) aQ
        Return cross-section from the Series/DataFrame.
 
        This method takes a `key` argument to select data at a particular
        level of a MultiIndex.
 
        Parameters
        ----------
        key : label or tuple of label
            Label contained in the index, or partially in a MultiIndex.
        axis : {0 or 'index', 1 or 'columns'}, default 0
            Axis to retrieve cross-section on.
        level : object, defaults to first n levels (n=1 or len(key))
            In case of a key partially contained in a MultiIndex, indicate
            which levels are used. Levels can be referred by label or position.
        drop_level : bool, default True
            If False, returns object with same levels as self.
 
        Returns
        -------
        Series or DataFrame
            Cross-section from the original Series or DataFrame
            corresponding to the selected index levels.
 
        See Also
        --------
        DataFrame.loc : Access a group of rows and columns
            by label(s) or a boolean array.
        DataFrame.iloc : Purely integer-location based indexing
            for selection by position.
 
        Notes
        -----
        `xs` can not be used to set values.
 
        MultiIndex Slicers is a generic way to get/set values on
        any level or levels.
        It is a superset of `xs` functionality, see
        :ref:`MultiIndex Slicers <advanced.mi_slicers>`.
 
        Examples
        --------
        >>> d = {'num_legs': [4, 4, 2, 2],
        ...      'num_wings': [0, 0, 2, 2],
        ...      'class': ['mammal', 'mammal', 'mammal', 'bird'],
        ...      'animal': ['cat', 'dog', 'bat', 'penguin'],
        ...      'locomotion': ['walks', 'walks', 'flies', 'walks']}
        >>> df = pd.DataFrame(data=d)
        >>> df = df.set_index(['class', 'animal', 'locomotion'])
        >>> df
                                   num_legs  num_wings
        class  animal  locomotion
        mammal cat     walks              4          0
               dog     walks              4          0
               bat     flies              2          2
        bird   penguin walks              2          2
 
        Get values at specified index
 
        >>> df.xs('mammal')
                           num_legs  num_wings
        animal locomotion
        cat    walks              4          0
        dog    walks              4          0
        bat    flies              2          2
 
        Get values at several indexes
 
        >>> df.xs(('mammal', 'dog', 'walks'))
        num_legs     4
        num_wings    0
        Name: (mammal, dog, walks), dtype: int64
 
        Get values at specified index and level
 
        >>> df.xs('cat', level=1)
                           num_legs  num_wings
        class  locomotion
        mammal walks              4          0
 
        Get values at several indexes and levels
 
        >>> df.xs(('bird', 'walks'),
        ...       level=[0, 'locomotion'])
                 num_legs  num_wings
        animal
        penguin         2          2
 
        Get values at specified column and axis
 
        >>> df.xs('num_wings', axis=1)
        class   animal   locomotion
        mammal  cat      walks         0
                dog      walks         0
                bat      flies         2
        bird    penguin  walks         2
        Name: num_wings, dtype: int64
        z7list keys are not supported in xs, pass a tuple insteadNzIndex must be a MultiIndex)rrGr»rrEr¹rt©r¬)!ròrèr¿r¦rGruZ get_loc_levelr7rørr9rrôrörÞZ_get_loc_levelrÚ
is_integerÚget_locrÚndarrayr¸rrÚnonzerorFr_r.r›Zfast_xsÚ_constructor_slicedrÊrEÚ_is_view)r³rrºrrGrÚlocÚnew_axZ_indexerrCr4rÞrQZindsrËr´r´rµr‰rsfj
 
 
 
 
 
 
 
 
 
 
 
 ÿþ
 
 
z
NDFrame.xscCs t|ƒ‚dSrÐrÜ)r³r3r´r´rµÚ __getitem__%szNDFrame.__getitem__r7)r³Úslobjrºr®cCs`t|tƒstt|ƒƒ‚| |¡}| |jj||d¡}| |¡}|dkpL|j    }|j
||d|S)zp
        Construct a slice of this container.
 
        Slicing with this method is *always* positional.
        r¹rrH) r¿r7rõr`r¾rÉr›Z    get_slicerÊrNrE)r³rRrºr4Zis_copyr´r´rµÚ_slice(s
 
zNDFrame._slice)Úrefr¬r®cCs(|s d|_n|dk    st‚t |¡|_dSrÐ)ržrõÚweakrefrT)r³rTr¬r´r´rµrE9s zNDFrame._set_is_copycCs|jr|jdddS)aV
        Check if we are a view, have a cacher, and are of mixed type.
        If so, then force a setitem_copy check.
 
        Should be called just near setting a value
 
        Will return a boolean if it we are a view and are cached, but a
        single-dtype meaning that the cacher should be updated following
        setting.
        r;r<F)ržr=rÎr´r´rµÚ%_check_is_chained_assignment_possibleAs  z-NDFrame._check_is_chained_assignment_possibleÚsetting)r!ÚforcecCsÈtƒr
dS|s|jsdSt d¡}|dkr.dS|jdk    rtt|jtƒst| ¡}t |¡rj|dk    rt|j|jkrtd|_dSt|jtƒrˆ|j}n|dkr–d}nd}|dkrªt    |ƒ‚|dkrÄt
j |t t ƒddS)    a
 
        Parameters
        ----------
        t : str, the type of setting error
        force : bool, default False
           If True, then force showing an error.
 
        validate if we are doing a setitem on a chained copy.
 
        It is technically possible to figure out that we are setting on
        a copy even WITH a multi-dtyped pandas object. In other words, some
        blocks may be views while other are not. Currently _is_view will ALWAYS
        return False for multi-blocks to avoid having to handle this case.
 
        df = DataFrame(np.arange(0,9), columns=['count'])
        df['group'] = 'b'
 
        # This technically need not raise SettingWithCopy if both are view
        # (which is not generally guaranteed but is usually True.  However,
        # this is in general not a good practice and we recommend using .loc.
        df.iloc[0:5]['group'] = 'a'
 
        Nzmode.chained_assignmentr;zÎ
A value is trying to be set on a copy of a slice from a DataFrame
 
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copya
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
 
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copyr?Úwarn©Ú
stacklevel)rržrr²r¿r§ÚgcZ get_referentsrrFÚwarningsrYrGrI)r³r!rXrÏÚrr´r´rµr=Ps.
 
 ÿ ÿ
zNDFrame._check_setitem_copycCsÔd}d}|jdkrDt|jtƒrDz||jjk}Wntk
rBYnX|rŒt|tƒsX|f}|jD],}t|tƒr^|dt|ƒ…|kr^||=d}q^|s®|jd     |¡}|j
  |¡|_
z |j |=Wnt k
rÎYnXdS)z
        Delete item
        Fr÷NTr@)rør¿röruZ_enginerGrrÀr–rJr›Zideleterœrð)r³rZdeletedZmaybe_shortcutr*rOr´r´rµÚ __delitem__›s*
 
 zNDFrame.__delitem__cCs|r|jjstdƒ‚dS)NzQCannot specify 'inplace=True' when 'self.flags.allows_duplicate_labels' is False.)rÒr¯rñ)r³r˜r´r´rµrHÃs ÿz2NDFrame._check_inplace_and_allows_duplicate_labelsc
Cs.z
||WStttfk
r(|YSXdS)aB
        Get item from object for given key (ex: DataFrame column).
 
        Returns default value if not found.
 
        Parameters
        ----------
        key : object
 
        Returns
        -------
        same type as items contained in object
 
        Examples
        --------
        >>> df = pd.DataFrame(
        ...     [
        ...         [24.3, 75.7, "high"],
        ...         [31, 87.8, "high"],
        ...         [22, 71.6, "medium"],
        ...         [35, 95, "medium"],
        ...     ],
        ...     columns=["temp_celsius", "temp_fahrenheit", "windspeed"],
        ...     index=pd.date_range(start="2014-02-12", end="2014-02-15", freq="D"),
        ... )
 
        >>> df
                    temp_celsius  temp_fahrenheit windspeed
        2014-02-12          24.3             75.7      high
        2014-02-13          31.0             87.8      high
        2014-02-14          22.0             71.6    medium
        2014-02-15          35.0             95.0    medium
 
        >>> df.get(["temp_celsius", "windspeed"])
                    temp_celsius windspeed
        2014-02-12          24.3      high
        2014-02-13          31.0      high
        2014-02-14          22.0    medium
        2014-02-15          35.0    medium
 
        >>> ser = df['windspeed']
        >>> ser.get('2014-02-13')
        'high'
 
        If the key isn't found, the default value will be used.
 
        >>> df.get(["temp_celsius", "temp_kelvin"], default="default_value")
        'default_value'
 
        >>> ser.get('2014-02-10', '[unknown]')
        '[unknown]'
        N)rðrñÚ
IndexError)r³rÚdefaultr´r´rµr%Ës6
z NDFrame.getcCs|jjS)z:Return boolean indicating if self is view of another array)r›Zis_viewrÎr´r´rµrNszNDFrame._is_viewz@Literal[('backfill', 'bfill', 'pad', 'ffill', 'nearest')] | None)r³r,r¬r®cCs"|j|j||||d}|jf|ŽS)a
        Return an object with matching indices as other object.
 
        Conform the object to the same index on all axes. Optional
        filling logic, placing NaN in locations having no value
        in the previous index. A new object is produced unless the
        new index is equivalent to the current one and copy=False.
 
        Parameters
        ----------
        other : Object of the same data type
            Its row and column indices are used to define the new indices
            of this object.
        method : {None, 'backfill'/'bfill', 'pad'/'ffill', 'nearest'}
            Method to use for filling holes in reindexed DataFrame.
            Please note: this is only applicable to DataFrames/Series with a
            monotonically increasing/decreasing index.
 
            * None (default): don't fill gaps
            * pad / ffill: propagate last valid observation forward to next
              valid
            * backfill / bfill: use next valid observation to fill gap
            * nearest: use nearest valid observations to fill gap.
 
        copy : bool, default True
            Return a new object, even if the passed indexes are the same.
        limit : int, default None
            Maximum number of consecutive labels to fill for inexact matches.
        tolerance : optional
            Maximum distance between original and new labels for inexact
            matches. The values of the index at the matching locations must
            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.
 
            Tolerance may be a scalar value, which applies the same tolerance
            to all values, or list-like, which applies variable tolerance per
            element. List-like includes list, tuple, array, Series, and must be
            the same size as the index and its dtype must exactly match the
            index's type.
 
        Returns
        -------
        Series or DataFrame
            Same type as caller, but with changed indices on each axis.
 
        See Also
        --------
        DataFrame.set_index : Set row labels.
        DataFrame.reset_index : Remove row labels or move them to new columns.
        DataFrame.reindex : Change to new indices or expand indices.
 
        Notes
        -----
        Same as calling
        ``.reindex(index=other.index, columns=other.columns,...)``.
 
        Examples
        --------
        >>> df1 = pd.DataFrame([[24.3, 75.7, 'high'],
        ...                     [31, 87.8, 'high'],
        ...                     [22, 71.6, 'medium'],
        ...                     [35, 95, 'medium']],
        ...                    columns=['temp_celsius', 'temp_fahrenheit',
        ...                             'windspeed'],
        ...                    index=pd.date_range(start='2014-02-12',
        ...                                        end='2014-02-15', freq='D'))
 
        >>> df1
                    temp_celsius  temp_fahrenheit windspeed
        2014-02-12          24.3             75.7      high
        2014-02-13          31.0             87.8      high
        2014-02-14          22.0             71.6    medium
        2014-02-15          35.0             95.0    medium
 
        >>> df2 = pd.DataFrame([[28, 'low'],
        ...                     [30, 'low'],
        ...                     [35.1, 'medium']],
        ...                    columns=['temp_celsius', 'windspeed'],
        ...                    index=pd.DatetimeIndex(['2014-02-12', '2014-02-13',
        ...                                            '2014-02-15']))
 
        >>> df2
                    temp_celsius windspeed
        2014-02-12          28.0       low
        2014-02-13          30.0       low
        2014-02-15          35.1    medium
 
        >>> df2.reindex_like(df1)
                    temp_celsius  temp_fahrenheit windspeed
        2014-02-12          28.0              NaN       low
        2014-02-13          30.0              NaN       low
        2014-02-14           NaN              NaN       NaN
        2014-02-15          35.1              NaN    medium
        )r–r,r¬ÚlimitÚ    tolerance)rïrßÚreindex)r³r\r,r¬rbrcrîr´r´rµÚ reindex_like sfûzNDFrame.reindex_like)rºrÞrörr<r+)rrºrÞrörr˜r<r®cCsdSrÐr´©r³rrºrÞrörr˜r<r´r´rµrŽ|s z NDFrame.drop)rºrÞrörr˜r<)    r³rrºrÞrörr˜r<r®cCsdSrÐr´rfr´r´rµrŽŠs cCsdSrÐr´rfr´r´rµrŽ˜s r?c Cs¼t|dƒ}|dk    r>|dk    s"|dk    r*tdƒ‚| |¡}||i}    n4|dk    sN|dk    rjd|i}    |jdkrr||    d<ntdƒ‚|}
|     ¡D]"\}}|dk    r~|
j||||d}
q~|r´| |
¡dS|
SdS)Nr˜z2Cannot specify both 'labels' and 'index'/'columns'rÞr÷röz>Need to specify at least one of 'labels', 'index' or 'columns'©rr<)rLrñrôrør½Ú
_drop_axisrM) r³rrºrÞrörr˜r<r r–r r´r´rµrަs*
 
 
 
 
ÿ
)r³r<Ú
only_slicer®cCs²| |¡}| |¡}|jrb|dk    rFt|tƒs4tdƒ‚|j|||d}n|j||d}| |¡}nt|ƒprt|t    ƒ}    t
t   |¡ƒ}|dk    rÎt|tƒsœtdƒ‚|  |¡ |¡}
|dkrÌ|
 ¡rÌt|›dƒ‚nht|tƒrú|jdkrú|    sú|  d¡ |¡}
n<| |¡}
| |¡d    k ¡} |dkr6| r6t|›dƒ‚t|
jƒrN|
jtd
}
|
 ¡d}| |¡}|j|d } |jj||| d d|d } | | ¡}|jd kr¨|j|_| |¡S)a
        Drop labels from specified axis. Used in the ``drop`` method
        internally.
 
        Parameters
        ----------
        labels : single label or list-like
        axis : int or axis name
        level : int or level name, default None
            For MultiIndex
        errors : {'ignore', 'raise'}, default 'raise'
            If 'ignore', suppress error and existing labels are dropped.
        only_slice : bool, default False
            Whether indexing along columns should be view-only.
 
        Nzaxis must be a MultiIndexrg)r<r?rDr°rr@r¼r»T)rºÚ
allow_dupsr¬ri)ròrèZ    is_uniquer¿rurõrŽZ get_indexerrerrPrjZindex_labels_to_arrayrüÚisinr]rðr¸rLrrYZto_numpyrqrLrBrør›Úreindex_indexerrÉrÿrÊ)r³rrºrr<riZaxis_numZnew_axisrCZis_tuple_labelsÚmaskZlabels_missingrÆrËr4r´r´rµrhÍsZ
 
 
 
ÿþý    
ú
 zNDFrame._drop_axis)r:r®cCs*| ¡| ¡|j|_|j|dddS)zÏ
        Replace self internals with result.
 
        Parameters
        ----------
        result : same type as self
        verify_is_copy : bool, default True
            Provide is_copy checks.
        T)r:r˜N)Ú _reset_cacher!r›r>)r³r4r:r´r´rµrM$s zNDFrame._update_inplace)r³rýrºr®cs8‡fdd„}|j}|dk    r$| |¡}||i}|jf|ŽS)a8
        Prefix labels with string `prefix`.
 
        For Series, the row labels are prefixed.
        For DataFrame, the column labels are prefixed.
 
        Parameters
        ----------
        prefix : str
            The string to add before each label.
        axis : {{0 or 'index', 1 or 'columns', None}}, default None
            Axis to add prefix on
 
            .. versionadded:: 2.0.0
 
        Returns
        -------
        Series or DataFrame
            New Series or DataFrame with updated labels.
 
        See Also
        --------
        Series.add_suffix: Suffix row labels with string `suffix`.
        DataFrame.add_suffix: Suffix column labels with string `suffix`.
 
        Examples
        --------
        >>> s = pd.Series([1, 2, 3, 4])
        >>> s
        0    1
        1    2
        2    3
        3    4
        dtype: int64
 
        >>> s.add_prefix('item_')
        item_0    1
        item_1    2
        item_2    3
        item_3    4
        dtype: int64
 
        >>> df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [3, 4, 5, 6]})
        >>> df
           A  B
        0  1  3
        1  2  4
        2  3  5
        3  4  6
 
        >>> df.add_prefix('col_')
             col_A  col_B
        0       1       3
        1       2       4
        2       3       5
        3       4       6
        cs ˆ›|›SrÐr´r©rýr´rµrqrz$NDFrame.add_prefix.<locals>.<lambda>N©rärôrR)r³rýrºrPr r=r´rorµÚ
add_prefix6s ; 
zNDFrame.add_prefix)r³Úsuffixrºr®cs8‡fdd„}|j}|dk    r$| |¡}||i}|jf|ŽS)a7
        Suffix labels with string `suffix`.
 
        For Series, the row labels are suffixed.
        For DataFrame, the column labels are suffixed.
 
        Parameters
        ----------
        suffix : str
            The string to add after each label.
        axis : {{0 or 'index', 1 or 'columns', None}}, default None
            Axis to add suffix on
 
            .. versionadded:: 2.0.0
 
        Returns
        -------
        Series or DataFrame
            New Series or DataFrame with updated labels.
 
        See Also
        --------
        Series.add_prefix: Prefix row labels with string `prefix`.
        DataFrame.add_prefix: Prefix column labels with string `prefix`.
 
        Examples
        --------
        >>> s = pd.Series([1, 2, 3, 4])
        >>> s
        0    1
        1    2
        2    3
        3    4
        dtype: int64
 
        >>> s.add_suffix('_item')
        0_item    1
        1_item    2
        2_item    3
        3_item    4
        dtype: int64
 
        >>> df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [3, 4, 5, 6]})
        >>> df
           A  B
        0  1  3
        1  2  4
        2  3  5
        3  4  6
 
        >>> df.add_suffix('_col')
             A_col  B_col
        0       1       3
        1       2       4
        2       3       5
        3       4       6
        cs |›ˆ›SrÐr´r©rrr´rµr»rz$NDFrame.add_suffix.<locals>.<lambda>Nrp)r³rrrºrPr r=r´rsrµÚ
add_suffix€s ; 
zNDFrame.add_suffix)rºÚ    ascendingr˜rØÚ na_positionÚ ignore_indexrzbool_t | Sequence[bool_t]r?)    r³rºrur˜rØrvrwrr®cCsdSrÐr´©r³rºrur˜rØrvrwrr´r´rµÚ sort_valuesÉs zNDFrame.sort_values)rºrurØrvrwr)rºrur˜rØrvrwrr®cCsdSrÐr´rxr´r´rµry×s cCsdSrÐr´rxr´r´rµryås Z    quicksortÚlastcCs t|ƒ‚dS)u–
        Sort by the values along either axis.
 
        Parameters
        ----------%(optional_by)s
        axis : %(axes_single_arg)s, default 0
             Axis to be sorted.
        ascending : bool or list of bool, default True
             Sort ascending vs. descending. Specify list for multiple sort
             orders.  If this is a list of bools, must match the length of
             the by.
        inplace : bool, default False
             If True, perform operation in-place.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, default 'quicksort'
             Choice of sorting algorithm. See also :func:`numpy.sort` for more
             information. `mergesort` and `stable` are the only stable algorithms. For
             DataFrames, this option is only applied when sorting on a single
             column or label.
        na_position : {'first', 'last'}, default 'last'
             Puts NaNs at the beginning if `first`; `last` puts NaNs at the
             end.
        ignore_index : bool, default False
             If True, the resulting axis will be labeled 0, 1, â€¦, n - 1.
        key : callable, optional
            Apply the key function to the values
            before sorting. This is similar to the `key` argument in the
            builtin :meth:`sorted` function, with the notable difference that
            this `key` function should be *vectorized*. It should expect a
            ``Series`` and return a Series with the same shape as the input.
            It will be applied to each column in `by` independently.
 
            .. versionadded:: 1.1.0
 
        Returns
        -------
        DataFrame or None
            DataFrame with sorted values or None if ``inplace=True``.
 
        See Also
        --------
        DataFrame.sort_index : Sort a DataFrame by the index.
        Series.sort_values : Similar method for a Series.
 
        Examples
        --------
        >>> df = pd.DataFrame({
        ...     'col1': ['A', 'A', 'B', np.nan, 'D', 'C'],
        ...     'col2': [2, 1, 9, 8, 7, 4],
        ...     'col3': [0, 1, 9, 4, 2, 3],
        ...     'col4': ['a', 'B', 'c', 'D', 'e', 'F']
        ... })
        >>> df
          col1  col2  col3 col4
        0    A     2     0    a
        1    A     1     1    B
        2    B     9     9    c
        3  NaN     8     4    D
        4    D     7     2    e
        5    C     4     3    F
 
        Sort by col1
 
        >>> df.sort_values(by=['col1'])
          col1  col2  col3 col4
        0    A     2     0    a
        1    A     1     1    B
        2    B     9     9    c
        5    C     4     3    F
        4    D     7     2    e
        3  NaN     8     4    D
 
        Sort by multiple columns
 
        >>> df.sort_values(by=['col1', 'col2'])
          col1  col2  col3 col4
        1    A     1     1    B
        0    A     2     0    a
        2    B     9     9    c
        5    C     4     3    F
        4    D     7     2    e
        3  NaN     8     4    D
 
        Sort Descending
 
        >>> df.sort_values(by='col1', ascending=False)
          col1  col2  col3 col4
        4    D     7     2    e
        5    C     4     3    F
        2    B     9     9    c
        0    A     2     0    a
        1    A     1     1    B
        3  NaN     8     4    D
 
        Putting NAs first
 
        >>> df.sort_values(by='col1', ascending=False, na_position='first')
          col1  col2  col3 col4
        3  NaN     8     4    D
        4    D     7     2    e
        5    C     4     3    F
        2    B     9     9    c
        0    A     2     0    a
        1    A     1     1    B
 
        Sorting with a key function
 
        >>> df.sort_values(by='col4', key=lambda col: col.str.lower())
           col1  col2  col3 col4
        0    A     2     0    a
        1    A     1     1    B
        2    B     9     9    c
        3  NaN     8     4    D
        4    D     7     2    e
        5    C     4     3    F
 
        Natural sort with the key argument,
        using the `natsort <https://github.com/SethMMorton/natsort>` package.
 
        >>> df = pd.DataFrame({
        ...    "time": ['0hr', '128hr', '72hr', '48hr', '96hr'],
        ...    "value": [10, 20, 30, 40, 50]
        ... })
        >>> df
            time  value
        0    0hr     10
        1  128hr     20
        2   72hr     30
        3   48hr     40
        4   96hr     50
        >>> from natsort import index_natsorted
        >>> df.sort_values(
        ...     by="time",
        ...     key=lambda x: np.argsort(index_natsorted(df["time"]))
        ... )
            time  value
        0    0hr     10
        3   48hr     40
        2   72hr     30
        4   96hr     50
        1  128hr     20
        NrÜrxr´r´rµryós)rºrrurØrvÚsort_remainingrwrr7r2r,)
rºrrur˜rØrvr{rwrr®c    
CsdSrÐr´©
r³rºrrur˜rØrvr{rwrr´r´rµÚ
sort_indexszNDFrame.sort_index)    rºrrur˜rØrvr{rwr) r³rºrrur˜rØrvr{rwrr®c    
CsdSrÐr´r|r´r´rµr}sc    
CsdSrÐr´r|r´r´rµr}­sc    Csüt|dƒ}| |¡}t|ƒ}| |¡}
t|
||||||    ƒ} | dkrv|rL|} n |jdd} |rjtt|ƒƒ| _|rrdS| S|     |¡} |j
j | | dd}|  | |j |  ¡¡|rÒt|tƒrºdnd}|  |tt| ƒƒ¡| |¡} |rê| | ¡S| j|ddSdS)    Nr˜rÓF)rºrDr»rr}r+)rLròrKrèr‡r¬rxrÀrÞr¾r›rBrr–Z_sort_levels_monotonicr¿rbrÉrMrÊ)r³rºrrur˜rØrvr{rwrÚtargetrCr4Úbaxisrjr´r´rµr}½s@
 
 
ÿ 
 
 
)r—Zoptional_reindexz Scalar | None)r³rºr,r¬rÚ
fill_valuerbr®c     sü|dk    r"|dk    r"|dk    r"tdƒ‚nX|dk    s2|dk    r^|dk    rBtdƒ‚|dk    rz|dk    rX|}qz|}n|rvˆ |¡dkrv|}n|}||dœ} t|ƒ}|rštƒršd}t‡fdd„|  ¡DƒƒrÀˆj|d    Sˆ | ||¡r܈ | ||¡Sˆ     | ||    |
|||¡j
ˆd
d S) aà
        Conform {klass} to new index with optional filling logic.
 
        Places NA/NaN in locations having no value in the previous index. A new object
        is produced unless the new index is equivalent to the current one and
        ``copy=False``.
 
        Parameters
        ----------
        {optional_reindex}
        method : {{None, 'backfill'/'bfill', 'pad'/'ffill', 'nearest'}}
            Method to use for filling holes in reindexed DataFrame.
            Please note: this is only applicable to DataFrames/Series with a
            monotonically increasing/decreasing index.
 
            * None (default): don't fill gaps
            * pad / ffill: Propagate last valid observation forward to next
              valid.
            * backfill / bfill: Use next valid observation to fill gap.
            * nearest: Use nearest valid observations to fill gap.
 
        copy : bool, default True
            Return a new object, even if the passed indexes are the same.
        level : int or name
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        fill_value : scalar, default np.NaN
            Value to use for missing values. Defaults to NaN, but can be any
            "compatible" value.
        limit : int, default None
            Maximum number of consecutive elements to forward or backward fill.
        tolerance : optional
            Maximum distance between original and new labels for inexact
            matches. The values of the index at the matching locations most
            satisfy the equation ``abs(index[indexer] - target) <= tolerance``.
 
            Tolerance may be a scalar value, which applies the same tolerance
            to all values, or list-like, which applies variable tolerance per
            element. List-like includes list, tuple, array, Series, and must be
            the same size as the index and its dtype must exactly match the
            index's type.
 
        Returns
        -------
        {klass} with changed index.
 
        See Also
        --------
        DataFrame.set_index : Set row labels.
        DataFrame.reset_index : Remove row labels or move them to new columns.
        DataFrame.reindex_like : Change to same indices as other DataFrame.
 
        Examples
        --------
        ``DataFrame.reindex`` supports two calling conventions
 
        * ``(index=index_labels, columns=column_labels, ...)``
        * ``(labels, axis={{'index', 'columns'}}, ...)``
 
        We *highly* recommend using keyword arguments to clarify your
        intent.
 
        Create a dataframe with some fictional data.
 
        >>> index = ['Firefox', 'Chrome', 'Safari', 'IE10', 'Konqueror']
        >>> df = pd.DataFrame({{'http_status': [200, 200, 404, 404, 301],
        ...                   'response_time': [0.04, 0.02, 0.07, 0.08, 1.0]}},
        ...                   index=index)
        >>> df
                   http_status  response_time
        Firefox            200           0.04
        Chrome             200           0.02
        Safari             404           0.07
        IE10               404           0.08
        Konqueror          301           1.00
 
        Create a new index and reindex the dataframe. By default
        values in the new index that do not have corresponding
        records in the dataframe are assigned ``NaN``.
 
        >>> new_index = ['Safari', 'Iceweasel', 'Comodo Dragon', 'IE10',
        ...              'Chrome']
        >>> df.reindex(new_index)
                       http_status  response_time
        Safari               404.0           0.07
        Iceweasel              NaN            NaN
        Comodo Dragon          NaN            NaN
        IE10                 404.0           0.08
        Chrome               200.0           0.02
 
        We can fill in the missing values by passing a value to
        the keyword ``fill_value``. Because the index is not monotonically
        increasing or decreasing, we cannot use arguments to the keyword
        ``method`` to fill the ``NaN`` values.
 
        >>> df.reindex(new_index, fill_value=0)
                       http_status  response_time
        Safari                 404           0.07
        Iceweasel                0           0.00
        Comodo Dragon            0           0.00
        IE10                   404           0.08
        Chrome                 200           0.02
 
        >>> df.reindex(new_index, fill_value='missing')
                      http_status response_time
        Safari                404          0.07
        Iceweasel         missing       missing
        Comodo Dragon     missing       missing
        IE10                  404          0.08
        Chrome                200          0.02
 
        We can also reindex the columns.
 
        >>> df.reindex(columns=['http_status', 'user_agent'])
                   http_status  user_agent
        Firefox            200         NaN
        Chrome             200         NaN
        Safari             404         NaN
        IE10               404         NaN
        Konqueror          301         NaN
 
        Or we can use "axis-style" keyword arguments
 
        >>> df.reindex(['http_status', 'user_agent'], axis="columns")
                   http_status  user_agent
        Firefox            200         NaN
        Chrome             200         NaN
        Safari             404         NaN
        IE10               404         NaN
        Konqueror          301         NaN
 
        To further illustrate the filling functionality in
        ``reindex``, we will create a dataframe with a
        monotonically increasing index (for example, a sequence
        of dates).
 
        >>> date_index = pd.date_range('1/1/2010', periods=6, freq='D')
        >>> df2 = pd.DataFrame({{"prices": [100, 101, np.nan, 100, 89, 88]}},
        ...                    index=date_index)
        >>> df2
                    prices
        2010-01-01   100.0
        2010-01-02   101.0
        2010-01-03     NaN
        2010-01-04   100.0
        2010-01-05    89.0
        2010-01-06    88.0
 
        Suppose we decide to expand the dataframe to cover a wider
        date range.
 
        >>> date_index2 = pd.date_range('12/29/2009', periods=10, freq='D')
        >>> df2.reindex(date_index2)
                    prices
        2009-12-29     NaN
        2009-12-30     NaN
        2009-12-31     NaN
        2010-01-01   100.0
        2010-01-02   101.0
        2010-01-03     NaN
        2010-01-04   100.0
        2010-01-05    89.0
        2010-01-06    88.0
        2010-01-07     NaN
 
        The index entries that did not have a value in the original data frame
        (for example, '2009-12-29') are by default filled with ``NaN``.
        If desired, we can fill in the missing values using one of several
        options.
 
        For example, to back-propagate the last valid value to fill the ``NaN``
        values, pass ``bfill`` as an argument to the ``method`` keyword.
 
        >>> df2.reindex(date_index2, method='bfill')
                    prices
        2009-12-29   100.0
        2009-12-30   100.0
        2009-12-31   100.0
        2010-01-01   100.0
        2010-01-02   101.0
        2010-01-03     NaN
        2010-01-04   100.0
        2010-01-05    89.0
        2010-01-06    88.0
        2010-01-07     NaN
 
        Please note that the ``NaN`` value present in the original dataframe
        (at index value 2010-01-03) will not be filled by any of the
        value propagation schemes. This is because filling while reindexing
        does not look at dataframe values, but only compares the original and
        desired indexes. If you do want to fill in the ``NaN`` values present
        in the original dataframe, use the ``fillna()`` method.
 
        See the :ref:`user guide <basics.reindexing>` for more.
        Nz3Cannot specify all of 'labels', 'index', 'columns'.r>r»rUFc3s*|]"\}}|dk    rˆ |¡ |¡VqdSrÐ)rèZ    identical)rêr rOrÎr´rµräsþz"NDFrame.reindex.<locals>.<genexpr>rÓrdr+) rGròr‚rr]r½r¬Ú_needs_reindex_multiÚ_reindex_multiÚ _reindex_axesrÊ) r³rrÞrörºr,r¬rr€rbrcr–r´rÎrµrdòsNX
ÿþ
 þ ÿþzNDFrame.reindexcCsp|}|jD]`}    ||    }
|
dkr q
| |    ¡} | j|
||||d\} } | |    ¡}|j|| | gi||dd}d}q
|S)z%Perform the reindex for all the axes.N)rrbrcr,F)r€r¬rj)rßrèrdròÚ_reindex_with_indexers)r³r–rrbrcr,r€r¬r rÅrrOrQrCrºr´r´rµrƒôs,
 
ÿ
 
 
üzNDFrame._reindex_axescCsVtj| ¡Ž|jkoT|dkoT|dkoT|j oT|jdkoRt|jƒdkoRt|jj    dƒ S)z$Check if we do need a multi reindex.Nr÷r»r)
rjÚcount_not_nonerÂråÚ_is_mixed_typerørÀrœrYr9)r³r–r,rr´r´rµrsÿþý
 ÿýûzNDFrame._needs_reindex_multicCs t|ƒ‚dSrÐrÜ)r³r–r¬r€r´r´rµr‚szNDFrame._reindex_multi)r³r¬rjr®c
    CsÀ|j}t| ¡ƒD]V}||\}}| |¡}    |dkr6qt|ƒ}|dk    rNt|ƒ}|j|||    |||d}d}q|sv|dkr”||jkr”tƒs”|j|d}ntƒr°||jkr°|jdd}|     |¡ 
|¡S)z*allow_dups indicates an internal call hereN)rºr€rjr¬FrÓ) r›Úsortedrr¾ryrQrlrr¬rÉrÊ)
r³Ú
reindexersr€r¬rjrjrºrÞrCrr´r´rµr„ s<
 
ú    ÿÿþý zNDFrame._reindex_with_indexers)r³ÚlikeÚregexrºr®c    sÜt |ˆ|¡}|dkrtdƒ‚|dkr,|j}| |¡‰|dk    rf| |¡}|jf|‡fdd„|DƒiŽSˆr–ddœ‡fdd    „ }ˆ |¡}|j|d
|S|rÐddœ‡fd d    „ }t     
|¡‰ˆ |¡}|j|d
|Std ƒ‚dS) uF
        Subset the dataframe rows or columns according to the specified index labels.
 
        Note that this routine does not filter a dataframe on its
        contents. The filter is applied to the labels of the index.
 
        Parameters
        ----------
        items : list-like
            Keep labels from axis which are in items.
        like : str
            Keep labels from axis for which "like in label == True".
        regex : str (regular expression)
            Keep labels from axis for which re.search(regex, label) == True.
        axis : {0 or â€˜index’, 1 or â€˜columns’, None}, default None
            The axis to filter on, expressed either as an index (int)
            or axis name (str). By default this is the info axis, 'columns' for
            DataFrame. For `Series` this parameter is unused and defaults to `None`.
 
        Returns
        -------
        same type as input object
 
        See Also
        --------
        DataFrame.loc : Access a group of rows and columns
            by label(s) or a boolean array.
 
        Notes
        -----
        The ``items``, ``like``, and ``regex`` parameters are
        enforced to be mutually exclusive.
 
        ``axis`` defaults to the info axis that is used when indexing
        with ``[]``.
 
        Examples
        --------
        >>> df = pd.DataFrame(np.array(([1, 2, 3], [4, 5, 6])),
        ...                   index=['mouse', 'rabbit'],
        ...                   columns=['one', 'two', 'three'])
        >>> df
                one  two  three
        mouse     1    2      3
        rabbit    4    5      6
 
        >>> # select columns by name
        >>> df.filter(items=['one', 'three'])
                 one  three
        mouse     1      3
        rabbit    4      6
 
        >>> # select columns by regular expression
        >>> df.filter(regex='e$', axis=1)
                 one  three
        mouse     1      3
        rabbit    4      6
 
        >>> # select rows containing 'bbi'
        >>> df.filter(like='bbi', axis=0)
                 one  two  three
        rabbit    4    5      6
        r»zDKeyword arguments `items`, `like`, or `regex` are mutually exclusiveNcsg|]}|ˆkr|‘qSr´r´)rêr^)rr´rµr¢sz"NDFrame.filter.<locals>.<listcomp>r©rÍcsˆdk    s t‚ˆt|ƒkSrÐ)rõrRr)r‰r´rµrP¦s zNDFrame.filter.<locals>.fr¹csˆ t|ƒ¡dk    SrÐ)ÚsearchrRr)Úmatcherr´rµrP®sz,Must pass either `items`, `like`, or `regex`) rjr…rGrärèrôrdr¯rOÚreÚcompile)    r³r½r‰rŠrºZnkwrÿrPrÂr´)rr‰rŒrµÚfilterMs.Fÿ
 
ÿ
 
 
zNDFrame.filteré)r³Únr®cCs|jd|…S)a·
        Return the first `n` rows.
 
        This function returns the first `n` rows for the object based
        on position. It is useful for quickly testing if your object
        has the right type of data in it.
 
        For negative values of `n`, this function returns all rows except
        the last `|n|` rows, equivalent to ``df[:n]``.
 
        If n is larger than the number of rows, this function returns all rows.
 
        Parameters
        ----------
        n : int, default 5
            Number of rows to select.
 
        Returns
        -------
        same type as caller
            The first `n` rows of the caller object.
 
        See Also
        --------
        DataFrame.tail: Returns the last `n` rows.
 
        Examples
        --------
        >>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
        ...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})
        >>> df
              animal
        0  alligator
        1        bee
        2     falcon
        3       lion
        4     monkey
        5     parrot
        6      shark
        7      whale
        8      zebra
 
        Viewing the first 5 lines
 
        >>> df.head()
              animal
        0  alligator
        1        bee
        2     falcon
        3       lion
        4     monkey
 
        Viewing the first `n` lines (three in this case)
 
        >>> df.head(3)
              animal
        0  alligator
        1        bee
        2     falcon
 
        For negative values of `n`
 
        >>> df.head(-3)
              animal
        0  alligator
        1        bee
        2     falcon
        3       lion
        4     monkey
        5     parrot
        N©r9©r³r‘r´r´rµr¸·sIz NDFrame.headcCs&|dkr|jdd…S|j| d…S)aŠ
        Return the last `n` rows.
 
        This function returns last `n` rows from the object based on
        position. It is useful for quickly verifying data, for example,
        after sorting or appending rows.
 
        For negative values of `n`, this function returns all rows except
        the first `|n|` rows, equivalent to ``df[|n|:]``.
 
        If n is larger than the number of rows, this function returns all rows.
 
        Parameters
        ----------
        n : int, default 5
            Number of rows to select.
 
        Returns
        -------
        type of caller
            The last `n` rows of the caller object.
 
        See Also
        --------
        DataFrame.head : The first `n` rows of the caller object.
 
        Examples
        --------
        >>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
        ...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})
        >>> df
              animal
        0  alligator
        1        bee
        2     falcon
        3       lion
        4     monkey
        5     parrot
        6      shark
        7      whale
        8      zebra
 
        Viewing the last 5 lines
 
        >>> df.tail()
           animal
        4  monkey
        5  parrot
        6   shark
        7   whale
        8   zebra
 
        Viewing the last `n` lines (three in this case)
 
        >>> df.tail(3)
          animal
        6  shark
        7  whale
        8  zebra
 
        For negative values of `n`
 
        >>> df.tail(-3)
           animal
        3    lion
        4  monkey
        5  parrot
        6   shark
        7   whale
        8   zebra
        rNr’r“r´r´rµÚtailsIz NDFrame.tailz float | NonezRandomState | None)r³r‘ÚfracÚreplaceÚ random_staterºrwr®c Cs¦|dkr|j}| |¡}|j|}t |¡}    t |||¡}
|
dkrZ|dk    sNt‚t||ƒ}
|dk    rpt     |||¡}t ||
|||    ¡} |j
| |d} |r¢t t | ƒƒ| _ | S)uô
        Return a random sample of items from an axis of object.
 
        You can use `random_state` for reproducibility.
 
        Parameters
        ----------
        n : int, optional
            Number of items from axis to return. Cannot be used with `frac`.
            Default = 1 if `frac` = None.
        frac : float, optional
            Fraction of axis items to return. Cannot be used with `n`.
        replace : bool, default False
            Allow or disallow sampling of the same row more than once.
        weights : str or ndarray-like, optional
            Default 'None' results in equal probability weighting.
            If passed a Series, will align with target object on index. Index
            values in weights not found in sampled object will be ignored and
            index values in sampled object not in weights will be assigned
            weights of zero.
            If called on a DataFrame, will accept the name of a column
            when axis = 0.
            Unless weights are a Series, weights must be same length as axis
            being sampled.
            If weights do not sum to 1, they will be normalized to sum to 1.
            Missing values in the weights column will be treated as zero.
            Infinite values not allowed.
        random_state : int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional
            If int, array-like, or BitGenerator, seed for random number generator.
            If np.random.RandomState or np.random.Generator, use as given.
 
            .. versionchanged:: 1.1.0
 
                array-like and BitGenerator object now passed to np.random.RandomState()
                as seed
 
            .. versionchanged:: 1.4.0
 
                np.random.Generator objects now accepted
 
        axis : {0 or â€˜index’, 1 or â€˜columns’, None}, default None
            Axis to sample. Accepts axis number or name. Default is stat axis
            for given data type. For `Series` this parameter is unused and defaults to `None`.
        ignore_index : bool, default False
            If True, the resulting index will be labeled 0, 1, â€¦, n - 1.
 
            .. versionadded:: 1.3.0
 
        Returns
        -------
        Series or DataFrame
            A new object of same type as caller containing `n` items randomly
            sampled from the caller object.
 
        See Also
        --------
        DataFrameGroupBy.sample: Generates random samples from each group of a
            DataFrame object.
        SeriesGroupBy.sample: Generates random samples from each group of a
            Series object.
        numpy.random.choice: Generates a random sample from a given 1-D numpy
            array.
 
        Notes
        -----
        If `frac` > 1, `replacement` should be set to `True`.
 
        Examples
        --------
        >>> df = pd.DataFrame({'num_legs': [2, 4, 8, 0],
        ...                    'num_wings': [2, 0, 0, 0],
        ...                    'num_specimen_seen': [10, 2, 1, 8]},
        ...                   index=['falcon', 'dog', 'spider', 'fish'])
        >>> df
                num_legs  num_wings  num_specimen_seen
        falcon         2          2                 10
        dog            4          0                  2
        spider         8          0                  1
        fish           0          0                  8
 
        Extract 3 random elements from the ``Series`` ``df['num_legs']``:
        Note that we use `random_state` to ensure the reproducibility of
        the examples.
 
        >>> df['num_legs'].sample(n=3, random_state=1)
        fish      0
        spider    8
        falcon    2
        Name: num_legs, dtype: int64
 
        A random 50% sample of the ``DataFrame`` with replacement:
 
        >>> df.sample(frac=0.5, replace=True, random_state=1)
              num_legs  num_wings  num_specimen_seen
        dog          4          0                  2
        fish         0          0                  8
 
        An upsample sample of the ``DataFrame`` with replacement:
        Note that `replace` parameter has to be `True` for `frac` parameter > 1.
 
        >>> df.sample(frac=2, replace=True, random_state=1)
                num_legs  num_wings  num_specimen_seen
        dog            4          0                  2
        fish           0          0                  8
        falcon         2          2                 10
        falcon         2          2                 10
        fish           0          0                  8
        dog            4          0                  2
        fish           0          0                  8
        dog            4          0                  2
 
        Using a DataFrame column as weights. Rows with larger value in the
        `num_specimen_seen` column are more likely to be sampled.
 
        >>> df.sample(n=2, weights='num_specimen_seen', random_state=1)
                num_legs  num_wings  num_specimen_seen
        falcon         2          2                 10
        fish           0          0                  8
        Nr¹)Ú_stat_axis_numberròrrjr—rmZprocess_sampling_sizerõrxZpreprocess_weightsrBrxrÀrÞ) r³r‘r•r–Úweightsr—rºrwZobj_lenÚrsrZsampled_indicesr4r´r´rµrmOs"
 
 
  zNDFrame.samplez/Callable[..., T] | tuple[Callable[..., T], str]r:)Úfuncr®cOs6tƒr"tj|jdd|f|ž|ŽStj||f|ž|ŽS)a»
        Apply chainable functions that expect Series or DataFrames.
 
        Parameters
        ----------
        func : function
            Function to apply to the {klass}.
            ``args``, and ``kwargs`` are passed into ``func``.
            Alternatively a ``(callable, data_keyword)`` tuple where
            ``data_keyword`` is a string indicating the keyword of
            ``callable`` that expects the {klass}.
        args : iterable, optional
            Positional arguments passed into ``func``.
        kwargs : mapping, optional
            A dictionary of keyword arguments passed into ``func``.
 
        Returns
        -------
        the return type of ``func``.
 
        See Also
        --------
        DataFrame.apply : Apply a function along input axis of DataFrame.
        DataFrame.applymap : Apply a function elementwise on a whole DataFrame.
        Series.map : Apply a mapping correspondence on a
            :class:`~pandas.Series`.
 
        Notes
        -----
        Use ``.pipe`` when chaining together functions that expect
        Series, DataFrames or GroupBy objects. Instead of writing
 
        >>> func(g(h(df), arg1=a), arg2=b, arg3=c)  # doctest: +SKIP
 
        You can write
 
        >>> (df.pipe(h)
        ...    .pipe(g, arg1=a)
        ...    .pipe(func, arg2=b, arg3=c)
        ... )  # doctest: +SKIP
 
        If you have a function that takes the data as (say) the second
        argument, pass a tuple indicating which keyword expects the
        data. For example, suppose ``func`` takes its data as ``arg2``:
 
        >>> (df.pipe(h)
        ...    .pipe(g, arg1=a)
        ...    .pipe((func, 'arg2'), arg1=a, arg3=c)
        ...  )  # doctest: +SKIP
        NrÓ)rrjÚpiper¬)r³r›Úargsrír´r´rµrœês:z NDFrame.pipe)r³r,r®c     sàt|tƒrp|jD]}|j||j|<q|jj|j_t|jƒt|jƒ@D](}t|tƒsXt‚t     
||t ||dƒ¡qF|dkrÜ|j dj‰t ‡fdd„|j dd…Dƒƒ}|rÀˆD]}ˆ||j|<q¬t dd„|j Dƒƒ}||j_|S)aÜ
        Propagate metadata from other to self.
 
        Parameters
        ----------
        other : the object from which to get the attributes that we are going
            to propagate
        method : str, optional
            A passed method name providing context on where ``__finalize__``
            was called.
 
            .. warning::
 
               The value passed as `method` are not currently considered
               stable across pandas releases.
        Nr…rc3s|]}|jˆkVqdSrЩr­)rêÚobjsržr´rµrKsz'NDFrame.__finalize__.<locals>.<genexpr>r»css|]}|jjVqdSrÐ)rÒr¯©rêrr´r´rµrPs)r¿ršr­rÒr¯r¥r r§rõr°r±rùrŸr])r³r\r,rírÿZ check_attrsr¯r´ržrµrÊ+s$
 
   ÿzNDFrame.__finalize__rtcCs>||jkr2||jkr2||jkr2|j |¡r2||St ||¡S)zŒ
        After regular attribute access, try looking up the name
        This allows simpler access to columns for interactive use.
        )r£r r¤rZ$_can_hold_identifiers_and_holds_namer°Ú__getattribute__)r³rÿr´r´rµÚ __getattr__Wsÿþý
üzNDFrame.__getattr__)rÿr®c    Csþzt ||¡t |||¡WStk
r0YnX||jkrLt |||¡n®||jkrft |||¡n”zJt||ƒ}t|tƒrŒt |||¡n"||j    kr |||<nt |||¡WnHtt
fk
røt|t ƒræt |ƒræt jdtƒdt |||¡YnXdS)z‰
        After regular attribute access, try setting the name
        This allows simpler access to columns for interactive use.
        z•Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-accessrZN)r°r¡r±ÚAttributeErrorr£r rùr¿rtrrGrbr[r]rYrI)r³rÿrÏÚexistingr´r´rµr±gs.     
 
 
 
 
 
ûzNDFrame.__setattr__cs$tƒ ¡}|jjr | |jj¡|S)z‹
        add the string-like attributes from the info_axis.
        If info_axis is a MultiIndex, its first level values are used.
        )ÚsuperÚ_dir_additionsrZ_can_hold_stringsrìZ_dir_additions_for_owner)r³Z    additions©Ú    __class__r´rµr¦s
zNDFrame._dir_additionscCsDt|jttfƒr|ƒSt|jjƒ}|ƒ}t|jjƒ|kr@| ¡|S)z^
        Consolidate _mgr -- if the blocks have changed, then clear the
        cache
        )r¿r›rzr|rÀrÁr!)r³rPZ blocks_beforer4r´r´rµÚ_protect_consolidatežs zNDFrame._protect_consolidatecs ddœ‡fdd„ }ˆ |¡dS)z)Consolidate data in place and return NonerªrÍcsˆj ¡ˆ_dSrЩr›Z consolidater´rÎr´rµrP°sz'NDFrame._consolidate_inplace.<locals>.fN)r©)r³rPr´rÎrµÚ_consolidate_inplace¬szNDFrame._consolidate_inplacecs&‡fdd„}ˆ |¡}ˆ |¡ ˆ¡S)zÎ
        Compute NDFrame with "consolidated" internals (data of each dtype
        grouped together in a single ndarray).
 
        Returns
        -------
        consolidated : same type as caller
        cs
ˆj ¡SrÐrªr´rÎr´rµr¿rz&NDFrame._consolidate.<locals>.<lambda>)r©rÉrÊ)r³rPZ    cons_datar´rÎrµÚ _consolidateµs
 
zNDFrame._consolidatecCs&|jjr dS|jjrdS|j ¡dkS)NFTr»)r›r/Zany_extension_typesrœÚnuniquerÎr´r´rµr†Ãs
zNDFrame._is_mixed_typecCs:|jr6|jjs6t|ƒr t |¡s*|tjkr.dStdƒ‚dS)z?check whether we allow in-place setting with this type of valueTzHCannot do inplace boolean setting on mixed-types with a non np.nan value)    r†r›Zis_numeric_mixed_typerZrÚisnanrrWrGrÑr´r´rµÚ_check_inplace_settingÏsÿzNDFrame._check_inplace_settingcCs| |j ¡¡ |¡SrÐ)rÉr›Zget_numeric_datarÊrÎr´r´rµÚ_get_numeric_dataÞszNDFrame._get_numeric_datacCs| |j ¡¡ |¡SrÐ)rÉr›Z get_bool_datarÊrÎr´r´rµÚ_get_bool_dataâszNDFrame._get_bool_datacCs t|ƒ‚dSrÐrÜrÎr´r´rµrÂészNDFrame.valuescCs t|ƒ‚dS)zinternal implementationNrÜrÎr´r´rµr.íszNDFrame._valuescCs|j ¡}|j||jtjdS)aJ
        Return the dtypes in the DataFrame.
 
        This returns a Series with the data type of each column.
        The result's index is the original DataFrame's columns. Columns
        with mixed types are stored with the ``object`` dtype. See
        :ref:`the User Guide <basics.dtypes>` for more.
 
        Returns
        -------
        pandas.Series
            The data type of each column.
 
        Examples
        --------
        >>> df = pd.DataFrame({'float': [1.0],
        ...                    'int': [1],
        ...                    'datetime': [pd.Timestamp('20180310')],
        ...                    'string': ['foo']})
        >>> df.dtypes
        float              float64
        int                  int64
        datetime    datetime64[ns]
        string              object
        dtype: object
        )rÞr¸)r›Z
get_dtypesrMrrZobject_)r³r«r´r´rµrœòs
zNDFrame.dtypes)r³r¬r<r®c sèˆrtƒrd‰tˆƒr@ˆjdkrXtˆƒdks8ˆjˆkr@tdƒ‚ˆˆj}ˆ |ˆ|¡Sddlm}|ˆt    d}|j
D]}|ˆkrvtd|›dƒ‚qv|j ˆj d    dd
}g}t ˆ ¡ƒD]†\}    \}}
|j|    } t| ƒrâ|
jˆd } nPz|
j| ˆ|d } Wn:tk
r0} z| ›d |›df| _‚W5d    } ~ XYnX| | ¡q¶n^tˆƒrxˆjdkrx‡‡‡fdd„ttˆj ƒƒDƒ}n&ˆjjˆˆ|d }ˆ |¡jˆddS|s°ˆjd    d St|ddd}ˆ |¡}ˆj |_ |jˆdd}tt|ƒS)a+
        Cast a pandas object to a specified dtype ``dtype``.
 
        Parameters
        ----------
        dtype : str, data type, Series or Mapping of column name -> data type
            Use a str, numpy.dtype, pandas.ExtensionDtype or Python type to
            cast entire pandas object to the same type. Alternatively, use a
            mapping, e.g. {col: dtype, ...}, where col is a column label and dtype is
            a numpy.dtype or Python type to cast one or more of the DataFrame's
            columns to column-specific types.
        copy : bool, default True
            Return a copy when ``copy=True`` (be very careful setting
            ``copy=False`` as changes to values then may propagate to other
            pandas objects).
        errors : {'raise', 'ignore'}, default 'raise'
            Control raising of exceptions on invalid data for provided dtype.
 
            - ``raise`` : allow exceptions to be raised
            - ``ignore`` : suppress exceptions. On error return original object.
 
        Returns
        -------
        same type as caller
 
        See Also
        --------
        to_datetime : Convert argument to datetime.
        to_timedelta : Convert argument to timedelta.
        to_numeric : Convert argument to a numeric type.
        numpy.ndarray.astype : Cast a numpy array to a specified type.
 
        Notes
        -----
        .. versionchanged:: 2.0.0
 
            Using ``astype`` to convert from timezone-naive dtype to
            timezone-aware dtype will raise an exception.
            Use :meth:`Series.dt.tz_localize` instead.
 
        Examples
        --------
        Create a DataFrame:
 
        >>> d = {'col1': [1, 2], 'col2': [3, 4]}
        >>> df = pd.DataFrame(data=d)
        >>> df.dtypes
        col1    int64
        col2    int64
        dtype: object
 
        Cast all columns to int32:
 
        >>> df.astype('int32').dtypes
        col1    int32
        col2    int32
        dtype: object
 
        Cast col1 to int32 using a dictionary:
 
        >>> df.astype({'col1': 'int32'}).dtypes
        col1    int32
        col2    int64
        dtype: object
 
        Create a series:
 
        >>> ser = pd.Series([1, 2], dtype='int32')
        >>> ser
        0    1
        1    2
        dtype: int32
        >>> ser.astype('int64')
        0    1
        1    2
        dtype: int64
 
        Convert to categorical type:
 
        >>> ser.astype('category')
        0    1
        1    2
        dtype: category
        Categories (2, int32): [1, 2]
 
        Convert to ordered categorical type with custom ordering:
 
        >>> from pandas.api.types import CategoricalDtype
        >>> cat_dtype = CategoricalDtype(
        ...     categories=[2, 1], ordered=True)
        >>> ser.astype(cat_dtype)
        0    1
        1    2
        dtype: category
        Categories (2, int64): [2 < 1]
 
        Create a series of dates:
 
        >>> ser_date = pd.Series(pd.date_range('20200101', periods=3))
        >>> ser_date
        0   2020-01-01
        1   2020-01-02
        2   2020-01-03
        dtype: datetime64[ns]
        Fr»zFOnly the Series name can be used for the key in Series dtype mappings.rr“r¼zJOnly a column name can be used for the key in a dtype mappings argument. 'z' not found in columns.N)r€r¬rÓ)r¸r¬r<z': Error while type casting for column 'r„cs(g|] }ˆjdd…|fjˆˆd‘qS)NrH)r9rÃ)rêrþ©r¬r¸r³r´rµr­sÿz"NDFrame.astype.<locals>.<listcomp>rÃr+r)rrWrørÀrÿrðrÃÚpandasr”r°rÞrdrörúr½Ziatrfr¬rñrrçrYr-r›rÉrÊr…rr3)r³r¸r¬r<Únew_typer”Z    dtype_serÚcol_nameÚresultsrþr*ZcdtZres_colÚexrjr4r´r²rµrÃsVl
 
 
ÿ
 
 
ÿ
ÿ þ 
zNDFrame.astype)r³rÔr®cCs*|jj|d}| ¡| |¡j|ddS)a½
        Make a copy of this object's indices and data.
 
        When ``deep=True`` (default), a new object will be created with a
        copy of the calling object's data and indices. Modifications to
        the data or indices of the copy will not be reflected in the
        original object (see notes below).
 
        When ``deep=False``, a new object will be created without copying
        the calling object's data or index (only references to the data
        and index are copied). Any changes to the data of the original
        will be reflected in the shallow copy (and vice versa).
 
        Parameters
        ----------
        deep : bool, default True
            Make a deep copy, including a copy of the data and the indices.
            With ``deep=False`` neither the indices nor the data are copied.
 
        Returns
        -------
        Series or DataFrame
            Object type matches caller.
 
        Notes
        -----
        When ``deep=True``, data is copied but actual Python objects
        will not be copied recursively, only the reference to the object.
        This is in contrast to `copy.deepcopy` in the Standard Library,
        which recursively copies object data (see examples below).
 
        While ``Index`` objects are copied when ``deep=True``, the underlying
        numpy array is not copied for performance reasons. Since ``Index`` is
        immutable, the underlying data can be safely shared and a copy
        is not needed.
 
        Since pandas is not thread safe, see the
        :ref:`gotchas <gotchas.thread-safety>` when copying in a threading
        environment.
 
        Examples
        --------
        >>> s = pd.Series([1, 2], index=["a", "b"])
        >>> s
        a    1
        b    2
        dtype: int64
 
        >>> s_copy = s.copy()
        >>> s_copy
        a    1
        b    2
        dtype: int64
 
        **Shallow copy versus default (deep) copy:**
 
        >>> s = pd.Series([1, 2], index=["a", "b"])
        >>> deep = s.copy()
        >>> shallow = s.copy(deep=False)
 
        Shallow copy shares data and index with original.
 
        >>> s is shallow
        False
        >>> s.values is shallow.values and s.index is shallow.index
        True
 
        Deep copy has own copy of data and index.
 
        >>> s is deep
        False
        >>> s.values is deep.values or s.index is deep.index
        False
 
        Updates to the data shared by shallow copy and original is reflected
        in both; deep copy remains unchanged.
 
        >>> s[0] = 3
        >>> shallow[1] = 4
        >>> s
        a    3
        b    4
        dtype: int64
        >>> shallow
        a    3
        b    4
        dtype: int64
        >>> deep
        a    1
        b    2
        dtype: int64
 
        Note that when copying an object containing Python objects, a deep copy
        will copy the data, but will not do so recursively. Updating a nested
        data object will be reflected in the deep copy.
 
        >>> s = pd.Series([[1, 2], [3, 4]])
        >>> deep = s.copy()
        >>> s[0][0] = 10
        >>> s
        0    [10, 2]
        1     [3, 4]
        dtype: object
        >>> deep
        0    [10, 2]
        1     [3, 4]
        dtype: object
        rÓr¬r+)r›r¬r!rÉrÊ)r³rÔr«r´r´rµr¬Æsnz NDFrame.copycCs |j|dSrrH)r³rÔr´r´rµÚ__copy__8szNDFrame.__copy__cCs |jddS)zq
        Parameters
        ----------
        memo, default None
            Standard signature. Unused
        TrÓrH)r³Úmemor´r´rµÚ __deepcopy__<szNDFrame.__deepcopy__)r³r¬r®cCs"|jj|d}| |¡j|ddS)a_
        Attempt to infer better dtypes for object columns.
 
        Attempts soft conversion of object-dtyped
        columns, leaving non-object and unconvertible
        columns unchanged. The inference rules are the
        same as during normal Series/DataFrame construction.
 
        Parameters
        ----------
        copy : bool, default True
            Whether to make a copy for non-object or non-inferrable columns
            or Series.
 
        Returns
        -------
        same type as input object
 
        See Also
        --------
        to_datetime : Convert argument to datetime.
        to_timedelta : Convert argument to timedelta.
        to_numeric : Convert argument to numeric type.
        convert_dtypes : Convert argument to best possible dtype.
 
        Examples
        --------
        >>> df = pd.DataFrame({"A": ["a", 1, 2, 3]})
        >>> df = df.iloc[1:]
        >>> df
           A
        1  1
        2  2
        3  3
 
        >>> df.dtypes
        A    object
        dtype: object
 
        >>> df.infer_objects().dtypes
        A    int64
        dtype: object
        rHÚ infer_objectsr+)r›ÚconvertrÉrÊ)r³r¬rËr´r´rµr»Fs-zNDFrame.infer_objectsÚnumpy_nullabler$)r³r»Úconvert_stringÚconvert_integerÚconvert_booleanÚconvert_floatingÚ dtype_backendr®c
s¦tˆƒ|jdkr(|jˆˆˆˆˆˆdS‡‡‡‡‡‡fdd„| ¡Dƒ}t|ƒdkr–t|dd|jd}ttd|j    ƒ}    |    |ƒ}|j
|d    d
}tt |ƒS|j d d Sd S) az
        Convert columns to the best possible dtypes using dtypes supporting ``pd.NA``.
 
        Parameters
        ----------
        infer_objects : bool, default True
            Whether object dtypes should be converted to the best possible types.
        convert_string : bool, default True
            Whether object dtypes should be converted to ``StringDtype()``.
        convert_integer : bool, default True
            Whether, if possible, conversion can be done to integer extension types.
        convert_boolean : bool, defaults True
            Whether object dtypes should be converted to ``BooleanDtypes()``.
        convert_floating : bool, defaults True
            Whether, if possible, conversion can be done to floating extension types.
            If `convert_integer` is also True, preference will be give to integer
            dtypes if the floats can be faithfully casted to integers.
 
            .. versionadded:: 1.2.0
        dtype_backend : {"numpy_nullable", "pyarrow"}, default "numpy_nullable"
            Which dtype_backend to use, e.g. whether a DataFrame should use nullable
            dtypes for all dtypes that have a nullable
            implementation when "numpy_nullable" is set, pyarrow is used for all
            dtypes if "pyarrow" is set.
 
            The dtype_backends are still experimential.
 
            .. versionadded:: 2.0
 
        Returns
        -------
        Series or DataFrame
            Copy of input object with new dtype.
 
        See Also
        --------
        infer_objects : Infer dtypes of objects.
        to_datetime : Convert argument to datetime.
        to_timedelta : Convert argument to timedelta.
        to_numeric : Convert argument to a numeric type.
 
        Notes
        -----
        By default, ``convert_dtypes`` will attempt to convert a Series (or each
        Series in a DataFrame) to dtypes that support ``pd.NA``. By using the options
        ``convert_string``, ``convert_integer``, ``convert_boolean`` and
        ``convert_floating``, it is possible to turn off individual conversions
        to ``StringDtype``, the integer extension types, ``BooleanDtype``
        or floating extension types, respectively.
 
        For object-dtyped columns, if ``infer_objects`` is ``True``, use the inference
        rules as during normal Series/DataFrame construction.  Then, if possible,
        convert to ``StringDtype``, ``BooleanDtype`` or an appropriate integer
        or floating extension type, otherwise leave as ``object``.
 
        If the dtype is integer, convert to an appropriate integer extension type.
 
        If the dtype is numeric, and consists of all integers, convert to an
        appropriate integer extension type. Otherwise, convert to an
        appropriate floating extension type.
 
        .. versionchanged:: 1.2
            Starting with pandas 1.2, this method also converts float columns
            to the nullable floating extension type.
 
        In the future, as new dtypes are added that support ``pd.NA``, the results
        of this method will change to support those new dtypes.
 
        Examples
        --------
        >>> df = pd.DataFrame(
        ...     {
        ...         "a": pd.Series([1, 2, 3], dtype=np.dtype("int32")),
        ...         "b": pd.Series(["x", "y", "z"], dtype=np.dtype("O")),
        ...         "c": pd.Series([True, False, np.nan], dtype=np.dtype("O")),
        ...         "d": pd.Series(["h", "i", np.nan], dtype=np.dtype("O")),
        ...         "e": pd.Series([10, np.nan, 20], dtype=np.dtype("float")),
        ...         "f": pd.Series([np.nan, 100.5, 200], dtype=np.dtype("float")),
        ...     }
        ... )
 
        Start with a DataFrame with default dtypes.
 
        >>> df
           a  b      c    d     e      f
        0  1  x   True    h  10.0    NaN
        1  2  y  False    i   NaN  100.5
        2  3  z    NaN  NaN  20.0  200.0
 
        >>> df.dtypes
        a      int32
        b     object
        c     object
        d     object
        e    float64
        f    float64
        dtype: object
 
        Convert the DataFrame to use best possible dtypes.
 
        >>> dfn = df.convert_dtypes()
        >>> dfn
           a  b      c     d     e      f
        0  1  x   True     h    10   <NA>
        1  2  y  False     i  <NA>  100.5
        2  3  z   <NA>  <NA>    20  200.0
 
        >>> dfn.dtypes
        a             Int32
        b    string[python]
        c           boolean
        d    string[python]
        e             Int64
        f           Float64
        dtype: object
 
        Start with a Series of strings and missing data represented by ``np.nan``.
 
        >>> s = pd.Series(["a", "b", np.nan])
        >>> s
        0      a
        1      b
        2    NaN
        dtype: object
 
        Obtain a Series with dtype ``StringDtype``.
 
        >>> s.convert_dtypes()
        0       a
        1       b
        2    <NA>
        dtype: string
        r»©rÂc
s&g|]\}}|jˆˆˆˆˆˆd‘qS)rÃ)Ú_convert_dtypes)rêrµr*©rÀrÁr¿r¾rÂr»r´rµrs    øúz*NDFrame.convert_dtypes.<locals>.<listcomp>rF)rºr¬rrÚconvert_dtypesr+NrÓ) rJrørÄr½rÀr…rörrrÉrÊr3r¬)
r³r»r¾r¿rÀrÁrÂr¶r4Úconsr´rÅrµrÆvs*
ú        ÷ 
zNDFrame.convert_dtypes©r,rºr˜rbÚdowncastz'Hashable | Mapping | Series | DataFramezFillnaOptions | None)r³rÏr,rºr˜rbrÉr®cCsdSrÐr´©r³rÏr,rºr˜rbrÉr´r´rµÚfillna(s zNDFrame.fillna)r,rºrbrÉ)rÏr,rºr˜rbrÉr®cCsdSrÐr´rÊr´r´rµrË5s cCsdSrÐr´rÊr´r´rµrËBs cCs¬t|dƒ}t||ƒ\}}|dkr$d}| |¡}|dkr€|jjsf|dkrf|rPtƒ‚|jj||dj}|S|jj|||||d}n|j    dkrt
|t t fƒrât |ƒs¶|rªdS|jddSddlm}    |    |ƒ}|j|jd    d
}|j}n t|ƒsìntd t|ƒj›d ƒ‚|jj||||d }nft
|t t fƒr|dkr<tdƒ‚tƒrR|jdd}n|r\|n| ¡}t
|t ƒ}
| ¡D]p\} } | |krސqv|
s˜|n| | ¡} || j| || d}|sÈ||| <qvt
|t ƒr|j|| jkrú||jdd…| f<n||| <nâ|j | ¡}t
|tƒr2t  !|j"d¡|}nNt
|t j#ƒr\|jj$dkr\| %¡d}n$t
|t j#ƒrx|jj$dks€tdƒ‚t&|ƒD]\\}}|j'dd…|f}|j'dd…|f}|j|jkrÖ||j'dd…|f<n | (||¡qˆqv|rú| )|¡S|Sn€t|ƒsB|dkr,|jj||dj}|}n|jj||||d }n>t
|t*ƒrn|j    dkrn| +| ,¡|¡j}nt-dt|ƒ›ƒ‚| .|¡}|rš| )|¡S|j/|ddSdS)a;
        Fill NA/NaN values using the specified method.
 
        Parameters
        ----------
        value : scalar, dict, Series, or DataFrame
            Value to use to fill holes (e.g. 0), alternately a
            dict/Series/DataFrame of values specifying which value to use for
            each index (for a Series) or column (for a DataFrame).  Values not
            in the dict/Series/DataFrame will not be filled. This value cannot
            be a list.
        method : {{'backfill', 'bfill', 'ffill', None}}, default None
            Method to use for filling holes in reindexed Series:
 
            * ffill: propagate last valid observation forward to next valid.
            * backfill / bfill: use next valid observation to fill gap.
 
        axis : {axes_single_arg}
            Axis along which to fill missing values. For `Series`
            this parameter is unused and defaults to 0.
        inplace : bool, default False
            If True, fill in-place. Note: this will modify any
            other views on this object (e.g., a no-copy slice for a column in a
            DataFrame).
        limit : int, default None
            If method is specified, this is the maximum number of consecutive
            NaN values to forward/backward fill. In other words, if there is
            a gap with more than this number of consecutive NaNs, it will only
            be partially filled. If method is not specified, this is the
            maximum number of entries along the entire axis where NaNs will be
            filled. Must be greater than 0 if not None.
        downcast : dict, default is None
            A dict of item->dtype of what to downcast if possible,
            or the string 'infer' which will try to downcast to an appropriate
            equal type (e.g. float64 to int64 if possible).
 
        Returns
        -------
        {klass} or None
            Object with missing values filled or None if ``inplace=True``.
 
        See Also
        --------
        interpolate : Fill NaN values using interpolation.
        reindex : Conform object to new index.
        asfreq : Convert TimeSeries to specified frequency.
 
        Examples
        --------
        >>> df = pd.DataFrame([[np.nan, 2, np.nan, 0],
        ...                    [3, 4, np.nan, 1],
        ...                    [np.nan, np.nan, np.nan, np.nan],
        ...                    [np.nan, 3, np.nan, 4]],
        ...                   columns=list("ABCD"))
        >>> df
             A    B   C    D
        0  NaN  2.0 NaN  0.0
        1  3.0  4.0 NaN  1.0
        2  NaN  NaN NaN  NaN
        3  NaN  3.0 NaN  4.0
 
        Replace all NaN elements with 0s.
 
        >>> df.fillna(0)
             A    B    C    D
        0  0.0  2.0  0.0  0.0
        1  3.0  4.0  0.0  1.0
        2  0.0  0.0  0.0  0.0
        3  0.0  3.0  0.0  4.0
 
        We can also propagate non-null values forward or backward.
 
        >>> df.fillna(method="ffill")
             A    B   C    D
        0  NaN  2.0 NaN  0.0
        1  3.0  4.0 NaN  1.0
        2  3.0  4.0 NaN  1.0
        3  3.0  3.0 NaN  4.0
 
        Replace all NaN elements in column 'A', 'B', 'C', and 'D', with 0, 1,
        2, and 3 respectively.
 
        >>> values = {{"A": 0, "B": 1, "C": 2, "D": 3}}
        >>> df.fillna(value=values)
             A    B    C    D
        0  0.0  2.0  2.0  0.0
        1  3.0  4.0  2.0  1.0
        2  0.0  1.0  2.0  3.0
        3  0.0  3.0  2.0  4.0
 
        Only replace the first NaN element.
 
        >>> df.fillna(value=values, limit=1)
             A    B    C    D
        0  0.0  2.0  2.0  0.0
        1  3.0  4.0  NaN  1.0
        2  NaN  1.0  NaN  3.0
        3  NaN  3.0  NaN  4.0
 
        When filling using a DataFrame, replacement happens along
        the same column names and same indices
 
        >>> df2 = pd.DataFrame(np.zeros((4, 4)), columns=list("ABCE"))
        >>> df.fillna(df2)
             A    B    C    D
        0  0.0  2.0  0.0  0.0
        1  3.0  4.0  0.0  1.0
        2  0.0  0.0  0.0  NaN
        3  0.0  3.0  0.0  4.0
 
        Note that column D is not affected since it is not present in df2.
        r˜Nrr»©r,rb)r,rºrbr˜rÉrÓr“FrHzF"value" parameter must be a scalar, dict or Series, but you passed a "r6)rÏrbr˜rÉz9Currently only can fill with dict/Series column by column)rbrÉÚbrþzVUnexpected get_loc result, please report a bug at https://github.com/pandas-dev/pandas)rÏrbr÷zinvalid fill value with a rËr+)0rLrMròr›r/rÙr:rËÚ interpolaterør¿r²rcrÀr¬r³r”rdrÞr.r[rGr`rÚrr½r%r¸rOrörJr7rÚarangerrKrØrLrúr9ZisetitemrMrbÚwherergrñrÉrÊ)r³rÏr,rºr˜rbrÉr4rjr”Zis_dictrr    Z
downcast_kZres_kÚlocsrþrOZres_locr~r´r´rµrËOsÎ{
 
û
   ÿÿ
 
ÿ
 
ÿý  
 
ÿ
ÿ
ÿ
ÿÿ
 
 
ÿ
 
©rºr˜rbrÉz None | Axisz
None | int)r³rºr˜rbrÉr®cCsdSrÐr´©r³rºr˜rbrÉr´r´rµÚffillUs    z NDFrame.ffill)rºrbrÉ)rºr˜rbrÉr®cCsdSrÐr´rÓr´r´rµrÔ`s    cCsdSrÐr´rÓr´r´rµrÔks    cCs|jd||||dS)zÓ
        Synonym for :meth:`DataFrame.fillna` with ``method='ffill'``.
 
        Returns
        -------
        {klass} or None
            Object with missing values filled or None if ``inplace=True``.
        rÔrÈ©rËrÓr´r´rµrÔvsÿcCs$tjdttƒd|j||||dS)a3
        Synonym for :meth:`DataFrame.fillna` with ``method='ffill'``.
 
        .. deprecated:: 2.0
 
            {klass}.pad is deprecated. Use {klass}.ffill instead.
 
        Returns
        -------
        {klass} or None
            Object with missing values filled or None if ``inplace=True``.
        zPDataFrame.pad/Series.pad is deprecated. Use DataFrame.ffill/Series.ffill insteadrZrÒ)r]rYÚ FutureWarningrIrÔrÓr´r´rµÚpad‹s üz NDFrame.padcCsdSrÐr´rÓr´r´rµÚbfill¨s    z NDFrame.bfillcCsdSrÐr´rÓr´r´rµrسs    cCsdSrÐr´rÓr´r´rµrؾs    cCs|jd||||dS)zÓ
        Synonym for :meth:`DataFrame.fillna` with ``method='bfill'``.
 
        Returns
        -------
        {klass} or None
            Object with missing values filled or None if ``inplace=True``.
        rØrÈrÕrÓr´r´rµrØÉsÿcCs$tjdttƒd|j||||dS)a8
        Synonym for :meth:`DataFrame.fillna` with ``method='bfill'``.
 
        .. deprecated:: 2.0
 
            {klass}.backfill is deprecated. Use {klass}.bfill instead.
 
        Returns
        -------
        {klass} or None
            Object with missing values filled or None if ``inplace=True``.
        zZDataFrame.backfill/Series.backfill is deprecated. Use DataFrame.bfill/Series.bfill insteadrZrÒ)r]rYrÖrIrØrÓr´r´rµÚbackfillÞs üzNDFrame.backfill)r˜rbrŠr,z2Literal[('pad', 'ffill', 'bfill')] | lib.NoDefault)r³r˜rbrŠr,r®cCsdSrÐr´©r³Ú
to_replacerÏr˜rbrŠr,r´r´rµr–ûs zNDFrame.replace)rbrŠr,)r˜rbrŠr,r®cCsdSrÐr´rÚr´r´rµr–s cCsdSrÐr´rÚr´r´rµr–s r–r˜r™)r—r˜r™csþtˆƒs0tˆƒs0tˆƒs0tdttˆƒjƒ›ƒ‚t|dƒ}t|ƒsRˆdk    rRt    dƒ‚ˆt
j ksh|t
j k    rÒ|t
j krvd}t ˆƒsŒt |ƒsŒˆg‰t ˆttfƒrät ˆtƒrÔddlm}ˆj|jˆ|||fd}|rÐdS|Sˆ ˆ|||¡St ˆƒst |ƒsþtdƒ‚|‰d    }tˆ ¡ƒ}    |    r&t|    Ž\}
} n
gg}
} d
d „| Dƒ} t| ƒr´t| ƒsZtd ƒ‚i} i}|    D]@\}}tt| ¡Žƒp†ggf\}
} t|
ƒ| |<t| ƒ||<qf| |‰‰n
|
| ‰‰ˆjˆˆ|||d Sˆjsð|rädSˆjddSt ˆƒrzt ˆƒr,‡‡‡fdd„ˆ ¡Dƒ}ˆ |||¡StˆƒsnˆjdkrJt    dƒ‚‡fdd„ˆ ¡Dƒ}ˆ |||¡Stdƒ‚nXtˆƒrâtˆƒsœˆgtˆƒ‰tˆƒtˆƒkrÌt    dtˆƒ›dtˆƒ›dƒ‚ˆj j!ˆˆ||d}nðˆdkr6t|ƒs"t|ƒs"t |ƒs"tdtt|ƒjƒ›ƒ‚ˆj|ˆ||d    d St ˆƒrxˆjdkrTt    dƒ‚‡fdd„ˆ ¡Dƒ}ˆ |||¡Stˆƒsºt"|ˆƒ}|r¦ˆj j#ˆˆ|d}nˆj jˆˆ|d}ntdttˆƒjƒ›ƒ‚ˆ $|¡}|r술%|¡S|j&ˆddSdS) NzYExpecting 'to_replace' to be either a scalar, array-like, dict or None, got invalid type r˜z4'to_replace' must be 'None' if 'regex' is not a boolr×rr“)rzfIf "to_replace" and "value" are both None and "to_replace" is not a list, then regex must be a mappingTcSsg|] }t|ƒ‘qSr´)rW)rêr    r´r´rµrmsz#NDFrame.replace.<locals>.<listcomp>zSIf a nested mapping is passed, all values of the top level mapping must be mappings)r˜rbrŠrÓcs2i|]*}|ˆ ¡kr|ˆkr|ˆ|ˆ|f“qSr´)r)rêr*©r³rÛrÏr´rµrë‘s
 þz#NDFrame.replace.<locals>.<dictcomp>r»zASeries.replace cannot use dict-like to_replace and non-None valuecsi|]\}}||ˆf“qSr´r´)rêr*Zto_rep)rÏr´rµrë sz.value argument must be scalar, dict, or Seriesz2Replacement lists must match in length. Expecting z got r…)Zsrc_listZ    dest_listr˜rŠz|'regex' must be a string or a compiled regular expression or a list or dict of strings or regular expressions, you passed a z<Series.replace cannot use dict-value and non-None to_replacecsi|]\}}|ˆ|f“qSr´r´)rêr*Úval)rÛr´rµrëÑs)rÛrÏr˜zInvalid "to_replace" type: r–r+)'r_r^r[rGÚreprr`rÚrLrSrñrrWrWr¿rr¦rbr³r”rhZ_replace_singler½Úziprr]r–rr¬rZ_replace_columnwiserørÀr›Z replace_listrnZ replace_regexrÉrMrÊ)r³rÛrÏr˜rbrŠr,r”r4r½rrÂZ are_mappingsZ to_rep_dictZ
value_dictrr    r(rjr´rÜrµr–"sÿþýÿ
 
 
 
þ
ÿ 
 
 
ÿ   
ÿ 
 
þ
 ÿ
ÿ 
 
ÿü
ÿþýÿÿ
 ÿ
 
ýÿÿ
 
Úlinear)rºrbr˜Úlimit_directionÚ
limit_arearÉ)    r³r,rºrbr˜rárârÉr®c KsÞt|dƒ}| |¡}ddddg}    |dko.||    k}
|
r:|jn|} | jrL| ¡S||    krZ|j}t| jtƒrv|dkrvt    dƒ‚|d    kr|d
krŠd nd }n@|d kr°|d kr°t    d|›dƒ‚|d
krÐ|d krÐt    d|›dƒ‚| j
dkrøt   | j t  d¡k¡røtdƒ‚|dkrtt  t| jƒ¡ƒ} nT| j} ddddh} t| jƒpJt| jƒpJt| jƒ}|| krl|slt    d|›dƒ‚t| ƒ ¡r‚tdƒ‚| jjf||| |||||dœ|—Ž}| |¡}|
r¼|j}|rÌ| |¡S|j|ddSd    S)aŽ
        Fill NaN values using an interpolation method.
 
        Please note that only ``method='linear'`` is supported for
        DataFrame/Series with a MultiIndex.
 
        Parameters
        ----------
        method : str, default 'linear'
            Interpolation technique to use. One of:
 
            * 'linear': Ignore the index and treat the values as equally
              spaced. This is the only method supported on MultiIndexes.
            * 'time': Works on daily and higher resolution data to interpolate
              given length of interval.
            * 'index', 'values': use the actual numerical values of the index.
            * 'pad': Fill in NaNs using existing values.
            * 'nearest', 'zero', 'slinear', 'quadratic', 'cubic',
              'barycentric', 'polynomial': Passed to
              `scipy.interpolate.interp1d`, whereas 'spline' is passed to
              `scipy.interpolate.UnivariateSpline`. These methods use the numerical
              values of the index.  Both 'polynomial' and 'spline' require that
              you also specify an `order` (int), e.g.
              ``df.interpolate(method='polynomial', order=5)``. Note that,
              `slinear` method in Pandas refers to the Scipy first order `spline`
              instead of Pandas first order `spline`.
            * 'krogh', 'piecewise_polynomial', 'spline', 'pchip', 'akima',
              'cubicspline': Wrappers around the SciPy interpolation methods of
              similar names. See `Notes`.
            * 'from_derivatives': Refers to
              `scipy.interpolate.BPoly.from_derivatives` which
              replaces 'piecewise_polynomial' interpolation method in
              scipy 0.18.
 
        axis : {{0 or 'index', 1 or 'columns', None}}, default None
            Axis to interpolate along. For `Series` this parameter is unused
            and defaults to 0.
        limit : int, optional
            Maximum number of consecutive NaNs to fill. Must be greater than
            0.
        inplace : bool, default False
            Update the data in place if possible.
        limit_direction : {{'forward', 'backward', 'both'}}, Optional
            Consecutive NaNs will be filled in this direction.
 
            If limit is specified:
                * If 'method' is 'pad' or 'ffill', 'limit_direction' must be 'forward'.
                * If 'method' is 'backfill' or 'bfill', 'limit_direction' must be
                  'backwards'.
 
            If 'limit' is not specified:
                * If 'method' is 'backfill' or 'bfill', the default is 'backward'
                * else the default is 'forward'
 
            .. versionchanged:: 1.1.0
                raises ValueError if `limit_direction` is 'forward' or 'both' and
                    method is 'backfill' or 'bfill'.
                raises ValueError if `limit_direction` is 'backward' or 'both' and
                    method is 'pad' or 'ffill'.
 
        limit_area : {{`None`, 'inside', 'outside'}}, default None
            If limit is specified, consecutive NaNs will be filled with this
            restriction.
 
            * ``None``: No fill restriction.
            * 'inside': Only fill NaNs surrounded by valid values
              (interpolate).
            * 'outside': Only fill NaNs outside valid values (extrapolate).
 
        downcast : optional, 'infer' or None, defaults to None
            Downcast dtypes if possible.
        ``**kwargs`` : optional
            Keyword arguments to pass on to the interpolating function.
 
        Returns
        -------
        Series or DataFrame or None
            Returns the same object type as the caller, interpolated at
            some or all ``NaN`` values or None if ``inplace=True``.
 
        See Also
        --------
        fillna : Fill missing values using different methods.
        scipy.interpolate.Akima1DInterpolator : Piecewise cubic polynomials
            (Akima interpolator).
        scipy.interpolate.BPoly.from_derivatives : Piecewise polynomial in the
            Bernstein basis.
        scipy.interpolate.interp1d : Interpolate a 1-D function.
        scipy.interpolate.KroghInterpolator : Interpolate polynomial (Krogh
            interpolator).
        scipy.interpolate.PchipInterpolator : PCHIP 1-d monotonic cubic
            interpolation.
        scipy.interpolate.CubicSpline : Cubic spline data interpolator.
 
        Notes
        -----
        The 'krogh', 'piecewise_polynomial', 'spline', 'pchip' and 'akima'
        methods are wrappers around the respective SciPy implementations of
        similar names. These use the actual numerical values of the index.
        For more information on their behavior, see the
        `SciPy documentation
        <https://docs.scipy.org/doc/scipy/reference/interpolate.html#univariate-interpolation>`__.
 
        Examples
        --------
        Filling in ``NaN`` in a :class:`~pandas.Series` via linear
        interpolation.
 
        >>> s = pd.Series([0, 1, np.nan, 3])
        >>> s
        0    0.0
        1    1.0
        2    NaN
        3    3.0
        dtype: float64
        >>> s.interpolate()
        0    0.0
        1    1.0
        2    2.0
        3    3.0
        dtype: float64
 
        Filling in ``NaN`` in a Series by padding, but filling at most two
        consecutive ``NaN`` at a time.
 
        >>> s = pd.Series([np.nan, "single_one", np.nan,
        ...                "fill_two_more", np.nan, np.nan, np.nan,
        ...                4.71, np.nan])
        >>> s
        0              NaN
        1       single_one
        2              NaN
        3    fill_two_more
        4              NaN
        5              NaN
        6              NaN
        7             4.71
        8              NaN
        dtype: object
        >>> s.interpolate(method='pad', limit=2)
        0              NaN
        1       single_one
        2       single_one
        3    fill_two_more
        4    fill_two_more
        5    fill_two_more
        6              NaN
        7             4.71
        8             4.71
        dtype: object
 
        Filling in ``NaN`` in a Series via polynomial interpolation or splines:
        Both 'polynomial' and 'spline' methods require that you also specify
        an ``order`` (int).
 
        >>> s = pd.Series([0, 2, np.nan, 8])
        >>> s.interpolate(method='polynomial', order=2)
        0    0.000000
        1    2.000000
        2    4.666667
        3    8.000000
        dtype: float64
 
        Fill the DataFrame forward (that is, going down) along each column
        using linear interpolation.
 
        Note how the last entry in column 'a' is interpolated differently,
        because there is no entry after it to use for interpolation.
        Note how the first entry in column 'b' remains ``NaN``, because there
        is no entry before it to use for interpolation.
 
        >>> df = pd.DataFrame([(0.0, np.nan, -1.0, 1.0),
        ...                    (np.nan, 2.0, np.nan, np.nan),
        ...                    (2.0, 3.0, np.nan, 9.0),
        ...                    (np.nan, 4.0, -4.0, 16.0)],
        ...                   columns=list('abcd'))
        >>> df
             a    b    c     d
        0  0.0  NaN -1.0   1.0
        1  NaN  2.0  NaN   NaN
        2  2.0  3.0  NaN   9.0
        3  NaN  4.0 -4.0  16.0
        >>> df.interpolate(method='linear', limit_direction='forward', axis=0)
             a    b    c     d
        0  0.0  NaN -1.0   1.0
        1  1.0  2.0 -2.0   5.0
        2  2.0  3.0 -3.0   9.0
        3  2.0  4.0 -4.0  16.0
 
        Using polynomial interpolation.
 
        >>> df['d'].interpolate(method='polynomial', order=2)
        0     1.0
        1     4.0
        2     9.0
        3    16.0
        Name: d, dtype: float64
        r˜rÔrØr×rÙr»ràz@Only `method=linear` interpolation is supported on MultiIndexes.N)rÙrØZbackwardZforward)r×rÔz0`limit_direction` must be 'forward' for method `ú`z1`limit_direction` must be 'backward' for method `r÷r°zvCannot interpolate with all object-dtype columns in the DataFrame. Try setting at least one column to a numeric dtype.rÞrÂZnearestÚtimez9Index column must be numeric or datetime type when using z_ method other than linear. Try setting a numeric or datetime index column before interpolating.zkInterpolation with NaNs in the index has not been implemented. Try filling those NaNs before interpolating.)r,rºrÞrbrárâr˜rÉrÎr+)rLròr:r™r¬rãr¿rÞrurñrørr]rœr¸rGrtrÏrÀr]rUr`rfrrÙr›rÎrÉrMrÊ)r³r,rºrbr˜rárârÉríZfillna_methodsZshould_transposer rÞÚmethodsZis_numeric_or_datetimerjr4r´r´rµrÎës€S
 
 ÿÿ
ÿ
ÿ ÿ
  ÿý
ÿÿø    ÷
 
zNDFrame.interpolatec Cst|tƒrt|ƒ}|jjs"tdƒ‚t|tƒ}|rB|dk    r^tdƒ‚n|dkrP|j}t|ƒs^|g}t|ƒ}|s|jd}t|jt    ƒr’t
||jj d}||kr¸|s²|j |j|t jdSt jS|r|jj|dd}|dkrÞ|d    8}|j}|dkrt||ƒr|d    8}qä||St|tƒs2|r(t|ƒnt|gƒ}|r@| ¡n|| ¡jd    d
}| ¡rÈ|r‚td |ƒ}|jt j||jd S|r¦td |ƒ}|jt j||jdStd |ƒ}|j t j|j|dd S|j ||j¡}    |    dk}
| |    ¡} || _|
 ¡rt j| j|
<|r| S| jdS)a‹
        Return the last row(s) without any NaNs before `where`.
 
        The last row (for each element in `where`, if list) without any
        NaN is taken.
        In case of a :class:`~pandas.DataFrame`, the last row without NaN
        considering only the subset of columns (if not `None`)
 
        If there is no good value, NaN is returned for a Series or
        a Series of NaN values for a DataFrame
 
        Parameters
        ----------
        where : date or array-like of dates
            Date(s) before which the last row(s) are returned.
        subset : str or array-like of str, default `None`
            For DataFrame, if not `None`, only use these columns to
            check for NaNs.
 
        Returns
        -------
        scalar, Series, or DataFrame
 
            The return can be:
 
            * scalar : when `self` is a Series and `where` is a scalar
            * Series: when `self` is a Series and `where` is an array-like,
              or when `self` is a DataFrame and `where` is a scalar
            * DataFrame : when `self` is a DataFrame and `where` is an
              array-like
 
            Return scalar, Series, or DataFrame.
 
        See Also
        --------
        merge_asof : Perform an asof merge. Similar to left join.
 
        Notes
        -----
        Dates are assumed to be sorted. Raises if this is not the case.
 
        Examples
        --------
        A Series and a scalar `where`.
 
        >>> s = pd.Series([1, 2, np.nan, 4], index=[10, 20, 30, 40])
        >>> s
        10    1.0
        20    2.0
        30    NaN
        40    4.0
        dtype: float64
 
        >>> s.asof(20)
        2.0
 
        For a sequence `where`, a Series is returned. The first value is
        NaN, because the first element of `where` is before the first
        index value.
 
        >>> s.asof([5, 20])
        5     NaN
        20    2.0
        dtype: float64
 
        Missing values are not considered. The following is ``2.0``, not
        NaN, even though NaN is at the index location for ``30``.
 
        >>> s.asof(30)
        2.0
 
        Take all columns into consideration
 
        >>> df = pd.DataFrame({'a': [10, 20, 30, 40, 50],
        ...                    'b': [None, None, None, None, 500]},
        ...                   index=pd.DatetimeIndex(['2018-02-27 09:01:00',
        ...                                           '2018-02-27 09:02:00',
        ...                                           '2018-02-27 09:03:00',
        ...                                           '2018-02-27 09:04:00',
        ...                                           '2018-02-27 09:05:00']))
        >>> df.asof(pd.DatetimeIndex(['2018-02-27 09:03:30',
        ...                           '2018-02-27 09:04:30']))
                              a   b
        2018-02-27 09:03:30 NaN NaN
        2018-02-27 09:04:30 NaN NaN
 
        Take a single column into consideration
 
        >>> df.asof(pd.DatetimeIndex(['2018-02-27 09:03:30',
        ...                           '2018-02-27 09:04:30']),
        ...         subset=['a'])
                              a   b
        2018-02-27 09:03:30  30 NaN
        2018-02-27 09:04:30  40 NaN
        zasof requires a sorted indexNzsubset is not valid for Seriesr)Úfreq)rÞrÿr¸Úright©Zsider»r¹r”)rÞrÿrrUr@)r¿r§rrÞÚis_monotonic_increasingrñrcrör[rvrrærMrÚfloat64ÚnanÚ searchsortedr.rfrtrr]rrÉrÿZ    asof_locsrBrOr9) r³rÐr Ú    is_seriesZis_listÚstartrOrÂZnullsrÑÚmissingr«r´r´rµÚasofspa
 
 
 
 ÿ
 "
 
 
 
ÿ
 
 z NDFrame.asofcCst|ƒj|ddS)ah
        Detect missing values.
 
        Return a boolean same-sized object indicating if the values are NA.
        NA values, such as None or :attr:`numpy.NaN`, gets mapped to True
        values.
        Everything else gets mapped to False values. Characters such as empty
        strings ``''`` or :attr:`numpy.inf` are not considered NA values
        (unless you set ``pandas.options.mode.use_inf_as_na = True``).
 
        Returns
        -------
        {klass}
            Mask of bool values for each element in {klass} that
            indicates whether an element is an NA value.
 
        See Also
        --------
        {klass}.isnull : Alias of isna.
        {klass}.notna : Boolean inverse of isna.
        {klass}.dropna : Omit axes labels with missing values.
        isna : Top-level isna.
 
        Examples
        --------
        Show which entries in a DataFrame are NA.
 
        >>> df = pd.DataFrame(dict(age=[5, 6, np.NaN],
        ...                        born=[pd.NaT, pd.Timestamp('1939-05-27'),
        ...                              pd.Timestamp('1940-04-25')],
        ...                        name=['Alfred', 'Batman', ''],
        ...                        toy=[None, 'Batmobile', 'Joker']))
        >>> df
           age       born    name        toy
        0  5.0        NaT  Alfred       None
        1  6.0 1939-05-27  Batman  Batmobile
        2  NaN 1940-04-25              Joker
 
        >>> df.isna()
             age   born   name    toy
        0  False   True  False   True
        1  False  False  False  False
        2   True  False  False  False
 
        Show which entries in a Series are NA.
 
        >>> ser = pd.Series([5, 6, np.NaN])
        >>> ser
        0    5.0
        1    6.0
        2    NaN
        dtype: float64
 
        >>> ser.isna()
        0    False
        1    False
        2     True
        dtype: bool
        rfr+©rfrÊrÎr´r´rµrfÆs=z NDFrame.isnacCst|ƒj|ddS)NÚisnullr+rñrÎr´r´rµròszNDFrame.isnullcCst|ƒj|ddS)aƒ
        Detect existing (non-missing) values.
 
        Return a boolean same-sized object indicating if the values are not NA.
        Non-missing values get mapped to True. Characters such as empty
        strings ``''`` or :attr:`numpy.inf` are not considered NA values
        (unless you set ``pandas.options.mode.use_inf_as_na = True``).
        NA values, such as None or :attr:`numpy.NaN`, get mapped to False
        values.
 
        Returns
        -------
        {klass}
            Mask of bool values for each element in {klass} that
            indicates whether an element is not an NA value.
 
        See Also
        --------
        {klass}.notnull : Alias of notna.
        {klass}.isna : Boolean inverse of notna.
        {klass}.dropna : Omit axes labels with missing values.
        notna : Top-level notna.
 
        Examples
        --------
        Show which entries in a DataFrame are not NA.
 
        >>> df = pd.DataFrame(dict(age=[5, 6, np.NaN],
        ...                        born=[pd.NaT, pd.Timestamp('1939-05-27'),
        ...                              pd.Timestamp('1940-04-25')],
        ...                        name=['Alfred', 'Batman', ''],
        ...                        toy=[None, 'Batmobile', 'Joker']))
        >>> df
           age       born    name        toy
        0  5.0        NaT  Alfred       None
        1  6.0 1939-05-27  Batman  Batmobile
        2  NaN 1940-04-25              Joker
 
        >>> df.notna()
             age   born  name    toy
        0   True  False  True  False
        1   True   True  True   True
        2  False   True  True   True
 
        Show which entries in a Series are not NA.
 
        >>> ser = pd.Series([5, 6, np.NaN])
        >>> ser
        0    5.0
        1    6.0
        2    NaN
        dtype: float64
 
        >>> ser.notna()
        0     True
        1     True
        2    False
        dtype: bool
        rgr+©rgrÊrÎr´r´rµrg    s=z NDFrame.notnacCst|ƒj|ddS)NÚnotnullr+rórÎr´r´rµrôHszNDFrame.notnull©r˜c    CsÈ|dk    rt t|ƒ¡s,|dk    r4t t|ƒ¡r4tdƒ‚|}t|jƒ}tjddJ|dk    rr||k}|j||ddd}|dk    r”||k}|j||ddd}W5QRXt |¡r²tj||<|rÀ| |¡S|SdS)Nz*Cannot use an NA value as a clip thresholdr;)r]Fr)    rrrfrñr.ZerrstaterÐrërM)r³ÚlowerÚupperr˜r4rmr r´r´rµÚ_clip_with_scalarLs(ÿ ÿ
 
 
 
zNDFrame._clip_with_scalarcCsä|dk    r| |¡}t|ƒrLt|ƒrL|jdkr<|jd||dS|j|d|dSt|tƒsŽt|ƒrŽt|tƒrz|j||j    d}nt
|||ddd}t|ƒrº|jdkr¦t j nt j }|  |¡}n|}|||dt|ƒB}|j||||dS)NÚlerõ)rÞ)Zflexr»r¹r)ròr_r\rÚrør¿rcr[rÉrÞr„rr¿rËrfrÐ)r³Ú    thresholdr,rºr˜r€Z threshold_infr r´r´rµÚ_clip_with_one_boundfs 
 
 
 zNDFrame._clip_with_one_boundr)r³rºr˜r®c    KsJt|dƒ}t |d|¡}|dk    r*| |¡}t|ƒ}t|ƒsJt |¡rXd}nt |¡rXd}t|ƒ}t|ƒsxt |¡r†d}nt |¡r†d}|dk    r¼|dk    r¼t    |ƒr¼t    |ƒr¼t
||ƒt ||ƒ}}|dksÔt    |ƒrüt |ƒrü|dksìt    |ƒrüt |ƒrü|j |||dS|}|dk    r|j||j||d}|dk    rF|r2|}|j||j||d}|S)a½
        Trim values at input threshold(s).
 
        Assigns values outside boundary to boundary values. Thresholds
        can be singular values or array like, and in the latter case
        the clipping is performed element-wise in the specified axis.
 
        Parameters
        ----------
        lower : float or array-like, default None
            Minimum threshold value. All values below this
            threshold will be set to it. A missing
            threshold (e.g `NA`) will not clip the value.
        upper : float or array-like, default None
            Maximum threshold value. All values above this
            threshold will be set to it. A missing
            threshold (e.g `NA`) will not clip the value.
        axis : {{0 or 'index', 1 or 'columns', None}}, default None
            Align object with lower and upper along the given axis.
            For `Series` this parameter is unused and defaults to `None`.
        inplace : bool, default False
            Whether to perform the operation in place on the data.
        *args, **kwargs
            Additional keywords have no effect but might be accepted
            for compatibility with numpy.
 
        Returns
        -------
        Series or DataFrame or None
            Same type as calling object with the values outside the
            clip boundaries replaced or None if ``inplace=True``.
 
        See Also
        --------
        Series.clip : Trim values at input threshold in series.
        DataFrame.clip : Trim values at input threshold in dataframe.
        numpy.clip : Clip (limit) the values in an array.
 
        Examples
        --------
        >>> data = {'col_0': [9, -3, 0, -1, 5], 'col_1': [-2, -7, 6, 8, -5]}
        >>> df = pd.DataFrame(data)
        >>> df
           col_0  col_1
        0      9     -2
        1     -3     -7
        2      0      6
        3     -1      8
        4      5     -5
 
        Clips per column using lower and upper thresholds:
 
        >>> df.clip(-4, 6)
           col_0  col_1
        0      6     -2
        1     -3     -4
        2      0      6
        3     -1      6
        4      5     -4
 
        Clips using specific lower and upper thresholds per column element:
 
        >>> t = pd.Series([2, -4, -1, 6, 3])
        >>> t
        0    2
        1   -4
        2   -1
        3    6
        4    3
        dtype: int64
 
        >>> df.clip(t, t + 4, axis=0)
           col_0  col_1
        0      6      2
        1     -3     -4
        2      0      3
        3      6      8
        4      5      3
 
        Clips using specific lower threshold per column element, with missing values:
 
        >>> t = pd.Series([2, -4, np.NaN, 6, 3])
        >>> t
        0    2.0
        1   -4.0
        2    NaN
        3    6.0
        4    3.0
        dtype: float64
 
        >>> df.clip(t, axis=0)
        col_0  col_1
        0      9      2
        1     -3     -4
        2      0      6
        3      6      8
        4      5      3
        r˜r´Nrõ)r,rºr˜)rLr?Zvalidate_clip_with_axisròrfr[rrr]r_ÚminÚmaxr\rørûÚgerù)    r³rör÷rºr˜ríZ
isna_lowerZ
isna_upperr4r´r´rµÚclip‡sfk
 
 
 
 
 
ÿþýüÿÿÿ
ÿ
ÿz NDFrame.clipr*)r³rær,ÚhowÚ    normalizer€r®cCs ddlm}|||||||dS)a±
        Convert time series to specified frequency.
 
        Returns the original data conformed to a new index with the specified
        frequency.
 
        If the index of this {klass} is a :class:`~pandas.PeriodIndex`, the new index
        is the result of transforming the original index with
        :meth:`PeriodIndex.asfreq <pandas.PeriodIndex.asfreq>` (so the original index
        will map one-to-one to the new index).
 
        Otherwise, the new index will be equivalent to ``pd.date_range(start, end,
        freq=freq)`` where ``start`` and ``end`` are, respectively, the first and
        last entries in the original index (see :func:`pandas.date_range`). The
        values corresponding to any timesteps in the new index which were not present
        in the original index will be null (``NaN``), unless a method for filling
        such unknowns is provided (see the ``method`` parameter below).
 
        The :meth:`resample` method is more appropriate if an operation on each group of
        timesteps (such as an aggregate) is necessary to represent the data at the new
        frequency.
 
        Parameters
        ----------
        freq : DateOffset or str
            Frequency DateOffset or string.
        method : {{'backfill'/'bfill', 'pad'/'ffill'}}, default None
            Method to use for filling holes in reindexed Series (note this
            does not fill NaNs that already were present):
 
            * 'pad' / 'ffill': propagate last valid observation forward to next
              valid
            * 'backfill' / 'bfill': use NEXT valid observation to fill.
        how : {{'start', 'end'}}, default end
            For PeriodIndex only (see PeriodIndex.asfreq).
        normalize : bool, default False
            Whether to reset output index to midnight.
        fill_value : scalar, optional
            Value to use for missing values, applied during upsampling (note
            this does not fill NaNs that already were present).
 
        Returns
        -------
        {klass}
            {klass} object reindexed to the specified frequency.
 
        See Also
        --------
        reindex : Conform DataFrame to new index with optional filling logic.
 
        Notes
        -----
        To learn more about the frequency strings, please see `this link
        <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`__.
 
        Examples
        --------
        Start by creating a series with 4 one minute timestamps.
 
        >>> index = pd.date_range('1/1/2000', periods=4, freq='T')
        >>> series = pd.Series([0.0, None, 2.0, 3.0], index=index)
        >>> df = pd.DataFrame({{'s': series}})
        >>> df
                               s
        2000-01-01 00:00:00    0.0
        2000-01-01 00:01:00    NaN
        2000-01-01 00:02:00    2.0
        2000-01-01 00:03:00    3.0
 
        Upsample the series into 30 second bins.
 
        >>> df.asfreq(freq='30S')
                               s
        2000-01-01 00:00:00    0.0
        2000-01-01 00:00:30    NaN
        2000-01-01 00:01:00    NaN
        2000-01-01 00:01:30    NaN
        2000-01-01 00:02:00    2.0
        2000-01-01 00:02:30    NaN
        2000-01-01 00:03:00    3.0
 
        Upsample again, providing a ``fill value``.
 
        >>> df.asfreq(freq='30S', fill_value=9.0)
                               s
        2000-01-01 00:00:00    0.0
        2000-01-01 00:00:30    9.0
        2000-01-01 00:01:00    NaN
        2000-01-01 00:01:30    9.0
        2000-01-01 00:02:00    2.0
        2000-01-01 00:02:30    9.0
        2000-01-01 00:03:00    3.0
 
        Upsample again, providing a ``method``.
 
        >>> df.asfreq(freq='30S', method='bfill')
                               s
        2000-01-01 00:00:00    0.0
        2000-01-01 00:00:30    NaN
        2000-01-01 00:01:00    NaN
        2000-01-01 00:01:30    2.0
        2000-01-01 00:02:00    2.0
        2000-01-01 00:02:30    3.0
        2000-01-01 00:03:00    3.0
        r)Úasfreq)r,rrr€)Úpandas.core.resampler)r³rær,rrr€rr´r´rµr' sr úzNDFrame.asfreq)r³rðrºr®cCsP|dkr|j}| |¡}| |¡}t|tƒs4tdƒ‚|j||d}|j||dS)a'
        Select values at particular time of day (e.g., 9:30AM).
 
        Parameters
        ----------
        time : datetime.time or str
            The values to select.
        axis : {0 or 'index', 1 or 'columns'}, default 0
            For `Series` this parameter is unused and defaults to 0.
 
        Returns
        -------
        Series or DataFrame
 
        Raises
        ------
        TypeError
            If the index is not  a :class:`DatetimeIndex`
 
        See Also
        --------
        between_time : Select values between particular times of the day.
        first : Select initial periods of time series based on a date offset.
        last : Select final periods of time series based on a date offset.
        DatetimeIndex.indexer_at_time : Get just the index locations for
            values at particular time of the day.
 
        Examples
        --------
        >>> i = pd.date_range('2018-04-09', periods=4, freq='12H')
        >>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
        >>> ts
                             A
        2018-04-09 00:00:00  1
        2018-04-09 12:00:00  2
        2018-04-10 00:00:00  3
        2018-04-10 12:00:00  4
 
        >>> ts.at_time('12:00')
                             A
        2018-04-09 12:00:00  2
        2018-04-10 12:00:00  4
        NúIndex must be DatetimeIndex)rðr¹)r˜ròrèr¿rsrGZindexer_at_timerF)r³rärðrºrÞrCr´r´rµÚat_time¤ s/
 
 
zNDFrame.at_timeÚbothr.)r³Ú    inclusiverºr®c    Cs`|dkr|j}| |¡}| |¡}t|tƒs4tdƒ‚t|ƒ\}}|j||||d}|j||dS)a]
        Select values between particular times of the day (e.g., 9:00-9:30 AM).
 
        By setting ``start_time`` to be later than ``end_time``,
        you can get the times that are *not* between the two times.
 
        Parameters
        ----------
        start_time : datetime.time or str
            Initial time as a time filter limit.
        end_time : datetime.time or str
            End time as a time filter limit.
        inclusive : {"both", "neither", "left", "right"}, default "both"
            Include boundaries; whether to set each bound as closed or open.
        axis : {0 or 'index', 1 or 'columns'}, default 0
            Determine range time on index or columns value.
            For `Series` this parameter is unused and defaults to 0.
 
        Returns
        -------
        Series or DataFrame
            Data from the original object filtered to the specified dates range.
 
        Raises
        ------
        TypeError
            If the index is not  a :class:`DatetimeIndex`
 
        See Also
        --------
        at_time : Select values at a particular time of the day.
        first : Select initial periods of time series based on a date offset.
        last : Select final periods of time series based on a date offset.
        DatetimeIndex.indexer_between_time : Get just the index locations for
            values between particular times of the day.
 
        Examples
        --------
        >>> i = pd.date_range('2018-04-09', periods=4, freq='1D20min')
        >>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
        >>> ts
                             A
        2018-04-09 00:00:00  1
        2018-04-10 00:20:00  2
        2018-04-11 00:40:00  3
        2018-04-12 01:00:00  4
 
        >>> ts.between_time('0:15', '0:45')
                             A
        2018-04-10 00:20:00  2
        2018-04-11 00:40:00  3
 
        You get the times that are *not* between two times by setting
        ``start_time`` later than ``end_time``:
 
        >>> ts.between_time('0:45', '0:15')
                             A
        2018-04-09 00:00:00  1
        2018-04-12 01:00:00  4
        Nr)Z include_startZ include_endr¹)    r˜ròrèr¿rsrGrNZindexer_between_timerF)    r³Ú
start_timeZend_timerrºrÞZleft_inclusiveZright_inclusiverCr´r´rµÚ between_timeß sD
 
 
 üzNDFrame.between_timerîÚ    start_dayzstr | TimestampConvertibleTypesz TimedeltaConvertibleTypes | Noner’) rºÚclosedrAÚ
conventionrØÚonrÚoriginÚoffsetÚ
group_keysr®c Cs<ddlm} | |¡}| td|ƒ|||||||||    |
| d S)a³6
        Resample time-series data.
 
        Convenience method for frequency conversion and resampling of time series.
        The object must have a datetime-like index (`DatetimeIndex`, `PeriodIndex`,
        or `TimedeltaIndex`), or the caller must pass the label of a datetime-like
        series/index to the ``on``/``level`` keyword parameter.
 
        Parameters
        ----------
        rule : DateOffset, Timedelta or str
            The offset string or object representing target conversion.
        axis : {{0 or 'index', 1 or 'columns'}}, default 0
            Which axis to use for up- or down-sampling. For `Series` this parameter
            is unused and defaults to 0. Must be
            `DatetimeIndex`, `TimedeltaIndex` or `PeriodIndex`.
        closed : {{'right', 'left'}}, default None
            Which side of bin interval is closed. The default is 'left'
            for all frequency offsets except for 'M', 'A', 'Q', 'BM',
            'BA', 'BQ', and 'W' which all have a default of 'right'.
        label : {{'right', 'left'}}, default None
            Which bin edge label to label bucket with. The default is 'left'
            for all frequency offsets except for 'M', 'A', 'Q', 'BM',
            'BA', 'BQ', and 'W' which all have a default of 'right'.
        convention : {{'start', 'end', 's', 'e'}}, default 'start'
            For `PeriodIndex` only, controls whether to use the start or
            end of `rule`.
        kind : {{'timestamp', 'period'}}, optional, default None
            Pass 'timestamp' to convert the resulting index to a
            `DateTimeIndex` or 'period' to convert it to a `PeriodIndex`.
            By default the input representation is retained.
 
        on : str, optional
            For a DataFrame, column to use instead of index for resampling.
            Column must be datetime-like.
        level : str or int, optional
            For a MultiIndex, level (name or number) to use for
            resampling. `level` must be datetime-like.
        origin : Timestamp or str, default 'start_day'
            The timestamp on which to adjust the grouping. The timezone of origin
            must match the timezone of the index.
            If string, must be one of the following:
 
            - 'epoch': `origin` is 1970-01-01
            - 'start': `origin` is the first value of the timeseries
            - 'start_day': `origin` is the first day at midnight of the timeseries
 
            .. versionadded:: 1.1.0
 
            - 'end': `origin` is the last value of the timeseries
            - 'end_day': `origin` is the ceiling midnight of the last day
 
            .. versionadded:: 1.3.0
 
        offset : Timedelta or str, default is None
            An offset timedelta added to the origin.
 
            .. versionadded:: 1.1.0
 
        group_keys : bool, default False
            Whether to include the group keys in the result index when using
            ``.apply()`` on the resampled object.
 
            .. versionadded:: 1.5.0
 
                Not specifying ``group_keys`` will retain values-dependent behavior
                from pandas 1.4 and earlier (see :ref:`pandas 1.5.0 Release notes
                <whatsnew_150.enhancements.resample_group_keys>` for examples).
 
            .. versionchanged:: 2.0.0
 
                ``group_keys`` now defaults to ``False``.
 
        Returns
        -------
        pandas.core.Resampler
            :class:`~pandas.core.Resampler` object.
 
        See Also
        --------
        Series.resample : Resample a Series.
        DataFrame.resample : Resample a DataFrame.
        groupby : Group {klass} by mapping, function, label, or list of labels.
        asfreq : Reindex a {klass} with the given frequency without grouping.
 
        Notes
        -----
        See the `user guide
        <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling>`__
        for more.
 
        To learn more about the offset strings, please see `this link
        <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#dateoffset-objects>`__.
 
        Examples
        --------
        Start by creating a series with 9 one minute timestamps.
 
        >>> index = pd.date_range('1/1/2000', periods=9, freq='T')
        >>> series = pd.Series(range(9), index=index)
        >>> series
        2000-01-01 00:00:00    0
        2000-01-01 00:01:00    1
        2000-01-01 00:02:00    2
        2000-01-01 00:03:00    3
        2000-01-01 00:04:00    4
        2000-01-01 00:05:00    5
        2000-01-01 00:06:00    6
        2000-01-01 00:07:00    7
        2000-01-01 00:08:00    8
        Freq: T, dtype: int64
 
        Downsample the series into 3 minute bins and sum the values
        of the timestamps falling into a bin.
 
        >>> series.resample('3T').sum()
        2000-01-01 00:00:00     3
        2000-01-01 00:03:00    12
        2000-01-01 00:06:00    21
        Freq: 3T, dtype: int64
 
        Downsample the series into 3 minute bins as above, but label each
        bin using the right edge instead of the left. Please note that the
        value in the bucket used as the label is not included in the bucket,
        which it labels. For example, in the original series the
        bucket ``2000-01-01 00:03:00`` contains the value 3, but the summed
        value in the resampled bucket with the label ``2000-01-01 00:03:00``
        does not include 3 (if it did, the summed value would be 6, not 3).
        To include this value close the right side of the bin interval as
        illustrated in the example below this one.
 
        >>> series.resample('3T', label='right').sum()
        2000-01-01 00:03:00     3
        2000-01-01 00:06:00    12
        2000-01-01 00:09:00    21
        Freq: 3T, dtype: int64
 
        Downsample the series into 3 minute bins as above, but close the right
        side of the bin interval.
 
        >>> series.resample('3T', label='right', closed='right').sum()
        2000-01-01 00:00:00     0
        2000-01-01 00:03:00     6
        2000-01-01 00:06:00    15
        2000-01-01 00:09:00    15
        Freq: 3T, dtype: int64
 
        Upsample the series into 30 second bins.
 
        >>> series.resample('30S').asfreq()[0:5]   # Select first 5 rows
        2000-01-01 00:00:00   0.0
        2000-01-01 00:00:30   NaN
        2000-01-01 00:01:00   1.0
        2000-01-01 00:01:30   NaN
        2000-01-01 00:02:00   2.0
        Freq: 30S, dtype: float64
 
        Upsample the series into 30 second bins and fill the ``NaN``
        values using the ``ffill`` method.
 
        >>> series.resample('30S').ffill()[0:5]
        2000-01-01 00:00:00    0
        2000-01-01 00:00:30    0
        2000-01-01 00:01:00    1
        2000-01-01 00:01:30    1
        2000-01-01 00:02:00    2
        Freq: 30S, dtype: int64
 
        Upsample the series into 30 second bins and fill the
        ``NaN`` values using the ``bfill`` method.
 
        >>> series.resample('30S').bfill()[0:5]
        2000-01-01 00:00:00    0
        2000-01-01 00:00:30    1
        2000-01-01 00:01:00    1
        2000-01-01 00:01:30    2
        2000-01-01 00:02:00    2
        Freq: 30S, dtype: int64
 
        Pass a custom function via ``apply``
 
        >>> def custom_resampler(arraylike):
        ...     return np.sum(arraylike) + 5
        ...
        >>> series.resample('3T').apply(custom_resampler)
        2000-01-01 00:00:00     8
        2000-01-01 00:03:00    17
        2000-01-01 00:06:00    26
        Freq: 3T, dtype: int64
 
        For a Series with a PeriodIndex, the keyword `convention` can be
        used to control whether to use the start or end of `rule`.
 
        Resample a year by quarter using 'start' `convention`. Values are
        assigned to the first quarter of the period.
 
        >>> s = pd.Series([1, 2], index=pd.period_range('2012-01-01',
        ...                                             freq='A',
        ...                                             periods=2))
        >>> s
        2012    1
        2013    2
        Freq: A-DEC, dtype: int64
        >>> s.resample('Q', convention='start').asfreq()
        2012Q1    1.0
        2012Q2    NaN
        2012Q3    NaN
        2012Q4    NaN
        2013Q1    2.0
        2013Q2    NaN
        2013Q3    NaN
        2013Q4    NaN
        Freq: Q-DEC, dtype: float64
 
        Resample quarters by month using 'end' `convention`. Values are
        assigned to the last month of the period.
 
        >>> q = pd.Series([1, 2, 3, 4], index=pd.period_range('2018-01-01',
        ...                                                   freq='Q',
        ...                                                   periods=4))
        >>> q
        2018Q1    1
        2018Q2    2
        2018Q3    3
        2018Q4    4
        Freq: Q-DEC, dtype: int64
        >>> q.resample('M', convention='end').asfreq()
        2018-03    1.0
        2018-04    NaN
        2018-05    NaN
        2018-06    2.0
        2018-07    NaN
        2018-08    NaN
        2018-09    3.0
        2018-10    NaN
        2018-11    NaN
        2018-12    4.0
        Freq: M, dtype: float64
 
        For DataFrame objects, the keyword `on` can be used to specify the
        column instead of the index for resampling.
 
        >>> d = {{'price': [10, 11, 9, 13, 14, 18, 17, 19],
        ...      'volume': [50, 60, 40, 100, 50, 100, 40, 50]}}
        >>> df = pd.DataFrame(d)
        >>> df['week_starting'] = pd.date_range('01/01/2018',
        ...                                     periods=8,
        ...                                     freq='W')
        >>> df
           price  volume week_starting
        0     10      50    2018-01-07
        1     11      60    2018-01-14
        2      9      40    2018-01-21
        3     13     100    2018-01-28
        4     14      50    2018-02-04
        5     18     100    2018-02-11
        6     17      40    2018-02-18
        7     19      50    2018-02-25
        >>> df.resample('M', on='week_starting').mean()
                       price  volume
        week_starting
        2018-01-31     10.75    62.5
        2018-02-28     17.00    60.0
 
        For a DataFrame with MultiIndex, the keyword `level` can be used to
        specify on which level the resampling needs to take place.
 
        >>> days = pd.date_range('1/1/2000', periods=4, freq='D')
        >>> d2 = {{'price': [10, 11, 9, 13, 14, 18, 17, 19],
        ...       'volume': [50, 60, 40, 100, 50, 100, 40, 50]}}
        >>> df2 = pd.DataFrame(
        ...     d2,
        ...     index=pd.MultiIndex.from_product(
        ...         [days, ['morning', 'afternoon']]
        ...     )
        ... )
        >>> df2
                              price  volume
        2000-01-01 morning       10      50
                   afternoon     11      60
        2000-01-02 morning        9      40
                   afternoon     13     100
        2000-01-03 morning       14      50
                   afternoon     18     100
        2000-01-04 morning       17      40
                   afternoon     19      50
        >>> df2.resample('D', level=0).sum()
                    price  volume
        2000-01-01     21     110
        2000-01-02     22     140
        2000-01-03     32     150
        2000-01-04     36      90
 
        If you want to adjust the start of the bins based on a fixed timestamp:
 
        >>> start, end = '2000-10-01 23:30:00', '2000-10-02 00:30:00'
        >>> rng = pd.date_range(start, end, freq='7min')
        >>> ts = pd.Series(np.arange(len(rng)) * 3, index=rng)
        >>> ts
        2000-10-01 23:30:00     0
        2000-10-01 23:37:00     3
        2000-10-01 23:44:00     6
        2000-10-01 23:51:00     9
        2000-10-01 23:58:00    12
        2000-10-02 00:05:00    15
        2000-10-02 00:12:00    18
        2000-10-02 00:19:00    21
        2000-10-02 00:26:00    24
        Freq: 7T, dtype: int64
 
        >>> ts.resample('17min').sum()
        2000-10-01 23:14:00     0
        2000-10-01 23:31:00     9
        2000-10-01 23:48:00    21
        2000-10-02 00:05:00    54
        2000-10-02 00:22:00    24
        Freq: 17T, dtype: int64
 
        >>> ts.resample('17min', origin='epoch').sum()
        2000-10-01 23:18:00     0
        2000-10-01 23:35:00    18
        2000-10-01 23:52:00    27
        2000-10-02 00:09:00    39
        2000-10-02 00:26:00    24
        Freq: 17T, dtype: int64
 
        >>> ts.resample('17min', origin='2000-01-01').sum()
        2000-10-01 23:24:00     3
        2000-10-01 23:41:00    15
        2000-10-01 23:58:00    45
        2000-10-02 00:15:00    45
        Freq: 17T, dtype: int64
 
        If you want to adjust the start of the bins with an `offset` Timedelta, the two
        following lines are equivalent:
 
        >>> ts.resample('17min', origin='start').sum()
        2000-10-01 23:30:00     9
        2000-10-01 23:47:00    21
        2000-10-02 00:04:00    54
        2000-10-02 00:21:00    24
        Freq: 17T, dtype: int64
 
        >>> ts.resample('17min', offset='23h30min').sum()
        2000-10-01 23:30:00     9
        2000-10-01 23:47:00    21
        2000-10-02 00:04:00    54
        2000-10-02 00:21:00    24
        Freq: 17T, dtype: int64
 
        If you want to take the largest Timestamp as the end of the bins:
 
        >>> ts.resample('17min', origin='end').sum()
        2000-10-01 23:35:00     0
        2000-10-01 23:52:00    18
        2000-10-02 00:09:00    27
        2000-10-02 00:26:00    63
        Freq: 17T, dtype: int64
 
        In contrast with the `start_day`, you can use `end_day` to take the ceiling
        midnight of the largest Timestamp as the end of the bins and drop the bins
        not containing data:
 
        >>> ts.resample('17min', origin='end_day').sum()
        2000-10-01 23:38:00     3
        2000-10-01 23:55:00    15
        2000-10-02 00:12:00    45
        2000-10-02 00:29:00    45
        Freq: 17T, dtype: int64
        r)Ú get_resamplerzSeries | DataFrame) rærAr rºrØr rrrrr)rrròr) r³Zrulerºr rAr rØr rrrrrr´r´rµÚresample4!s& 
ôzNDFrame.resamplecCs¼t|jtƒstdƒ‚t|jƒdkr.|jddSt|ƒ}t|tƒsj| |jd¡rj|jd|j    |}}n|jd|}}t|tƒr®||jkr®|jj
|dd}|j d|…S|j d|…S)aþ
        Select initial periods of time series data based on a date offset.
 
        For a DataFrame with a sorted DatetimeIndex, this function can
        select the first few rows based on a date offset.
 
        Parameters
        ----------
        offset : str, DateOffset or dateutil.relativedelta
            The offset length of the data that will be selected. For instance,
            '1M' will display all the rows having their index within the first month.
 
        Returns
        -------
        Series or DataFrame
            A subset of the caller.
 
        Raises
        ------
        TypeError
            If the index is not  a :class:`DatetimeIndex`
 
        See Also
        --------
        last : Select final periods of time series based on a date offset.
        at_time : Select values at a particular time of the day.
        between_time : Select values between particular times of the day.
 
        Examples
        --------
        >>> i = pd.date_range('2018-04-09', periods=4, freq='2D')
        >>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
        >>> ts
                    A
        2018-04-09  1
        2018-04-11  2
        2018-04-13  3
        2018-04-15  4
 
        Get the rows for the first 3 days:
 
        >>> ts.first('3D')
                    A
        2018-04-09  1
        2018-04-11  2
 
        Notice the data for 3 first calendar days were returned, not the first
        3 days observed in the dataset, and therefore data for 2018-04-13 was
        not returned.
        z+'first' only supports a DatetimeIndex indexrFrÓÚleftrèN) r¿rÞrsrGrÀr¬rrZ is_on_offsetÚbaserìr9rO)r³rÚend_dateÚendr´r´rµÚfirstÇ"s4  z NDFrame.firstcCsbt|jtƒstdƒ‚t|jƒdkr.|jddSt|ƒ}|jd|}|jj|dd}|j|d…S)    aõ
        Select final periods of time series data based on a date offset.
 
        For a DataFrame with a sorted DatetimeIndex, this function
        selects the last few rows based on a date offset.
 
        Parameters
        ----------
        offset : str, DateOffset, dateutil.relativedelta
            The offset length of the data that will be selected. For instance,
            '3D' will display all the rows having their index within the last 3 days.
 
        Returns
        -------
        Series or DataFrame
            A subset of the caller.
 
        Raises
        ------
        TypeError
            If the index is not  a :class:`DatetimeIndex`
 
        See Also
        --------
        first : Select initial periods of time series based on a date offset.
        at_time : Select values at a particular time of the day.
        between_time : Select values between particular times of the day.
 
        Examples
        --------
        >>> i = pd.date_range('2018-04-09', periods=4, freq='2D')
        >>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
        >>> ts
                    A
        2018-04-09  1
        2018-04-11  2
        2018-04-13  3
        2018-04-15  4
 
        Get the rows for the last 3 days:
 
        >>> ts.last('3D')
                    A
        2018-04-13  3
        2018-04-15  4
 
        Notice the data for 3 last calendar days were returned, not the last
        3 observed days in the dataset, and therefore data for 2018-04-11 was
        not returned.
        z*'last' only supports a DatetimeIndex indexrFrÓr@rçrèN)    r¿rÞrsrGrÀr¬rrìr9)r³rZ
start_daterîr´r´rµrz#s4  z NDFrame.lastÚaverageÚkeep)r³rºr,Ú numeric_onlyÚ    na_optionruÚpctr®c
sjˆ |¡‰ˆdkrd}t|ƒ‚‡‡‡‡‡‡fdd„}|r^ˆjdkrTtˆjƒsTtdƒ‚ˆ ¡}    nˆ}    ||    ƒS)aÔ
        Compute numerical data ranks (1 through n) along axis.
 
        By default, equal values are assigned a rank that is the average of the
        ranks of those values.
 
        Parameters
        ----------
        axis : {0 or 'index', 1 or 'columns'}, default 0
            Index to direct ranking.
            For `Series` this parameter is unused and defaults to 0.
        method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
            How to rank the group of records that have the same value (i.e. ties):
 
            * average: average rank of the group
            * min: lowest rank in the group
            * max: highest rank in the group
            * first: ranks assigned in order they appear in the array
            * dense: like 'min', but rank always increases by 1 between groups.
 
        numeric_only : bool, default False
            For DataFrame objects, rank only numeric columns if set to True.
 
            .. versionchanged:: 2.0.0
                The default value of ``numeric_only`` is now ``False``.
 
        na_option : {'keep', 'top', 'bottom'}, default 'keep'
            How to rank NaN values:
 
            * keep: assign NaN rank to NaN values
            * top: assign lowest rank to NaN values
            * bottom: assign highest rank to NaN values
 
        ascending : bool, default True
            Whether or not the elements should be ranked in ascending order.
        pct : bool, default False
            Whether or not to display the returned rankings in percentile
            form.
 
        Returns
        -------
        same type as caller
            Return a Series or DataFrame with data ranks as values.
 
        See Also
        --------
        core.groupby.DataFrameGroupBy.rank : Rank of values within each group.
        core.groupby.SeriesGroupBy.rank : Rank of values within each group.
 
        Examples
        --------
        >>> df = pd.DataFrame(data={'Animal': ['cat', 'penguin', 'dog',
        ...                                    'spider', 'snake'],
        ...                         'Number_legs': [4, 2, 4, 8, np.nan]})
        >>> df
            Animal  Number_legs
        0      cat          4.0
        1  penguin          2.0
        2      dog          4.0
        3   spider          8.0
        4    snake          NaN
 
        Ties are assigned the mean of the ranks (by default) for the group.
 
        >>> s = pd.Series(range(5), index=list("abcde"))
        >>> s["d"] = s["b"]
        >>> s.rank()
        a    1.0
        b    2.5
        c    4.0
        d    2.5
        e    5.0
        dtype: float64
 
        The following example shows how the method behaves with the above
        parameters:
 
        * default_rank: this is the default behaviour obtained without using
          any parameter.
        * max_rank: setting ``method = 'max'`` the records that have the
          same values are ranked using the highest rank (e.g.: since 'cat'
          and 'dog' are both in the 2nd and 3rd position, rank 3 is assigned.)
        * NA_bottom: choosing ``na_option = 'bottom'``, if there are records
          with NaN values they are placed at the bottom of the ranking.
        * pct_rank: when setting ``pct = True``, the ranking is expressed as
          percentile rank.
 
        >>> df['default_rank'] = df['Number_legs'].rank()
        >>> df['max_rank'] = df['Number_legs'].rank(method='max')
        >>> df['NA_bottom'] = df['Number_legs'].rank(na_option='bottom')
        >>> df['pct_rank'] = df['Number_legs'].rank(pct=True)
        >>> df
            Animal  Number_legs  default_rank  max_rank  NA_bottom  pct_rank
        0      cat          4.0           2.5       3.0        2.5     0.625
        1  penguin          2.0           1.0       1.0        1.0     0.250
        2      dog          4.0           2.5       3.0        2.5     0.625
        3   spider          8.0           4.0       4.0        4.0     1.000
        4    snake          NaN           NaN       NaN        5.0       NaN
        >ÚtoprÚbottomz3na_option must be one of 'keep', 'top', or 'bottom'csn|jdkr|j}n|j}t|tƒr8|jˆˆˆˆˆd}ntj|ˆˆˆˆˆd}ˆj|f|     ¡Ž}|j
ˆddS)Nr÷)rºr,rurrÚrankr+) rørÂr.r¿roZ_rankÚalgosrrÉrïrÊ)r«rÂZranksZ    ranks_obj©rurzr,rrr³r´rµÚrankerÃ#s*
 
ûú    zNDFrame.rank.<locals>.rankerr»zDSeries.rank does not allow numeric_only=True with non-numeric dtype.)ròrñrør]r¸rGr°)
r³rºr,rrrurr†r"r«r´r!rµrP#sm
ÿ
z NDFrame.rankÚcomparer»r^r9)Ú
align_axisÚ
keep_shapeÚ
keep_equalÚ result_namescCsÜt|ƒt|ƒk    rBt|ƒjt|ƒj}}td|›d|›d|›dƒ‚||k| ¡| ¡@B}|jddd|s‚| |¡}| |¡}|sÒt|tƒrÂ| ¡}    |jdd}
|j    |
|    f}|j    |
|    f}n||}||}t|t
ƒsðtd    t|ƒ›d
ƒ‚|d krd} n
|  |¡} t ||g| |d } | |j kr,| S|  | ¡} t | j¡}t t|ƒ¡| _ttd| jƒƒd g}t| tƒr„| j|| d} n
|  |¡} ||| j| d_t | j| ¡ d| j| dg¡j ¡}| j|| d} | S)Nzcan only compare 'z' (not 'z    ') with 'r„Trõr»r¹zPassing 'result_names' as a z= is not supported. Provide 'result_names' as a tuple instead.)r»rö)rºrrr÷)r`rÚrGrfrËrÐr¿rbrrOrròr…rørèrÚarrayrûrÏrÀr¦r-ZnlevelsZreorder_levelsrÚreshaper:ÚflattenrB)r³r\r$r%r&r'Zcls_selfZ    cls_otherrmZcmaskZrmaskrºZdiffrOZax_namesÚorderrAr´r´rµr#í#sP    ÿ
 
 
 
ÿ
 
 
 
(ÿzNDFrame.compareÚouterr) r³r\r®rºrr¬r€r,rbÚ    fill_axisÚbroadcast_axisr®c s*t|ƒ}|
dkr´ˆjˆjkr´tˆtƒrhˆj} | ‡fdd„ˆjDƒfˆ ¡Ž} | jˆ||||||||    d    Stˆtƒr´ˆj} | ‡fdd„ˆjDƒfˆ ¡Ž} ˆj| ||||||||    d    S|dk    rƈ |¡}tˆt    ƒrìˆjˆ||||||||    d    Stˆtƒrˆj
ˆ||||||||    d    St dt ˆƒ›ƒ‚dS)a
        Align two objects on their axes with the specified join method.
 
        Join method is specified for each axis Index.
 
        Parameters
        ----------
        other : DataFrame or Series
        join : {{'outer', 'inner', 'left', 'right'}}, default 'outer'
        axis : allowed axis of the other object, default None
            Align on index (0), columns (1), or both (None).
        level : int or level name, default None
            Broadcast across a level, matching Index values on the
            passed MultiIndex level.
        copy : bool, default True
            Always returns new objects. If copy=False and no reindexing is
            required then original objects are returned.
        fill_value : scalar, default np.NaN
            Value to use for missing values. Defaults to NaN, but can be any
            "compatible" value.
        method : {{'backfill', 'bfill', 'pad', 'ffill', None}}, default None
            Method to use for filling holes in reindexed Series:
 
            - pad / ffill: propagate last valid observation forward to next valid.
            - backfill / bfill: use NEXT valid observation to fill gap.
 
        limit : int, default None
            If method is specified, this is the maximum number of consecutive
            NaN values to forward/backward fill. In other words, if there is
            a gap with more than this number of consecutive NaNs, it will only
            be partially filled. If method is not specified, this is the
            maximum number of entries along the entire axis where NaNs will be
            filled. Must be greater than 0 if not None.
        fill_axis : {axes_single_arg}, default 0
            Filling axis, method and limit.
        broadcast_axis : {axes_single_arg}, default None
            Broadcast values along this axis, if aligning two objects of
            different dimensions.
 
        Returns
        -------
        tuple of ({klass}, type of other)
            Aligned objects.
 
        Examples
        --------
        >>> df = pd.DataFrame(
        ...     [[1, 2, 3, 4], [6, 7, 8, 9]], columns=["D", "B", "E", "A"], index=[1, 2]
        ... )
        >>> other = pd.DataFrame(
        ...     [[10, 20, 30, 40], [60, 70, 80, 90], [600, 700, 800, 900]],
        ...     columns=["A", "B", "C", "D"],
        ...     index=[2, 3, 4],
        ... )
        >>> df
           D  B  E  A
        1  1  2  3  4
        2  6  7  8  9
        >>> other
            A    B    C    D
        2   10   20   30   40
        3   60   70   80   90
        4  600  700  800  900
 
        Align on columns:
 
        >>> left, right = df.align(other, join="outer", axis=1)
        >>> left
           A  B   C  D  E
        1  4  2 NaN  1  3
        2  9  7 NaN  6  8
        >>> right
            A    B    C    D   E
        2   10   20   30   40 NaN
        3   60   70   80   90 NaN
        4  600  700  800  900 NaN
 
        We can also align on the index:
 
        >>> left, right = df.align(other, join="outer", axis=0)
        >>> left
            D    B    E    A
        1  1.0  2.0  3.0  4.0
        2  6.0  7.0  8.0  9.0
        3  NaN  NaN  NaN  NaN
        4  NaN  NaN  NaN  NaN
        >>> right
            A      B      C      D
        1    NaN    NaN    NaN    NaN
        2   10.0   20.0   30.0   40.0
        3   60.0   70.0   80.0   90.0
        4  600.0  700.0  800.0  900.0
 
        Finally, the default `axis=None` will align on both index and columns:
 
        >>> left, right = df.align(other, join="outer", axis=None)
        >>> left
             A    B   C    D    E
        1  4.0  2.0 NaN  1.0  3.0
        2  9.0  7.0 NaN  6.0  8.0
        3  NaN  NaN NaN  NaN  NaN
        4  NaN  NaN NaN  NaN  NaN
        >>> right
               A      B      C      D   E
        1    NaN    NaN    NaN    NaN NaN
        2   10.0   20.0   30.0   40.0 NaN
        3   60.0   70.0   80.0   90.0 NaN
        4  600.0  700.0  800.0  900.0 NaN
        r»csi|]
}|ˆ“qSr´r´rrÎr´rµrëº$sz!NDFrame.align.<locals>.<dictcomp>)r®rºrr¬r€r,rbr-csi|]
}|ˆ“qSr´r´r)r\r´rµrëÌ$sNzunsupported type: ) rrør¿rcZ_constructor_expanddimrörïÚ _align_frameròrbÚ _align_seriesrGr`) r³r\r®rºrr¬r€r,rbr-r.rÇrÕr´r[rµÚalign6$s‚|
ÿÿ÷
ÿÿ÷ 
 
÷ ÷ z NDFrame.align)r®rºr¬r-c
CsPd\}
} d\} } d\}}t|tƒ}|dks2|dkr\|j |j¡s\|jj|j||dd\}
} } |dksl|dkrš|sš|j |j¡sš|jj|j||dd\} }}|r¬d|
| gi}n|
| g| |gdœ}|j|||dd}|j|
| g| |gdœ||dd}|dk    r,|j||    |d}|dk    st‚|}|j||    |d}t    |||
ƒ\}}| 
|¡| 
|¡fS)    N©NNrT©rrZreturn_indexersr»)rr»)r¬r€rj©r,rºrb) r¿rcrÞrZr®rör„rËrõÚ _align_as_utcrÊ)r³r\r®rºrr¬r€r,rbr-Ú
join_indexZ join_columnsZilidxZiridxZclidxZcridxrírˆrrçÚ_leftr´r´rµr/÷$sb
ÿ ÿÿþ ýÿ ÿü
þzNDFrame._align_framec
Cst|tƒ}
|rtƒrd}|
s$|dks,|dkr4tdƒ‚|
rH|dkrHtdƒ‚|sÞ|j |j¡rfd\} } } n|jj|j||dd\} } } |
r–| | | |¡}n8| dks¦| dkr´|j|d    }n|     |j
j | | d|d
¡}| | | |¡}n®|j
}|j d} d \} } |  |j¡s| j|j||dd\} } } | dk    rB|  d¡}|j | | |d }|r\||j
kr\| ¡}|     |¡}| dkr~|j|d    }n|j| |d }t|ƒpœ|dk    }|rÆ|j||||    d}|j|||d}|
sÜ|
sì|dkrìt||| ƒ\}}| |¡| |¡fS)NF)Nrr»zMust specify axis=0 or 1r»z1cannot align series to a series other than axis 0)NNNTr3rÓrr2r¹rE)r,rbrºrÌr)r¿rcrrñrÞrZr®Z_reindex_indexerr¬rÉr›rlr–r¾rdrgrËr5rÊ)r³r\r®rºrr¬r€r,rbr-rír6ZlidxZridxrrçÚfdatarÆZfill_nar´r´rµr07%sh
 
  ÿ ÿ
ÿ 
 
 
 
þzNDFrame._align_series)r˜rºc CsÎt|dƒ}|dk    r| |¡}t ||¡}t|tƒrJ|j|ddddd}nBt|dƒs^t     |¡}|j
|j
krrt d    ƒ‚|j |f|  ¡d
di—Ž}t|ƒ}| |¡}d }|jsôt|tƒsÎt|ƒsòt |j|jd ƒ‚qþ|jD]}t|ƒsÔt |j|d ƒ‚qÔn
| t¡}|r
| n|}|j|j|jdd }t|tƒrÌ|j|jkrÂ|j|d||dddd}|dkrp| |¡spt‚|j|jkrÊ|j}|dkrœt |d¡}n|dkr²t |d¡}t ||j
¡}nt dƒ‚nt|t!tfƒsèt"|dd}t|tj#t$fƒr8|j
|j
kr|jdkr8t dƒ‚n|j |f|  ¡d
di—Ž}|dkrFd}|jt%|ddƒkr`d}    n| |¡dk}    |r¤| &|¡|j'j(|||    d}
|  |
¡} | )| ¡S|j'j*|||    d}
|  |
¡} |  +|¡SdS)z–
        Equivalent to public method `where`, except that `other` is not
        applied as a function even if callable. Used in __setitem__.
        r˜Nrçr»F)r®r.r¬rrz,Array conditional must be same shape as selfr¬z5Boolean array expected for the condition, not {dtype}r¼rr)r®rºrr€r¬)r@r»)r»r@z.cannot align with a higher dimensional NDFrameT)Z extract_numpyz4other must be the same shape as self when an ndarrayrø)rmÚnewr1)r\Úcondr1),rLròrjÚapply_if_callabler¿ršr1ÚhasattrrZ
asanyarrayrrñrÉrïrqrËr™rbrTrèr¸rœrÃrdrrãrør_rEr.r)Z broadcast_torÙrurqrKrorùr¯r›ZputmaskrMrÐrÊ) r³r:r\r˜rºrr€r†Z_dtr1rjr4r´r´rµÚ_whereŠ%s 
 
 
 
 
 
 
 
 
 úù
 
 
 ÿ  ÿÿÿÿ
 
 
 
ý
zNDFrame._where)r˜rºr)r³r˜rºrr®cCsdSrÐr´©r³r:r\r˜rºrr´r´rµrÐ&s
z NDFrame.where)rºr)r˜rºrr®cCsdSrÐr´r>r´r´rµrÐ&s
cCsdSrÐr´r>r´r´rµrÐ'&s
ÚTrueÚFalserÐrm)r—r:Zcond_revrÿZ
name_othercCst ||¡}| |||||¡S)aü
        Replace values where the condition is {cond_rev}.
 
        Parameters
        ----------
        cond : bool {klass}, array-like, or callable
            Where `cond` is {cond}, keep the original value. Where
            {cond_rev}, replace with corresponding value from `other`.
            If `cond` is callable, it is computed on the {klass} and
            should return boolean {klass} or array. The callable must
            not change input {klass} (though pandas doesn't check it).
        other : scalar, {klass}, or callable
            Entries where `cond` is {cond_rev} are replaced with
            corresponding value from `other`.
            If other is callable, it is computed on the {klass} and
            should return scalar or {klass}. The callable must not
            change input {klass} (though pandas doesn't check it).
            If not specified, entries will be filled with the corresponding
            NULL value (``np.nan`` for numpy dtypes, ``pd.NA`` for extension
            dtypes).
        inplace : bool, default False
            Whether to perform the operation in place on the data.
        axis : int, default None
            Alignment axis if needed. For `Series` this parameter is
            unused and defaults to 0.
        level : int, default None
            Alignment level if needed.
 
        Returns
        -------
        Same type as caller or None if ``inplace=True``.
 
        See Also
        --------
        :func:`DataFrame.{name_other}` : Return an object of same shape as
            self.
 
        Notes
        -----
        The {name} method is an application of the if-then idiom. For each
        element in the calling DataFrame, if ``cond`` is ``{cond}`` the
        element is used; otherwise the corresponding element from the DataFrame
        ``other`` is used. If the axis of ``other`` does not align with axis of
        ``cond`` {klass}, the misaligned index positions will be filled with
        {cond_rev}.
 
        The signature for :func:`DataFrame.where` differs from
        :func:`numpy.where`. Roughly ``df1.where(m, df2)`` is equivalent to
        ``np.where(m, df1, df2)``.
 
        For further details and examples see the ``{name}`` documentation in
        :ref:`indexing <indexing.where_mask>`.
 
        The dtype of the object takes precedence. The fill value is casted to
        the object's dtype, if this can be done losslessly.
 
        Examples
        --------
        >>> s = pd.Series(range(5))
        >>> s.where(s > 0)
        0    NaN
        1    1.0
        2    2.0
        3    3.0
        4    4.0
        dtype: float64
        >>> s.mask(s > 0)
        0    0.0
        1    NaN
        2    NaN
        3    NaN
        4    NaN
        dtype: float64
 
        >>> s = pd.Series(range(5))
        >>> t = pd.Series([True, False])
        >>> s.where(t, 99)
        0     0
        1    99
        2    99
        3    99
        4    99
        dtype: int64
        >>> s.mask(t, 99)
        0    99
        1     1
        2    99
        3    99
        4    99
        dtype: int64
 
        >>> s.where(s > 1, 10)
        0    10
        1    10
        2    2
        3    3
        4    4
        dtype: int64
        >>> s.mask(s > 1, 10)
        0     0
        1     1
        2    10
        3    10
        4    10
        dtype: int64
 
        >>> df = pd.DataFrame(np.arange(10).reshape(-1, 2), columns=['A', 'B'])
        >>> df
           A  B
        0  0  1
        1  2  3
        2  4  5
        3  6  7
        4  8  9
        >>> m = df % 3 == 0
        >>> df.where(m, -df)
           A  B
        0  0 -1
        1 -2  3
        2 -4 -5
        3  6 -7
        4 -8  9
        >>> df.where(m, -df) == np.where(m, df, -df)
              A     B
        0  True  True
        1  True  True
        2  True  True
        3  True  True
        4  True  True
        >>> df.where(m, -df) == df.mask(~m, -df)
              A     B
        0  True  True
        1  True  True
        2  True  True
        3  True  True
        4  True  True
        )rjr;r=r>r´r´rµrÐ3&s cCsdSrÐr´r>r´r´rµrmÏ&s
z NDFrame.maskcCsdSrÐr´r>r´r´rµrmÛ&s
cCsdSrÐr´r>r´r´rµrmç&s
cCs@t|dƒ}t ||¡}t|dƒs*t |¡}|j|||||dS)Nr˜rn)r\r˜rºr)rLrjr;r<rr(rÐr>r´r´rµrmó&s
 
 
û)r³Úperiodsrºr€r®c Cs|dkr|jddS|dkrL| |¡}|jj|||d}| |¡j|ddS| |¡}|dkr”t|ddƒ}|dkr~t|d    dƒ}|dkr¦d
}t|ƒ‚nt    |t
ƒr¦t |ƒ}t    |t ƒròt |j ƒ}||kræ|dk    sÎt‚td |j›d |j›ƒ‚| |¡}    n | ||¡}    |j|    |d }
|
j|ddS)aa
        Shift index by desired number of periods with an optional time `freq`.
 
        When `freq` is not passed, shift the index without realigning the data.
        If `freq` is passed (in this case, the index must be date or datetime,
        or it will raise a `NotImplementedError`), the index will be
        increased using the periods and the `freq`. `freq` can be inferred
        when specified as "infer" as long as either freq or inferred_freq
        attribute is set in the index.
 
        Parameters
        ----------
        periods : int
            Number of periods to shift. Can be positive or negative.
        freq : DateOffset, tseries.offsets, timedelta, or str, optional
            Offset to use from the tseries module or time rule (e.g. 'EOM').
            If `freq` is specified then the index values are shifted but the
            data is not realigned. That is, use `freq` if you would like to
            extend the index when shifting and preserve the original data.
            If `freq` is specified as "infer" then it will be inferred from
            the freq or inferred_freq attributes of the index. If neither of
            those attributes exist, a ValueError is thrown.
        axis : {{0 or 'index', 1 or 'columns', None}}, default None
            Shift direction. For `Series` this parameter is unused and defaults to 0.
        fill_value : object, optional
            The scalar value to use for newly introduced missing values.
            the default depends on the dtype of `self`.
            For numeric data, ``np.nan`` is used.
            For datetime, timedelta, or period data, etc. :attr:`NaT` is used.
            For extension dtypes, ``self.dtype.na_value`` is used.
 
            .. versionchanged:: 1.1.0
 
        Returns
        -------
        {klass}
            Copy of input object, shifted.
 
        See Also
        --------
        Index.shift : Shift values of Index.
        DatetimeIndex.shift : Shift values of DatetimeIndex.
        PeriodIndex.shift : Shift values of PeriodIndex.
 
        Examples
        --------
        >>> df = pd.DataFrame({{"Col1": [10, 20, 15, 30, 45],
        ...                    "Col2": [13, 23, 18, 33, 48],
        ...                    "Col3": [17, 27, 22, 37, 52]}},
        ...                   index=pd.date_range("2020-01-01", "2020-01-05"))
        >>> df
                    Col1  Col2  Col3
        2020-01-01    10    13    17
        2020-01-02    20    23    27
        2020-01-03    15    18    22
        2020-01-04    30    33    37
        2020-01-05    45    48    52
 
        >>> df.shift(periods=3)
                    Col1  Col2  Col3
        2020-01-01   NaN   NaN   NaN
        2020-01-02   NaN   NaN   NaN
        2020-01-03   NaN   NaN   NaN
        2020-01-04  10.0  13.0  17.0
        2020-01-05  20.0  23.0  27.0
 
        >>> df.shift(periods=1, axis="columns")
                    Col1  Col2  Col3
        2020-01-01   NaN    10    13
        2020-01-02   NaN    20    23
        2020-01-03   NaN    15    18
        2020-01-04   NaN    30    33
        2020-01-05   NaN    45    48
 
        >>> df.shift(periods=3, fill_value=0)
                    Col1  Col2  Col3
        2020-01-01     0     0     0
        2020-01-02     0     0     0
        2020-01-03     0     0     0
        2020-01-04    10    13    17
        2020-01-05    20    23    27
 
        >>> df.shift(periods=3, freq="D")
                    Col1  Col2  Col3
        2020-01-04    10    13    17
        2020-01-05    20    23    27
        2020-01-06    15    18    22
        2020-01-07    30    33    37
        2020-01-08    45    48    52
 
        >>> df.shift(periods=3, freq="infer")
                    Col1  Col2  Col3
        2020-01-04    10    13    17
        2020-01-05    20    23    27
        2020-01-06    15    18    22
        2020-01-07    30    33    37
        2020-01-08    45    48    52
        rNrÓ)rArºr€Úshiftr+rÕræZ inferred_freqz6Freq was not set in the index hence cannot be inferredz Given freq z! does not match PeriodIndex freq r¹)r¬ròr›rBrÉrÊrèrùrñr¿r§rrvrærõZ    rule_coder) r³rArærºr€rjrÞr†Z    orig_freqrPr4r´r´rµrB's>j 
ÿ
 
 
 
 
 ÿ  z NDFrame.shiftc    Cs|dkr|j}| |¡}| |¡}|js6|js6tdƒ‚|jrXddlm}||ƒ}||ƒ}|dk    r„|dk    r„||kr„td|›d|›ƒ‚t    |ƒdkr¬|jr¬| 
¡dkr¬||}}t ddƒg|j }t ||ƒ||<|j t|ƒ}t|tƒrt|| |¡| ||¡ƒ|j|otƒ d}|S)    aa
        Truncate a Series or DataFrame before and after some index value.
 
        This is a useful shorthand for boolean indexing based on index
        values above or below certain thresholds.
 
        Parameters
        ----------
        before : date, str, int
            Truncate all rows before this index value.
        after : date, str, int
            Truncate all rows after this index value.
        axis : {0 or 'index', 1 or 'columns'}, optional
            Axis to truncate. Truncates the index (rows) by default.
            For `Series` this parameter is unused and defaults to 0.
        copy : bool, default is True,
            Return a copy of the truncated section.
 
        Returns
        -------
        type of caller
            The truncated Series or DataFrame.
 
        See Also
        --------
        DataFrame.loc : Select a subset of a DataFrame by label.
        DataFrame.iloc : Select a subset of a DataFrame by position.
 
        Notes
        -----
        If the index being truncated contains only datetime values,
        `before` and `after` may be specified as strings instead of
        Timestamps.
 
        Examples
        --------
        >>> df = pd.DataFrame({'A': ['a', 'b', 'c', 'd', 'e'],
        ...                    'B': ['f', 'g', 'h', 'i', 'j'],
        ...                    'C': ['k', 'l', 'm', 'n', 'o']},
        ...                   index=[1, 2, 3, 4, 5])
        >>> df
           A  B  C
        1  a  f  k
        2  b  g  l
        3  c  h  m
        4  d  i  n
        5  e  j  o
 
        >>> df.truncate(before=2, after=4)
           A  B  C
        2  b  g  l
        3  c  h  m
        4  d  i  n
 
        The columns of a DataFrame can be truncated.
 
        >>> df.truncate(before="A", after="B", axis="columns")
           A  B
        1  a  f
        2  b  g
        3  c  h
        4  d  i
        5  e  j
 
        For Series, only rows can be truncated.
 
        >>> df['A'].truncate(before=2, after=4)
        2    b
        3    c
        4    d
        Name: A, dtype: object
 
        The index values in ``truncate`` can be datetimes or string
        dates.
 
        >>> dates = pd.date_range('2016-01-01', '2016-02-01', freq='s')
        >>> df = pd.DataFrame(index=dates, data={'A': 1})
        >>> df.tail()
                             A
        2016-01-31 23:59:56  1
        2016-01-31 23:59:57  1
        2016-01-31 23:59:58  1
        2016-01-31 23:59:59  1
        2016-02-01 00:00:00  1
 
        >>> df.truncate(before=pd.Timestamp('2016-01-05'),
        ...             after=pd.Timestamp('2016-01-10')).tail()
                             A
        2016-01-09 23:59:56  1
        2016-01-09 23:59:57  1
        2016-01-09 23:59:58  1
        2016-01-09 23:59:59  1
        2016-01-10 00:00:00  1
 
        Because the index is a DatetimeIndex containing only dates, we can
        specify `before` and `after` as strings. They will be coerced to
        Timestamps before truncation.
 
        >>> df.truncate('2016-01-05', '2016-01-10').tail()
                             A
        2016-01-09 23:59:56  1
        2016-01-09 23:59:57  1
        2016-01-09 23:59:58  1
        2016-01-09 23:59:59  1
        2016-01-10 00:00:00  1
 
        Note that ``truncate`` assumes a 0 value for any unspecified time
        component (midnight). This differs from partial string slicing, which
        returns any partially matching dates.
 
        >>> df.loc['2016-01-05':'2016-01-10', :].tail()
                             A
        2016-01-10 23:59:55  1
        2016-01-10 23:59:56  1
        2016-01-10 23:59:57  1
        2016-01-10 23:59:58  1
        2016-01-10 23:59:59  1
        Nz truncate requires a sorted indexr)Ú to_datetimez
Truncate: z must be after r»rÓ)r˜ròrèréZis_monotonic_decreasingrñZ _is_all_datesZpandas.core.tools.datetimesrCrÀr­r7rårOrr¿rurrôÚtruncater¬r)    r³ZbeforeÚafterrºr¬rOrCZslicerr4r´r´rµrD§'s*}
 
 
 zNDFrame.truncatec    s²ˆ ˆ¡‰ˆ ˆ¡}‡‡fdd„}t|tƒrV| |¡}||j||ƒ}|j||d}n*|dd|jfkrvtd|›dƒ‚|||ƒ}ˆj    |oŽt
ƒ d}|j |ˆd    d
}|j ˆd d S) a%
        Convert tz-aware axis to target time zone.
 
        Parameters
        ----------
        tz : str or tzinfo object or None
            Target time zone. Passing ``None`` will convert to
            UTC and remove the timezone information.
        axis : {{0 or 'index', 1 or 'columns'}}, default 0
            The axis to convert
        level : int, str, default None
            If axis is a MultiIndex, convert a specific level. Otherwise
            must be None.
        copy : bool, default True
            Also make a copy of the underlying data.
 
        Returns
        -------
        {klass}
            Object with time zone converted axis.
 
        Raises
        ------
        TypeError
            If the axis is tz-naive.
 
        Examples
        --------
        Change to another time zone:
 
        >>> s = pd.Series(
        ...     [1],
        ...     index=pd.DatetimeIndex(['2018-09-15 01:30:00+02:00']),
        ... )
        >>> s.tz_convert('Asia/Shanghai')
        2018-09-15 07:30:00+08:00    1
        dtype: int64
 
        Pass None to convert to UTC and get a tz-naive index:
 
        >>> s = pd.Series([1],
        ...     index=pd.DatetimeIndex(['2018-09-15 01:30:00+02:00']))
        >>> s.tz_convert(None)
        2018-09-14 23:30:00    1
        dtype: int64
        csJt|dƒs<t|ƒdkr.ˆ ˆ¡}t|›dƒ‚tg|d}n
| |¡}|S)NÚ
tz_convertrú, is not a valid DatetimeIndex or PeriodIndex©Útz)r<rÀrôrGrsrF)rOrIÚax_namerŒr´rµÚ _tz_convert}(s
 
ÿ
z'NDFrame.tz_convert.<locals>._tz_convertrENrú
The level ú  is not validrÓFrrFr+) ròrèr¿rurJÚlevelsÚ
set_levelsrÿrñr¬rrrÊ)    r³rIrºrr¬rOrKÚ    new_levelr4r´rŒrµrFG(s3
 
 
 
 
zNDFrame.tz_convertr;r=)r³rºr¬Ú    ambiguousÚ nonexistentr®c sÚd}||kr t|tjƒs tdƒ‚ˆ ˆ¡‰ˆ ˆ¡}‡‡fdd„}    t|tƒrz| |¡}|    |j||||ƒ}
|j    |
|d}n.|dd|j
fkrštd|›d    ƒ‚|    ||||ƒ}ˆj |o¶t ƒ d
} | j |ˆd d } | jˆd dS)aß
        Localize tz-naive index of a Series or DataFrame to target time zone.
 
        This operation localizes the Index. To localize the values in a
        timezone-naive Series, use :meth:`Series.dt.tz_localize`.
 
        Parameters
        ----------
        tz : str or tzinfo or None
            Time zone to localize. Passing ``None`` will remove the
            time zone information and preserve local time.
        axis : {{0 or 'index', 1 or 'columns'}}, default 0
            The axis to localize
        level : int, str, default None
            If axis ia a MultiIndex, localize a specific level. Otherwise
            must be None.
        copy : bool, default True
            Also make a copy of the underlying data.
        ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
            When clocks moved backward due to DST, ambiguous times may arise.
            For example in Central European Time (UTC+01), when going from
            03:00 DST to 02:00 non-DST, 02:30:00 local time occurs both at
            00:30:00 UTC and at 01:30:00 UTC. In such a situation, the
            `ambiguous` parameter dictates how ambiguous times should be
            handled.
 
            - 'infer' will attempt to infer fall dst-transition hours based on
              order
            - bool-ndarray where True signifies a DST time, False designates
              a non-DST time (note that this flag is only applicable for
              ambiguous times)
            - 'NaT' will return NaT where there are ambiguous times
            - 'raise' will raise an AmbiguousTimeError if there are ambiguous
              times.
        nonexistent : str, default 'raise'
            A nonexistent time does not exist in a particular timezone
            where clocks moved forward due to DST. Valid values are:
 
            - 'shift_forward' will shift the nonexistent time forward to the
              closest existing time
            - 'shift_backward' will shift the nonexistent time backward to the
              closest existing time
            - 'NaT' will return NaT where there are nonexistent times
            - timedelta objects will shift nonexistent times by the timedelta
            - 'raise' will raise an NonExistentTimeError if there are
              nonexistent times.
 
        Returns
        -------
        {klass}
            Same type as the input.
 
        Raises
        ------
        TypeError
            If the TimeSeries is tz-aware and tz is not None.
 
        Examples
        --------
        Localize local times:
 
        >>> s = pd.Series(
        ...     [1],
        ...     index=pd.DatetimeIndex(['2018-09-15 01:30:00']),
        ... )
        >>> s.tz_localize('CET')
        2018-09-15 01:30:00+02:00    1
        dtype: int64
 
        Pass None to convert to tz-naive index and preserve local time:
 
        >>> s = pd.Series([1],
        ...     index=pd.DatetimeIndex(['2018-09-15 01:30:00+02:00']))
        >>> s.tz_localize(None)
        2018-09-15 01:30:00    1
        dtype: int64
 
        Be careful with DST changes. When there is sequential data, pandas
        can infer the DST time:
 
        >>> s = pd.Series(range(7),
        ...               index=pd.DatetimeIndex(['2018-10-28 01:30:00',
        ...                                       '2018-10-28 02:00:00',
        ...                                       '2018-10-28 02:30:00',
        ...                                       '2018-10-28 02:00:00',
        ...                                       '2018-10-28 02:30:00',
        ...                                       '2018-10-28 03:00:00',
        ...                                       '2018-10-28 03:30:00']))
        >>> s.tz_localize('CET', ambiguous='infer')
        2018-10-28 01:30:00+02:00    0
        2018-10-28 02:00:00+02:00    1
        2018-10-28 02:30:00+02:00    2
        2018-10-28 02:00:00+01:00    3
        2018-10-28 02:30:00+01:00    4
        2018-10-28 03:00:00+01:00    5
        2018-10-28 03:30:00+01:00    6
        dtype: int64
 
        In some cases, inferring the DST is impossible. In such cases, you can
        pass an ndarray to the ambiguous parameter to set the DST explicitly
 
        >>> s = pd.Series(range(3),
        ...               index=pd.DatetimeIndex(['2018-10-28 01:20:00',
        ...                                       '2018-10-28 02:36:00',
        ...                                       '2018-10-28 03:46:00']))
        >>> s.tz_localize('CET', ambiguous=np.array([True, True, False]))
        2018-10-28 01:20:00+02:00    0
        2018-10-28 02:36:00+02:00    1
        2018-10-28 03:46:00+01:00    2
        dtype: int64
 
        If the DST transition causes nonexistent times, you can shift these
        dates forward or backward with a timedelta object or `'shift_forward'`
        or `'shift_backward'`.
 
        >>> s = pd.Series(range(2),
        ...               index=pd.DatetimeIndex(['2015-03-29 02:30:00',
        ...                                       '2015-03-29 03:30:00']))
        >>> s.tz_localize('Europe/Warsaw', nonexistent='shift_forward')
        2015-03-29 03:00:00+02:00    0
        2015-03-29 03:30:00+02:00    1
        dtype: int64
        >>> s.tz_localize('Europe/Warsaw', nonexistent='shift_backward')
        2015-03-29 01:59:59.999999999+01:00    0
        2015-03-29 03:30:00+02:00              1
        dtype: int64
        >>> s.tz_localize('Europe/Warsaw', nonexistent=pd.Timedelta('1H'))
        2015-03-29 03:30:00+02:00    0
        2015-03-29 03:30:00+02:00    1
        dtype: int64
        )r?ZNaTZ shift_forwardZshift_backwardzoThe nonexistent argument must be one of 'raise', 'NaT', 'shift_forward', 'shift_backward' or a timedelta objectcsPt|dƒs<t|ƒdkr.ˆ ˆ¡}t|›dƒ‚tg|d}n|j|||d}|S)NÚ tz_localizerrGrH)rQrR)r<rÀrôrGrsrS)rOrIrQrRrJrŒr´rµÚ _tz_localize3)s
 
ÿz)NDFrame.tz_localize.<locals>._tz_localizerENrrLrMrÓFrrSr+)r¿ÚdtÚ    timedeltarñròrèrurJrNrOrÿr¬rrrÊ) r³rIrºrr¬rQrRZnonexistent_optionsrOrTrPr4r´rŒrµrS˜(s,
ÿÿ
 
 
 
zNDFrame.tz_localizecCst||||dS)a !
        Generate descriptive statistics.
 
        Descriptive statistics include those that summarize the central
        tendency, dispersion and shape of a
        dataset's distribution, excluding ``NaN`` values.
 
        Analyzes both numeric and object series, as well
        as ``DataFrame`` column sets of mixed data types. The output
        will vary depending on what is provided. Refer to the notes
        below for more detail.
 
        Parameters
        ----------
        percentiles : list-like of numbers, optional
            The percentiles to include in the output. All should
            fall between 0 and 1. The default is
            ``[.25, .5, .75]``, which returns the 25th, 50th, and
            75th percentiles.
        include : 'all', list-like of dtypes or None (default), optional
            A white list of data types to include in the result. Ignored
            for ``Series``. Here are the options:
 
            - 'all' : All columns of the input will be included in the output.
            - A list-like of dtypes : Limits the results to the
              provided data types.
              To limit the result to numeric types submit
              ``numpy.number``. To limit it instead to object columns submit
              the ``numpy.object`` data type. Strings
              can also be used in the style of
              ``select_dtypes`` (e.g. ``df.describe(include=['O'])``). To
              select pandas categorical columns, use ``'category'``
            - None (default) : The result will include all numeric columns.
        exclude : list-like of dtypes or None (default), optional,
            A black list of data types to omit from the result. Ignored
            for ``Series``. Here are the options:
 
            - A list-like of dtypes : Excludes the provided data types
              from the result. To exclude numeric types submit
              ``numpy.number``. To exclude object columns submit the data
              type ``numpy.object``. Strings can also be used in the style of
              ``select_dtypes`` (e.g. ``df.describe(exclude=['O'])``). To
              exclude pandas categorical columns, use ``'category'``
            - None (default) : The result will exclude nothing.
 
        Returns
        -------
        Series or DataFrame
            Summary statistics of the Series or Dataframe provided.
 
        See Also
        --------
        DataFrame.count: Count number of non-NA/null observations.
        DataFrame.max: Maximum of the values in the object.
        DataFrame.min: Minimum of the values in the object.
        DataFrame.mean: Mean of the values.
        DataFrame.std: Standard deviation of the observations.
        DataFrame.select_dtypes: Subset of a DataFrame including/excluding
            columns based on their dtype.
 
        Notes
        -----
        For numeric data, the result's index will include ``count``,
        ``mean``, ``std``, ``min``, ``max`` as well as lower, ``50`` and
        upper percentiles. By default the lower percentile is ``25`` and the
        upper percentile is ``75``. The ``50`` percentile is the
        same as the median.
 
        For object data (e.g. strings or timestamps), the result's index
        will include ``count``, ``unique``, ``top``, and ``freq``. The ``top``
        is the most common value. The ``freq`` is the most common value's
        frequency. Timestamps also include the ``first`` and ``last`` items.
 
        If multiple object values have the highest count, then the
        ``count`` and ``top`` results will be arbitrarily chosen from
        among those with the highest count.
 
        For mixed data types provided via a ``DataFrame``, the default is to
        return only an analysis of numeric columns. If the dataframe consists
        only of object and categorical data without any numeric columns, the
        default is to return an analysis of both the object and categorical
        columns. If ``include='all'`` is provided as an option, the result
        will include a union of attributes of each type.
 
        The `include` and `exclude` parameters can be used to limit
        which columns in a ``DataFrame`` are analyzed for the output.
        The parameters are ignored when analyzing a ``Series``.
 
        Examples
        --------
        Describing a numeric ``Series``.
 
        >>> s = pd.Series([1, 2, 3])
        >>> s.describe()
        count    3.0
        mean     2.0
        std      1.0
        min      1.0
        25%      1.5
        50%      2.0
        75%      2.5
        max      3.0
        dtype: float64
 
        Describing a categorical ``Series``.
 
        >>> s = pd.Series(['a', 'a', 'b', 'c'])
        >>> s.describe()
        count     4
        unique    3
        top       a
        freq      2
        dtype: object
 
        Describing a timestamp ``Series``.
 
        >>> s = pd.Series([
        ...     np.datetime64("2000-01-01"),
        ...     np.datetime64("2010-01-01"),
        ...     np.datetime64("2010-01-01")
        ... ])
        >>> s.describe()
        count                      3
        mean     2006-09-01 08:00:00
        min      2000-01-01 00:00:00
        25%      2004-12-31 12:00:00
        50%      2010-01-01 00:00:00
        75%      2010-01-01 00:00:00
        max      2010-01-01 00:00:00
        dtype: object
 
        Describing a ``DataFrame``. By default only numeric fields
        are returned.
 
        >>> df = pd.DataFrame({'categorical': pd.Categorical(['d','e','f']),
        ...                    'numeric': [1, 2, 3],
        ...                    'object': ['a', 'b', 'c']
        ...                   })
        >>> df.describe()
               numeric
        count      3.0
        mean       2.0
        std        1.0
        min        1.0
        25%        1.5
        50%        2.0
        75%        2.5
        max        3.0
 
        Describing all columns of a ``DataFrame`` regardless of data type.
 
        >>> df.describe(include='all')  # doctest: +SKIP
               categorical  numeric object
        count            3      3.0      3
        unique           3      NaN      3
        top              f      NaN      a
        freq             1      NaN      1
        mean           NaN      2.0    NaN
        std            NaN      1.0    NaN
        min            NaN      1.0    NaN
        25%            NaN      1.5    NaN
        50%            NaN      2.0    NaN
        75%            NaN      2.5    NaN
        max            NaN      3.0    NaN
 
        Describing a column from a ``DataFrame`` by accessing it as
        an attribute.
 
        >>> df.numeric.describe()
        count    3.0
        mean     2.0
        std      1.0
        min      1.0
        25%      1.5
        50%      2.0
        75%      2.5
        max      3.0
        Name: numeric, dtype: float64
 
        Including only numeric columns in a ``DataFrame`` description.
 
        >>> df.describe(include=[np.number])
               numeric
        count      3.0
        mean       2.0
        std        1.0
        min        1.0
        25%        1.5
        50%        2.0
        75%        2.5
        max        3.0
 
        Including only string columns in a ``DataFrame`` description.
 
        >>> df.describe(include=[object])  # doctest: +SKIP
               object
        count       3
        unique      3
        top         a
        freq        1
 
        Including only categorical columns from a ``DataFrame`` description.
 
        >>> df.describe(include=['category'])
               categorical
        count            3
        unique           3
        top              d
        freq             1
 
        Excluding numeric columns from a ``DataFrame`` description.
 
        >>> df.describe(exclude=[np.number])  # doctest: +SKIP
               categorical object
        count            3      3
        unique           3      3
        top              f      a
        freq             1      1
 
        Excluding object columns from a ``DataFrame`` description.
 
        >>> df.describe(exclude=[object])  # doctest: +SKIP
               categorical  numeric
        count            3      3.0
        unique           3      NaN
        top              f      NaN
        freq             1      NaN
        mean           NaN      2.0
        std            NaN      1.0
        min            NaN      1.0
        25%            NaN      1.5
        50%            NaN      2.0
        75%            NaN      2.5
        max            NaN      3.0
        )r rÚexcludeÚ percentilesr)r³rXrrWr´r´rµÚdescribeQ)ssüzNDFrame.describer×z5Literal[('backfill', 'bfill', 'pad', 'ffill')] | None)r³rAÚ fill_methodr®c Ks˜| | d|j¡¡}|dkr"|}n |j|||d}|dk    s>t‚|}|jf|||dœ|—Ž}    ||    d}
|dk    rŠ|
j|
j ¡}
|
     |¡}
|
j
|ddS)a*
        Percentage change between the current and a prior element.
 
        Computes the percentage change from the immediately previous row by
        default. This is useful in comparing the percentage of change in a time
        series of elements.
 
        Parameters
        ----------
        periods : int, default 1
            Periods to shift for forming percent change.
        fill_method : {'backfill', 'bfill', 'pad', 'ffill', None}, default 'pad'
            How to handle NAs **before** computing percent changes.
        limit : int, default None
            The number of consecutive NAs to fill before stopping.
        freq : DateOffset, timedelta, or str, optional
            Increment to use from time series API (e.g. 'M' or BDay()).
        **kwargs
            Additional keyword arguments are passed into
            `DataFrame.shift` or `Series.shift`.
 
        Returns
        -------
        Series or DataFrame
            The same type as the calling object.
 
        See Also
        --------
        Series.diff : Compute the difference of two elements in a Series.
        DataFrame.diff : Compute the difference of two elements in a DataFrame.
        Series.shift : Shift the index by some number of periods.
        DataFrame.shift : Shift the index by some number of periods.
 
        Examples
        --------
        **Series**
 
        >>> s = pd.Series([90, 91, 85])
        >>> s
        0    90
        1    91
        2    85
        dtype: int64
 
        >>> s.pct_change()
        0         NaN
        1    0.011111
        2   -0.065934
        dtype: float64
 
        >>> s.pct_change(periods=2)
        0         NaN
        1         NaN
        2   -0.055556
        dtype: float64
 
        See the percentage change in a Series where filling NAs with last
        valid observation forward to next valid.
 
        >>> s = pd.Series([90, 91, None, 85])
        >>> s
        0    90.0
        1    91.0
        2     NaN
        3    85.0
        dtype: float64
 
        >>> s.pct_change(fill_method='ffill')
        0         NaN
        1    0.011111
        2    0.000000
        3   -0.065934
        dtype: float64
 
        **DataFrame**
 
        Percentage change in French franc, Deutsche Mark, and Italian lira from
        1980-01-01 to 1980-03-01.
 
        >>> df = pd.DataFrame({
        ...     'FR': [4.0405, 4.0963, 4.3149],
        ...     'GR': [1.7246, 1.7482, 1.8519],
        ...     'IT': [804.74, 810.01, 860.13]},
        ...     index=['1980-01-01', '1980-02-01', '1980-03-01'])
        >>> df
                        FR      GR      IT
        1980-01-01  4.0405  1.7246  804.74
        1980-02-01  4.0963  1.7482  810.01
        1980-03-01  4.3149  1.8519  860.13
 
        >>> df.pct_change()
                          FR        GR        IT
        1980-01-01       NaN       NaN       NaN
        1980-02-01  0.013810  0.013684  0.006549
        1980-03-01  0.053365  0.059318  0.061876
 
        Percentage of change in GOOG and APPL stock volume. Shows computing
        the percentage change between columns.
 
        >>> df = pd.DataFrame({
        ...     '2016': [1769950, 30586265],
        ...     '2015': [1500923, 40912316],
        ...     '2014': [1371819, 41403351]},
        ...     index=['GOOG', 'APPL'])
        >>> df
                  2016      2015      2014
        GOOG   1769950   1500923   1371819
        APPL  30586265  40912316  41403351
 
        >>> df.pct_change(axis='columns', periods=-1)
                  2016      2015  2014
        GOOG  0.179241  0.094112   NaN
        APPL -0.252395 -0.011860   NaN
        rºNr4)rArærºr»Ú
pct_changer+) ròr5rrËrõrBrOrÞZ
duplicatedrerÊ) r³rArZrbrærírºr«rÝZshiftedršr´r´rµr[J*s{  
zNDFrame.pct_changezSeries | bool_t)rÿrºÚ    bool_onlyÚskipnar®c    KsÖtjd||dt|ddd|jdkrd|dkrd|j||fd||dœ|—Ž}|j||fd|i|—ŽS|jdkrÀ|dkrÀt|jjƒdkrÀtd    d
„|jjDƒƒrÀ|sÀ|}|r°|     ¡}|j
|||d S|j |||||d d S)Nr´©Úfnamer]F©Z none_allowedr»r©rºr\r]css|]}|jdkVqdS)r÷N)rør r´r´rµrð*sz(NDFrame._logical_func.<locals>.<genexpr>©r]rq)rÿrºr]rZ filter_type) r?Zvalidate_logical_funcrLrøÚ _logical_funcrÀr›Zarraysr]r±Z _reduce_axis1Ú_reduce)    r³rÿr›rºr\r]rírkr r´r´rµrc×*sH
ÿÿÿÿþýûú    úzNDFrame._logical_funczDataFrame | Series | bool_t)rºr\r]r®cKs|jdtj|||f|ŽS)Nr)rcrlZnanany©r³rºr\r]rír´r´rµr+sÿÿz NDFrame.anycKs|jdtj|||f|ŽS)Nr])rcrlZnanallrer´r´rµr] +sÿÿz NDFrame.all)rÿrºr]c    s†t ˆ|ˆˆ¡‰|dkr |j}n
| |¡}|dkrT|jjˆˆf|ždˆdœˆ—ŽjS‡‡‡‡fdd„}|j |¡}| |¡j    |ˆdS)Nr»r©rºr]cs^t|dƒr|jn|}t|tƒr6|jˆfdˆiˆ—Ž}ntj|ˆˆd}t|dƒrV|jn|}|S)Nr:r]rb)r<r:r¿roÚ _accumulaterlZ na_accum_func)Z
blk_valuesrÂr4©r›rírÿr]r´rµÚblock_accum_func-+s 
z-NDFrame._accum_func.<locals>.block_accum_funcr+)
r?Zvalidate_cum_func_with_skipnar˜ròr:Ú _accum_funcr›rhrÉrÊ)    r³rÿr›rºr]rrírir4r´rhrµrj+s&
 
ÿÿÿÿ zNDFrame._accum_funcrfcOs|jdtjj||f|ž|ŽS)NÚcummax)rjrÚmaximumÚ
accumulate©r³rºr]rrír´r´rµrk=+sÿÿÿzNDFrame.cummaxcOs|jdtjj||f|ž|ŽS)NÚcummin)rjrÚminimumrmrnr´r´rµroB+sÿÿÿzNDFrame.cummincOs|jdtj||f|ž|ŽS)NÚcumsum)rjrrqrnr´r´rµrqG+szNDFrame.cumsumcOs|jdtj||f|ž|ŽS)NÚcumprod)rjrrrrnr´r´rµrrJ+szNDFrame.cumprodzSeries | float)rÿrºr]Úddofrr®cKsBtjd||dt|ddd|dkr,|j}|j||||||dS)Nr´r^r]Fr`)rºrr]rs)r?Zvalidate_stat_ddof_funcrLr˜rd)r³rÿr›rºr]rsrrír´r´rµÚ_stat_function_ddofM+s ÿzNDFrame._stat_function_ddof)rºr]rsrr®cKs|jdtj||||f|ŽS)NÚsem)rtrlZnansem©r³rºr]rsrrír´r´rµrua+sÿÿz NDFrame.semcKs|jdtj||||f|ŽS)NÚvar)rtrlZnanvarrvr´r´rµrwm+sÿÿz NDFrame.varcKs|jdtj||||f|ŽS)NÚstd)rtrlZnanstdrvr´r´rµrxy+sÿÿz NDFrame.std©rÿrºr]rcKsH|dkrt d|¡ntjd||dt|ddd|j|||||dS)NÚmedianr´r^r]Fr`ry)r?Zvalidate_medianÚvalidate_stat_funcrLrd)r³rÿr›rºr]rrír´r´rµÚ_stat_function…+s
ÿzNDFrame._stat_function©rºr]rcKs|jdtj|||f|ŽS)Nrü)r|rlZnanmin©r³rºr]rrír´r´rµrüš+sûúz NDFrame.mincKs|jdtj|||f|ŽS)Nrý)r|rlZnanmaxr~r´r´rµrýª+sûúz NDFrame.max)rºr]rr®cKs|jdtj|||f|ŽS)NÚmean)r|rlZnanmeanr~r´r´rµrº+sÿÿz NDFrame.meancKs|jdtj|||f|ŽS)Nrz)r|rlZ    nanmedianr~r´r´rµrzÅ+sÿÿzNDFrame.mediancKs|jdtj|||f|ŽS)NÚskew)r|rlZnanskewr~r´r´rµr€Ð+sÿÿz NDFrame.skewcKs|jdtj|||f|ŽS)NÚkurt)r|rlZnankurtr~r´r´rµrÛ+sÿÿz NDFrame.kurt©rÿrºr]rÚ    min_countcKsn|dkrt d|¡n&|dkr,t d|¡ntjd||dt|ddd|dkrX|j}|j||||||dS)    NÚsumr´rr^r]Fr`r‚)r?Z validate_sumZ validate_prodr{rLr˜rd)r³rÿr›rºr]rrƒrír´r´rµÚ_min_count_stat_functionè+s  úz NDFrame._min_count_stat_function©rºr]rrƒcKs|jdtj||||f|ŽS)Nr„)r…rlZnansum©r³rºr]rrƒrír´r´rµr„,sÿÿz NDFrame.sumcKs|jdtj||||f|ŽS)Nr)r…rlZnanprodr‡r´r´rµr,súùz NDFrame.prodc
CsÎt|ƒ\}}}ttt|||ttddddddœddd    œd
d „ƒ}t|d |ƒttt|||tt    dddVddd    œd d„ƒ}t|d|ƒtt
d|||ddddWdddddœdd„ƒ}t|d|ƒtt
d|||dt ddXdddddœdd„ƒ}t|d|ƒtt
d|||t t ddYdddddœdd „ƒ}t|d!|ƒttd"|||d#td$dZddd    œd%d&„ƒ}    t|d'|    ƒttd(|||d)td$d[ddd    œd*d+„ƒ}
t|d,|
ƒttd-|||d-td$d\ddd    œd.d/„ƒ} t|d0| ƒttd1|||d2td$d]ddd    œd3d4„ƒ} t|d5| ƒttd6|||tttd7d^ddddd8œd9d:„ƒ} t|d-| ƒttd;|||tttd7d_ddddd8œd<d=„ƒ}t|d2|ƒ||_ttd>|||dddd7d`d?ddd@œdAdB„ƒ}t|dC|ƒttdD|||dddd7dad?ddd@œdEdF„ƒ}t|dG|ƒttdH|||dddd7dbdddd@œdIdJ„ƒ}t|dK|ƒ||_ttdL|||dddd7dcd?ddd@œdMdN„ƒ}t|dO|ƒttdP|||dttd7ddd?ddd@œdQdR„ƒ}t|d)|ƒttdS|||dttd7ded?ddd@œdTdU„ƒ}t|d#|ƒdS)fzO
        Add the operations to the cls; evaluate the doc strings again
        F)ÚdescÚname1Úname2Ú
axis_descrÚsee_alsoÚexamplesZ empty_valuerNTrarr©rfc[stj|f|||dœ|—ŽS)Nra)ršrrer´r´rµr/,sÿüûz,NDFrame._add_numeric_operations.<locals>.anyrc[stj||||f|ŽSrÐ)ršr]rer´r´rµr]K,sz,NDFrame._add_numeric_operations.<locals>.allr]zŠReturn unbiased standard error of the mean over requested axis.
 
Normalized by N-1 by default. This can be changed using the ddof argumentrˆ)rˆr‰rŠr‹Znotesrr»r6râ)rºr]rsrc[stj|||||f|ŽSrÐ)ršrurvr´r´rµru`,sz,NDFrame._add_numeric_operations.<locals>.semruzyReturn unbiased variance over requested axis.
 
Normalized by N-1 by default. This can be changed using the ddof argument.c[stj|||||f|ŽSrÐ)ršrwrvr´r´rµrww,sz,NDFrame._add_numeric_operations.<locals>.varrwzReturn sample standard deviation over requested axis.
 
Normalized by N-1 by default. This can be changed using the ddof argument.c[stj|||||f|ŽSrÐ)ršrxrvr´r´rµrx,sz,NDFrame._add_numeric_operations.<locals>.stdrxrprü)rˆr‰rŠr‹Zaccum_func_namerc_stj|||f|ž|ŽSrÐ)ršrornr´r´rµro¤,s z/NDFrame._add_numeric_operations.<locals>.cumminrorlrýc_stj|||f|ž|ŽSrÐ)ršrkrnr´r´rµrk´,s z/NDFrame._add_numeric_operations.<locals>.cummaxrkr„c_stj|||f|ž|ŽSrÐ)ršrqrnr´r´rµrqÄ,s z/NDFrame._add_numeric_operations.<locals>.cumsumrqÚproductrc_stj|||f|ž|ŽSrÐ)ršrrrnr´r´rµrrÔ,s z0NDFrame._add_numeric_operations.<locals>.cumprodrrzfReturn the sum of the values over the requested axis.
 
This is equivalent to the method ``numpy.sum``.)rˆr‰rŠr‹rƒrŒrr†c[stj|||||f|ŽSrÐ)ršr„r‡r´r´rµr„å,sz,NDFrame._add_numeric_operations.<locals>.sumz9Return the product of the values over the requested axis.c[stj|||||f|ŽSrÐ)ršrr‡r´r´rµrü,sz-NDFrame._add_numeric_operations.<locals>.prodz6Return the mean of the values over the requested axis.zAxisInt | Noner}c[stj||||f|ŽSrÐ)ršrr~r´r´rµr-sz-NDFrame._add_numeric_operations.<locals>.meanrz=Return unbiased skew over requested axis.
 
Normalized by N-1.c[stj||||f|ŽSrÐ)ršr€r~r´r´rµr€(-sz-NDFrame._add_numeric_operations.<locals>.skewr€z–Return unbiased kurtosis over requested axis.
 
Kurtosis obtained using Fisher's definition of
kurtosis (kurtosis of normal == 0.0). Normalized by N-1.c[stj||||f|ŽSrÐ)ršrr~r´r´rµr=-sz-NDFrame._add_numeric_operations.<locals>.kurtrz8Return the median of the values over the requested axis.c[stj||||f|ŽSrÐ)ršrzr~r´r´rµrzV-sz/NDFrame._add_numeric_operations.<locals>.medianrzzµReturn the maximum of the values over the requested axis.
 
If you want the *index* of the maximum, use ``idxmax``. This is the equivalent of the ``numpy.ndarray`` method ``argmax``.c[stj||||f|ŽSrÐ)ršrýr~r´r´rµrýk-sz,NDFrame._add_numeric_operations.<locals>.maxzµReturn the minimum of the values over the requested axis.
 
If you want the *index* of the minimum, use ``idxmin``. This is the equivalent of the ``numpy.ndarray`` method ``argmin``.c[stj||||f|ŽSrÐ)ršrür~r´r´rµrü‚-sz,NDFrame._add_numeric_operations.<locals>.min)rNT)NTr»F)NTr»F)NTr»F)NT)NT)NT)NT)NTFr)NTFr)rTF)rTF)rTF)rTF)rTF)rTF)Ú _doc_paramsrHÚ    _bool_docÚ    _any_descÚ _any_see_alsoÚ _any_examplesrÚ    _all_descÚ _all_see_alsoÚ _all_examplesÚ _num_ddof_docÚ _var_examplesÚ
_std_notesÚ _std_examplesÚ    _cnum_docÚ_cummin_examplesÚ_cummax_examplesÚ_cumsum_examplesÚ_cumprod_examplesÚ_num_docÚ_min_count_stubÚ_stat_func_see_alsoÚ _sum_examplesÚ_prod_examplesrŽÚkurtosisÚ _max_examplesÚ _min_examples)rÄr‹r‰rŠrr]rurwrxrorkrqrrr„rrr€rrzrýrür´r´rµÚ_add_numeric_operations(,søø û ø ü     ÷ û
ø û
÷ û
ù
ÿ ù
ÿ ù
ÿ ù
ÿ ÷ û
ø û
ø ü     ø ü     õü     ø ü     öü     öü    zNDFrame._add_numeric_operationsÚsinglez3int | dt.timedelta | str | BaseOffset | BaseIndexerzWindow | Rolling)
ÚwindowÚ min_periodsÚcenterÚwin_typer rºr Ústepr,r®c
 
CsJ| |¡}|dk    r.t||||||||||    d
St||||||||||    d
S)N)    rªr«r¬r­r rºr r®r,)ròr‹rŠ)
r³rªr«r¬r­r rºr r®r,r´r´rµÚrolling™-s4
ö özNDFrame.rollingrˆ)r«rºr,r®cCs| |¡}t||||dS)N)r«rºr,)ròrˆ)r³r«rºr,r´r´rµÚ    expandingÄ-s
zNDFrame.expandingz(float | TimedeltaConvertibleTypes | Nonez&np.ndarray | DataFrame | Series | Noner‰) ÚcomÚspanÚhalflifeÚalphar«ÚadjustÚ    ignore_narºÚtimesr,r®c Cs(| |¡}t||||||||||    |
d S)N)
r±r²r³r´r«rµr¶rºr·r,)ròr‰) r³r±r²r³r´r«rµr¶rºr·r,r´r´rµÚewmÏ-s
õz NDFrame.ewmcCsh|||ƒ}|jdkrD| |¡rDt|j|jƒrD|j tdƒ|j¡|S| ¡|j    |j
|dddd|S)z<
        Wrap arithmetic method to operate inplace.
        r»NFrH)r:) rør_rXr¸r›Zsetitem_inplacer7r.r8rMre)r³r\Úopr4r´r´rµÚ_inplace_methodð-s$
ÿþ ýÿ ÿzNDFrame._inplace_methodcCs| |t|ƒj¡SrÐ)rºr`Ú__add__r^r´r´rµÚ__iadd__.szNDFrame.__iadd__cCs| |t|ƒj¡SrÐ)rºr`Ú__sub__r^r´r´rµÚ__isub__.szNDFrame.__isub__cCs| |t|ƒj¡SrÐ)rºr`Ú__mul__r^r´r´rµÚ__imul__.szNDFrame.__imul__cCs| |t|ƒj¡SrÐ)rºr`Ú __truediv__r^r´r´rµÚ __itruediv__.sÿzNDFrame.__itruediv__cCs| |t|ƒj¡SrÐ)rºr`Ú __floordiv__r^r´r´rµÚ __ifloordiv__ .sÿzNDFrame.__ifloordiv__cCs| |t|ƒj¡SrÐ)rºr`Ú__mod__r^r´r´rµÚ__imod__&.szNDFrame.__imod__cCs| |t|ƒj¡SrÐ)rºr`Ú__pow__r^r´r´rµÚ__ipow__*.szNDFrame.__ipow__cCs| |t|ƒj¡SrÐ)rºr`Ú__and__r^r´r´rµÚ__iand__..szNDFrame.__iand__cCs| |t|ƒj¡SrÐ)rºr`Ú__or__r^r´r´rµÚ__ior__2.szNDFrame.__ior__cCs| |t|ƒj¡SrÐ)rºr`Ú__xor__r^r´r´rµÚ__ixor__6.szNDFrame.__ixor__zHashable | None)rr®cCs.t|j|t|jƒd}|dkr$dS|j|S)a
        Retrieves the index of the first valid value.
 
        Parameters
        ----------
        how : {'first', 'last'}
            Use this parameter to change between the first or last valid index.
 
        Returns
        -------
        idx_first_valid : type of index
        )rZis_validN)rƒr.rfrÞ)r³rZidxposr´r´rµÚ_find_valid_index=.szNDFrame._find_valid_indexr)r r—cCs |jddS)a
        Return index for {position} non-NA value or None, if no non-NA value is found.
 
        Returns
        -------
        type of index
 
        Notes
        -----
        If all elements are non-NA/null, returns None.
        Also returns None for empty {klass}.
        r©r©rÏrÎr´r´rµÚfirst_valid_indexP.szNDFrame.first_valid_indexcCs |jddS)NrzrÐrÑrÎr´r´rµÚlast_valid_indexa.szNDFrame.last_valid_index)FN)NF)T)N)N)r)N)N).).).)rFT)r)r)r)r)r)r)r)N)r¾rˆNNTTNrrNTr¿NN) NNNrÓTrÔNFrÕTNNrÖ) rÅNNFNTNNNNrãrä)NrðTNNNN)TN).....................)....................)NNTTrNNNTFNNNNrNNNNNN)N).....................)....................)NrªrˆNNTTNrÖNrÕNr6NNNTNrrãN)FTF)r)rT)r)rNT)r)T)rWF)N)NNNN).).).)N)Nr?F)T)N)N)NFF)NNNN)r)r)NNFNNNF)N)Nr?)T)T)N)N)TTTTTr½).).).)N)..)..)..)rà)N)F)NN)NNFN)FN)rN)
rNNrîNNNr
NF)rrFrTF)r»FFr^)    r,NNNNNNrN)r,NNNNNNr)r,NNNNNNr).).).).).).)r»NrN)NNNN)rNN)rNNr?r?)NNN)r»r×NN)rFT)rFT)rFT)NT)NT)NT)NT)NT)NTr»F)NTr»F)NTr»F)NTr»F)rTF)rTF)rTF)rTF)rTF)rTF)rTF)NTFr)NTFr)NTFr)NFNNrNNr©)r»rr©)
NNNNrTFrNr©)ïrÚÚ
__module__Ú __qualname__Ú__doc__r¢Ú__annotations__r¥r£r¤Ú    frozensetr¥r ržr¶Ú classmethodrÇrÌÚpropertyr­ÚsetterrrÒrÖrÛrÉrÝr˜rrárïròrôrèr¾rr r rrrr–rørrrr"r*rHÚ_shared_doc_kwargsr2r5r:rRrrTrrWrXr_rZrfrmrnrpÚ__bool__rqrsrurwr{ryr‚r‡rŠr‘r”rr½r—r˜r™ršržr¡r¤r¨r°r´r¼r†rÐr¹rïrõÚpickleÚHIGHEST_PROTOCOLrùrýrÿr³r(r5r8r>r!rBr@rFr‰rQrSrErVr=r_rHr%rNrerŽrhrMrqrtryr}rrërdrƒrr‚r„rr¸r”rmrœrÊr¢r±r¦r©r«r¬r†r¯r°r±rÂr.rœrÃr¬r¸rºr»rÆrËrÔr×rØrÙr–rÎrðrfròrgrôrørûrÿrrr    rrrzrr#r1r/r0r=rÐrmrBrDrFrSrYr[rcrr]rjrkrorqrrrtrurwrxr|rürýrrzr€rr¥r…r„rrŽr¨rŠr¯rˆr°r‰r¸rºr¼r¾rÀrÂrÄrÆrÈrÊrÌrÎrÏrÒrÓÚ __classcell__r´r´r§rµršâst    
 ó   üû'ü4
         û&     ÿ5 ?tþö$Gþø þù þøþø0ÿFV.F +<Q   @  &
 
 
ýð<þò@ñ:ö0?þû(CÿHSêJêLêL)þø,CêPêRþêTIüRüû"3  J(:ú oþ÷, þ÷. þ÷.þ÷,'ú V I H÷0 ÷. ÷0÷.õ6õ8õ8õ65þõ* û.ûjJLø, ?ÿ+)    ÿ6q    /ù(2þø2 þø0 þø2 þø2ú,
ú*
ú,
ú, ú,ú,
ú*
ú,
ú, ú,ýø* ýø( ýø* üýø*Fþ÷,/. > >"ýú !ú(|ÿ:û Tô2H?ù&ú Hõ4Aö ?ö Rúýù$ ýù" ýù$ û
ýù$ýù$ ýù" ýù$ ú ýù$ û û! ÿO ù(8üyû  ú",ü ü û$ù$û û û  úüüü ü ü ü ù !ûûrö4)ü"    õ<ršcCsHdd dd„t|jƒDƒ¡›d}|jdkr4|jjnd}|j}|||fS)z!Return a tuple of the doc params.Ú{z, cSs g|]\}}|›d|›d‘qS)z (r­r´r8r´r´rµrj.sz_doc_params.<locals>.<listcomp>Ú}r»Zscalar)r®rúrßrårMrÚ)rÄr‹rÿrŠr´r´rµrg.s
 ÿrac
{desc}
 
Parameters
----------
axis : {axis_descr}
    Axis for the function to be applied on.
    For `Series` this parameter is unused and defaults to 0.
 
    For DataFrames, specifying ``axis=None`` will apply the aggregation
    across both axes.
 
    .. versionadded:: 2.0.0
 
skipna : bool, default True
    Exclude NA/null values when computing the result.
numeric_only : bool, default False
    Include only float, int, boolean columns. Not implemented for Series.
 
{min_count}**kwargs
    Additional keyword arguments to be passed to the function.
 
Returns
-------
{name1} or scalar{see_also}{examples}
a+
{desc}
 
Parameters
----------
axis : {axis_descr}
    For `Series` this parameter is unused and defaults to 0.
skipna : bool, default True
    Exclude NA/null values. If an entire row/column is NA, the result
    will be NA.
ddof : int, default 1
    Delta Degrees of Freedom. The divisor used in calculations is N - ddof,
    where N represents the number of elements.
numeric_only : bool, default False
    Include only float, int, boolean columns. Not implemented for Series.
 
Returns
-------
{name1} or {name2} (if level specified) {notes}{examples}
zg
 
Notes
-----
To have the same behaviour as `numpy.std`, use `ddof=0` (instead of the
default `ddof=1`)ay
 
Examples
--------
>>> df = pd.DataFrame({'person_id': [0, 1, 2, 3],
...                    'age': [21, 25, 62, 43],
...                    'height': [1.61, 1.87, 1.49, 2.01]}
...                   ).set_index('person_id')
>>> df
           age  height
person_id
0           21    1.61
1           25    1.87
2           62    1.49
3           43    2.01
 
The standard deviation of the columns can be found as follows:
 
>>> df.std()
age       18.786076
height     0.237417
dtype: float64
 
Alternatively, `ddof=0` can be set to normalize by N instead of N-1:
 
>>> df.std(ddof=0)
age       16.269219
height     0.205609
dtype: float64a<
 
Examples
--------
>>> df = pd.DataFrame({'person_id': [0, 1, 2, 3],
...                   'age': [21, 25, 62, 43],
...                   'height': [1.61, 1.87, 1.49, 2.01]}
...                  ).set_index('person_id')
>>> df
           age  height
person_id
0           21    1.61
1           25    1.87
2           62    1.49
3           43    2.01
 
>>> df.var()
age       352.916667
height      0.056367
dtype: float64
 
Alternatively, ``ddof=0`` can be set to normalize by N instead of N-1:
 
>>> df.var(ddof=0)
age       264.687500
height      0.042275
dtype: float64a‰
{desc}
 
Parameters
----------
axis : {{0 or 'index', 1 or 'columns', None}}, default 0
    Indicate which axis or axes should be reduced. For `Series` this parameter
    is unused and defaults to 0.
 
    * 0 / 'index' : reduce the index, return a Series whose index is the
      original column labels.
    * 1 / 'columns' : reduce the columns, return a Series whose index is the
      original index.
    * None : reduce all axes, return a scalar.
 
bool_only : bool, default None
    Include only boolean columns. If None, will attempt to use everything,
    then use only boolean data. Not implemented for Series.
skipna : bool, default True
    Exclude NA/null values. If the entire row/column is NA and skipna is
    True, then the result will be {empty_value}, as for an empty row/column.
    If skipna is False, then NA are treated as True, because these are not
    equal to zero.
**kwargs : any, default None
    Additional keywords have no effect but might be accepted for
    compatibility with NumPy.
 
Returns
-------
{name1} or {name2}
    If level is specified, then, {name2} is returned; otherwise, {name1}
    is returned.
 
{see_also}
{examples}zËReturn whether all elements are True, potentially over an axis.
 
Returns True unless there at least one element within a series or
along a Dataframe axis that is False or equivalent (e.g. zero or
empty).aóExamples
--------
**Series**
 
>>> pd.Series([True, True]).all()
True
>>> pd.Series([True, False]).all()
False
>>> pd.Series([], dtype="float64").all()
True
>>> pd.Series([np.nan]).all()
True
>>> pd.Series([np.nan]).all(skipna=False)
True
 
**DataFrames**
 
Create a dataframe from a dictionary.
 
>>> df = pd.DataFrame({'col1': [True, True], 'col2': [True, False]})
>>> df
   col1   col2
0  True   True
1  True  False
 
Default behaviour checks if values in each column all return True.
 
>>> df.all()
col1     True
col2    False
dtype: bool
 
Specify ``axis='columns'`` to check if values in each row all return True.
 
>>> df.all(axis='columns')
0     True
1    False
dtype: bool
 
Or ``axis=None`` for whether every value is True.
 
>>> df.all(axis=None)
False
z…See Also
--------
Series.all : Return True if all elements are True.
DataFrame.any : Return True if one (or more) elements are True.
aZ
Return cumulative {desc} over a DataFrame or Series axis.
 
Returns a DataFrame or Series of the same size containing the cumulative
{desc}.
 
Parameters
----------
axis : {{0 or 'index', 1 or 'columns'}}, default 0
    The index or the name of the axis. 0 is equivalent to None or 'index'.
    For `Series` this parameter is unused and defaults to 0.
skipna : bool, default True
    Exclude NA/null values. If an entire row/column is NA, the result
    will be NA.
*args, **kwargs
    Additional keywords have no effect but might be accepted for
    compatibility with NumPy.
 
Returns
-------
{name1} or {name2}
    Return cumulative {desc} of {name1} or {name2}.
 
See Also
--------
core.window.expanding.Expanding.{accum_func_name} : Similar functionality
    but ignores ``NaN`` values.
{name2}.{accum_func_name} : Return the {desc} over
    {name2} axis.
{name2}.cummax : Return cumulative maximum over {name2} axis.
{name2}.cummin : Return cumulative minimum over {name2} axis.
{name2}.cumsum : Return cumulative sum over {name2} axis.
{name2}.cumprod : Return cumulative product over {name2} axis.
 
{examples}a½Examples
--------
**Series**
 
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0    2.0
1    NaN
2    5.0
3   -1.0
4    0.0
dtype: float64
 
By default, NA values are ignored.
 
>>> s.cummin()
0    2.0
1    NaN
2    2.0
3   -1.0
4   -1.0
dtype: float64
 
To include NA values in the operation, use ``skipna=False``
 
>>> s.cummin(skipna=False)
0    2.0
1    NaN
2    NaN
3    NaN
4    NaN
dtype: float64
 
**DataFrame**
 
>>> df = pd.DataFrame([[2.0, 1.0],
...                    [3.0, np.nan],
...                    [1.0, 0.0]],
...                   columns=list('AB'))
>>> df
     A    B
0  2.0  1.0
1  3.0  NaN
2  1.0  0.0
 
By default, iterates over rows and finds the minimum
in each column. This is equivalent to ``axis=None`` or ``axis='index'``.
 
>>> df.cummin()
     A    B
0  2.0  1.0
1  2.0  NaN
2  1.0  0.0
 
To iterate over columns and find the minimum in each row,
use ``axis=1``
 
>>> df.cummin(axis=1)
     A    B
0  2.0  1.0
1  3.0  NaN
2  1.0  0.0
aµExamples
--------
**Series**
 
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0    2.0
1    NaN
2    5.0
3   -1.0
4    0.0
dtype: float64
 
By default, NA values are ignored.
 
>>> s.cumsum()
0    2.0
1    NaN
2    7.0
3    6.0
4    6.0
dtype: float64
 
To include NA values in the operation, use ``skipna=False``
 
>>> s.cumsum(skipna=False)
0    2.0
1    NaN
2    NaN
3    NaN
4    NaN
dtype: float64
 
**DataFrame**
 
>>> df = pd.DataFrame([[2.0, 1.0],
...                    [3.0, np.nan],
...                    [1.0, 0.0]],
...                   columns=list('AB'))
>>> df
     A    B
0  2.0  1.0
1  3.0  NaN
2  1.0  0.0
 
By default, iterates over rows and finds the sum
in each column. This is equivalent to ``axis=None`` or ``axis='index'``.
 
>>> df.cumsum()
     A    B
0  2.0  1.0
1  5.0  NaN
2  6.0  1.0
 
To iterate over columns and find the sum in each row,
use ``axis=1``
 
>>> df.cumsum(axis=1)
     A    B
0  2.0  3.0
1  3.0  NaN
2  1.0  1.0
aÆExamples
--------
**Series**
 
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0    2.0
1    NaN
2    5.0
3   -1.0
4    0.0
dtype: float64
 
By default, NA values are ignored.
 
>>> s.cumprod()
0     2.0
1     NaN
2    10.0
3   -10.0
4    -0.0
dtype: float64
 
To include NA values in the operation, use ``skipna=False``
 
>>> s.cumprod(skipna=False)
0    2.0
1    NaN
2    NaN
3    NaN
4    NaN
dtype: float64
 
**DataFrame**
 
>>> df = pd.DataFrame([[2.0, 1.0],
...                    [3.0, np.nan],
...                    [1.0, 0.0]],
...                   columns=list('AB'))
>>> df
     A    B
0  2.0  1.0
1  3.0  NaN
2  1.0  0.0
 
By default, iterates over rows and finds the product
in each column. This is equivalent to ``axis=None`` or ``axis='index'``.
 
>>> df.cumprod()
     A    B
0  2.0  1.0
1  6.0  NaN
2  6.0  0.0
 
To iterate over columns and find the product in each row,
use ``axis=1``
 
>>> df.cumprod(axis=1)
     A    B
0  2.0  2.0
1  3.0  NaN
2  1.0  0.0
a½Examples
--------
**Series**
 
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0    2.0
1    NaN
2    5.0
3   -1.0
4    0.0
dtype: float64
 
By default, NA values are ignored.
 
>>> s.cummax()
0    2.0
1    NaN
2    5.0
3    5.0
4    5.0
dtype: float64
 
To include NA values in the operation, use ``skipna=False``
 
>>> s.cummax(skipna=False)
0    2.0
1    NaN
2    NaN
3    NaN
4    NaN
dtype: float64
 
**DataFrame**
 
>>> df = pd.DataFrame([[2.0, 1.0],
...                    [3.0, np.nan],
...                    [1.0, 0.0]],
...                   columns=list('AB'))
>>> df
     A    B
0  2.0  1.0
1  3.0  NaN
2  1.0  0.0
 
By default, iterates over rows and finds the maximum
in each column. This is equivalent to ``axis=None`` or ``axis='index'``.
 
>>> df.cummax()
     A    B
0  2.0  1.0
1  3.0  NaN
2  3.0  1.0
 
To iterate over columns and find the maximum in each row,
use ``axis=1``
 
>>> df.cummax(axis=1)
     A    B
0  2.0  2.0
1  3.0  NaN
2  1.0  1.0
a2See Also
--------
numpy.any : Numpy version of this method.
Series.any : Return whether any element is True.
Series.all : Return whether all elements are True.
DataFrame.any : Return whether any element is True over requested axis.
DataFrame.all : Return whether all elements are True over requested axis.
zÔReturn whether any element is True, potentially over an axis.
 
Returns False unless there is at least one element within a series or
along a Dataframe axis that is True or equivalent (e.g. non-zero or
non-empty).a\Examples
--------
**Series**
 
For Series input, the output is a scalar indicating whether any element
is True.
 
>>> pd.Series([False, False]).any()
False
>>> pd.Series([True, False]).any()
True
>>> pd.Series([], dtype="float64").any()
False
>>> pd.Series([np.nan]).any()
False
>>> pd.Series([np.nan]).any(skipna=False)
True
 
**DataFrame**
 
Whether each column contains at least one True element (the default).
 
>>> df = pd.DataFrame({"A": [1, 2], "B": [0, 2], "C": [0, 0]})
>>> df
   A  B  C
0  1  0  0
1  2  2  0
 
>>> df.any()
A     True
B     True
C    False
dtype: bool
 
Aggregating over the columns.
 
>>> df = pd.DataFrame({"A": [True, False], "B": [1, 2]})
>>> df
       A  B
0   True  1
1  False  2
 
>>> df.any(axis='columns')
0    True
1    True
dtype: bool
 
>>> df = pd.DataFrame({"A": [True, False], "B": [1, 0]})
>>> df
       A  B
0   True  1
1  False  0
 
>>> df.any(axis='columns')
0    True
1    False
dtype: bool
 
Aggregating over the entire DataFrame with ``axis=None``.
 
>>> df.any(axis=None)
True
 
`any` for an empty DataFrame is an empty Series.
 
>>> pd.DataFrame([]).any()
Series([], dtype: bool)
a—
 
Examples
--------
>>> idx = pd.MultiIndex.from_arrays([
...     ['warm', 'warm', 'cold', 'cold'],
...     ['dog', 'falcon', 'fish', 'spider']],
...     names=['blooded', 'animal'])
>>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx)
>>> s
blooded  animal
warm     dog       4
         falcon    2
cold     fish      0
         spider    8
Name: legs, dtype: int64
 
>>> s.{stat_func}()
{default_output}Zstat_func_exampler„ZSumééé)Ú    stat_funcZverbZdefault_outputZlevel_output_0Zlevel_output_1a
 
By default, the sum of an empty or all-NA Series is ``0``.
 
>>> pd.Series([], dtype="float64").sum()  # min_count=0 is the default
0.0
 
This can be controlled with the ``min_count`` parameter. For example, if
you'd like the sum of an empty series to be NaN, pass ``min_count=1``.
 
>>> pd.Series([], dtype="float64").sum(min_count=1)
nan
 
Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and
empty series identically.
 
>>> pd.Series([np.nan]).sum()
0.0
 
>>> pd.Series([np.nan]).sum(min_count=1)
nanrýZMaxér§r¦rüZMinr÷r§a
 
See Also
--------
Series.sum : Return the sum.
Series.min : Return the minimum.
Series.max : Return the maximum.
Series.idxmin : Return the index of the minimum.
Series.idxmax : Return the index of the maximum.
DataFrame.sum : Return the sum over the requested axis.
DataFrame.min : Return the minimum over the requested axis.
DataFrame.max : Return the maximum over the requested axis.
DataFrame.idxmin : Return the index of the minimum over the requested axis.
DataFrame.idxmax : Return the index of the maximum over the requested axis.a¦
 
Examples
--------
By default, the product of an empty or all-NA Series is ``1``
 
>>> pd.Series([], dtype="float64").prod()
1.0
 
This can be controlled with the ``min_count`` parameter
 
>>> pd.Series([], dtype="float64").prod(min_count=1)
nan
 
Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and
empty series identically.
 
>>> pd.Series([np.nan]).prod()
1.0
 
>>> pd.Series([np.nan]).prod(min_count=1)
nanz®min_count : int, default 0
    The required number of valid values to perform the operation. If fewer than
    ``min_count`` non-NA values are present the result will be NA.
r3z Index | Noneztuple[NDFrameT, NDFrameT])rrçr6r®cCsHt|jjƒr@|jj|jjkr@|dk    r@| ¡}| ¡}||_||_||fS)zt
    If we are aligning timezone-aware DatetimeIndexes and the timezones
    do not match, convert both to UTC.
    N)rVrÞr¸rIr¬)rrçr6r´r´rµr5+1s r5)éÚ
__future__rrºÚdatetimerUÚ    functoolsrr\ràrrbrÞrÚtypingrrrr    r
r r r rrrrrrr]rUÚnumpyrZpandas._configrrZ pandas._libsrZpandas._libs.librZpandas._libs.tslibsrrrrZpandas._typingrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAZpandas.compat._optionalrBZpandas.compat.numpyrCr?Z pandas.errorsrDrErFrGZpandas.util._decoratorsrHZpandas.util._exceptionsrIZpandas.util._validatorsrJrKrLrMrNZpandas.core.dtypes.astyperOZpandas.core.dtypes.commonrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`raZpandas.core.dtypes.genericrbrcZpandas.core.dtypes.inferencerdreZpandas.core.dtypes.missingrfrgZ pandas.corerhr rirjrkrlrmZpandas.core.array_algos.replacernZpandas.core.arraysroZpandas.core.baserpZpandas.core.constructionrqZpandas.core.flagsrrZpandas.core.indexes.apirsrtrurvrwrxryZpandas.core.internalsrzr{r|Z"pandas.core.internals.constructionr}r~Zpandas.core.methods.describer€Zpandas.core.missingrr‚rƒZpandas.core.opsr„Zpandas.core.reshape.concatr…Zpandas.core.shared_docsr†Zpandas.core.sortingr‡Zpandas.core.windowrˆr‰rŠr‹Zpandas.io.formats.formatrŒrZpandas.io.formats.printingrŽrZpandas.core.framerZpandas.core.indexers.objectsr‘rr’Zpandas.core.seriesr”Zpandas.io.pytablesr•rÜrqr©Z IndexingMixinršrr r—r™ršr˜rr”r–r•r›rœržrŸrr’r‘r“rèr£r¦r×r§r¢r¤r¡r5r´r´r´rµÚ<module>s˜   @   (     P      $                õ`
$.$AAAA
Hþÿÿÿÿ