@@ -308,6 +308,21 @@ else:
308
308
@overload
309
309
def __getitem__ (self , key : Hashable ) -> Series : ...
310
310
311
+ _AstypeArgExt : TypeAlias = (
312
+ AstypeArg
313
+ | Literal [
314
+ "number" ,
315
+ "datetime64" ,
316
+ "datetime" ,
317
+ "integer" ,
318
+ "timedelta" ,
319
+ "timedelta64" ,
320
+ "datetimetz" ,
321
+ "datetime64[ns]" ,
322
+ ]
323
+ )
324
+ _AstypeArgExtList : TypeAlias = _AstypeArgExt | list [_AstypeArgExt ]
325
+
311
326
class DataFrame (NDFrame , OpsMixin , _GetItemHack ):
312
327
313
328
__hash__ : ClassVar [None ] # type: ignore[assignment] # pyright: ignore[reportIncompatibleMethodOverride]
@@ -458,6 +473,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
458
473
def to_gbq (
459
474
self ,
460
475
destination_table : str ,
476
+ * ,
461
477
project_id : str | None = ...,
462
478
chunksize : int | None = ...,
463
479
reauth : bool = ...,
@@ -524,6 +540,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
524
540
def to_parquet (
525
541
self ,
526
542
path : FilePath | WriteBuffer [bytes ],
543
+ * ,
527
544
engine : ParquetEngine = ...,
528
545
compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
529
546
index : bool | None = ...,
@@ -535,6 +552,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
535
552
def to_parquet (
536
553
self ,
537
554
path : None = ...,
555
+ * ,
538
556
engine : ParquetEngine = ...,
539
557
compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
540
558
index : bool | None = ...,
@@ -564,6 +582,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
564
582
def to_html (
565
583
self ,
566
584
buf : FilePath | WriteBuffer [str ],
585
+ * ,
567
586
columns : SequenceNotStr [Hashable ] | Index | Series | None = ...,
568
587
col_space : ColspaceArgType | None = ...,
569
588
header : _bool = ...,
@@ -611,6 +630,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
611
630
def to_html (
612
631
self ,
613
632
buf : None = ...,
633
+ * ,
614
634
columns : Sequence [Hashable ] | None = ...,
615
635
col_space : ColspaceArgType | None = ...,
616
636
header : _bool = ...,
@@ -746,27 +766,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
746
766
def eval (
747
767
self , expr : _str , * , inplace : Literal [False ] = ..., ** kwargs : Any
748
768
) -> Scalar | np .ndarray | Self | Series : ...
749
- AstypeArgExt : TypeAlias = (
750
- AstypeArg
751
- | Literal [
752
- "number" ,
753
- "datetime64" ,
754
- "datetime" ,
755
- "integer" ,
756
- "timedelta" ,
757
- "timedelta64" ,
758
- "datetimetz" ,
759
- "datetime64[ns]" ,
760
- ]
761
- )
762
- AstypeArgExtList : TypeAlias = AstypeArgExt | list [AstypeArgExt ]
763
769
@overload
764
770
def select_dtypes (
765
- self , include : StrDtypeArg , exclude : AstypeArgExtList | None = ...
771
+ self , include : StrDtypeArg , exclude : _AstypeArgExtList | None = ...
766
772
) -> Never : ...
767
773
@overload
768
774
def select_dtypes (
769
- self , include : AstypeArgExtList | None , exclude : StrDtypeArg
775
+ self , include : _AstypeArgExtList | None , exclude : StrDtypeArg
770
776
) -> Never : ...
771
777
@overload
772
778
def select_dtypes (self , exclude : StrDtypeArg ) -> Never : ...
@@ -775,19 +781,19 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
775
781
@overload
776
782
def select_dtypes (
777
783
self ,
778
- include : AstypeArgExtList ,
779
- exclude : AstypeArgExtList | None = ...,
784
+ include : _AstypeArgExtList ,
785
+ exclude : _AstypeArgExtList | None = ...,
780
786
) -> Self : ...
781
787
@overload
782
788
def select_dtypes (
783
789
self ,
784
- include : AstypeArgExtList | None ,
785
- exclude : AstypeArgExtList ,
790
+ include : _AstypeArgExtList | None ,
791
+ exclude : _AstypeArgExtList ,
786
792
) -> Self : ...
787
793
@overload
788
794
def select_dtypes (
789
795
self ,
790
- exclude : AstypeArgExtList ,
796
+ exclude : _AstypeArgExtList ,
791
797
) -> Self : ...
792
798
def insert (
793
799
self ,
@@ -810,6 +816,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
810
816
def reindex (
811
817
self ,
812
818
labels : Axes | None = ...,
819
+ * ,
813
820
index : Axes | None = ...,
814
821
columns : Axes | None = ...,
815
822
axis : Axis | None = ...,
@@ -1301,8 +1308,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1301
1308
def pivot (
1302
1309
self ,
1303
1310
* ,
1311
+ columns : IndexLabel ,
1304
1312
index : IndexLabel = ...,
1305
- columns : IndexLabel = ...,
1306
1313
values : IndexLabel = ...,
1307
1314
) -> Self : ...
1308
1315
def pivot_table (
@@ -1320,11 +1327,18 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1320
1327
) -> Self : ...
1321
1328
@overload
1322
1329
def stack (
1323
- self , level : IndexLabel = ..., dropna : _bool = ..., sort : _bool = ...
1330
+ self ,
1331
+ level : IndexLabel = ...,
1332
+ * ,
1333
+ future_stack : Literal [True ],
1324
1334
) -> Self | Series : ...
1325
1335
@overload
1326
1336
def stack (
1327
- self , level : IndexLabel = ..., future_stack : _bool = ...
1337
+ self ,
1338
+ level : IndexLabel = ...,
1339
+ dropna : _bool = ...,
1340
+ sort : _bool = ...,
1341
+ future_stack : Literal [False ] = ...,
1328
1342
) -> Self | Series : ...
1329
1343
def explode (
1330
1344
self , column : Sequence [Hashable ], ignore_index : _bool = ...
@@ -1576,14 +1590,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1576
1590
method : Literal ["pearson" , "kendall" , "spearman" ] = ...,
1577
1591
numeric_only : _bool = ...,
1578
1592
) -> Series : ...
1579
- @overload
1580
- def count (
1581
- self , axis : Axis = ..., numeric_only : _bool = ..., * , level : Level
1582
- ) -> Self : ...
1583
- @overload
1584
- def count (
1585
- self , axis : Axis = ..., level : None = ..., numeric_only : _bool = ...
1586
- ) -> Series : ...
1593
+ def count (self , axis : Axis = ..., numeric_only : _bool = ...) -> Series [int ]: ...
1587
1594
def nunique (self , axis : Axis = ..., dropna : bool = ...) -> Series : ...
1588
1595
def idxmax (
1589
1596
self , axis : Axis = ..., skipna : _bool = ..., numeric_only : _bool = ...
@@ -1780,6 +1787,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1780
1787
self ,
1781
1788
start_time : _str | dt .time ,
1782
1789
end_time : _str | dt .time ,
1790
+ inclusive : IntervalClosedType = ...,
1783
1791
axis : Axis | None = ...,
1784
1792
) -> Self : ...
1785
1793
@overload
@@ -1980,8 +1988,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1980
1988
@final
1981
1989
def head (self , n : int = ...) -> Self : ...
1982
1990
@final
1983
- def infer_objects (self ) -> Self : ...
1984
- # def info
1991
+ def infer_objects (self , copy : _bool | None = ...) -> Self : ...
1985
1992
@overload
1986
1993
def interpolate (
1987
1994
self ,
@@ -2077,15 +2084,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2077
2084
self ,
2078
2085
axis : Axis | None = ...,
2079
2086
skipna : _bool | None = ...,
2080
- level : None = ...,
2081
2087
numeric_only : _bool = ...,
2082
2088
** kwargs : Any ,
2083
2089
) -> Series : ...
2084
2090
def min (
2085
2091
self ,
2086
2092
axis : Axis | None = ...,
2087
2093
skipna : _bool | None = ...,
2088
- level : None = ...,
2089
2094
numeric_only : _bool = ...,
2090
2095
** kwargs : Any ,
2091
2096
) -> Series : ...
@@ -2117,8 +2122,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2117
2122
periods : int = ...,
2118
2123
fill_method : None = ...,
2119
2124
freq : DateOffset | dt .timedelta | _str | None = ...,
2120
- * ,
2121
- axis : Axis = ...,
2122
2125
fill_value : Scalar | NAType | None = ...,
2123
2126
) -> Self : ...
2124
2127
def pop (self , item : _str ) -> Series : ...
@@ -2133,7 +2136,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2133
2136
self ,
2134
2137
axis : Axis | None = ...,
2135
2138
skipna : _bool | None = ...,
2136
- level : None = ...,
2137
2139
numeric_only : _bool = ...,
2138
2140
min_count : int = ...,
2139
2141
** kwargs : Any ,
@@ -2142,7 +2144,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2142
2144
self ,
2143
2145
axis : Axis | None = ...,
2144
2146
skipna : _bool = ...,
2145
- level : None = ...,
2146
2147
numeric_only : _bool = ...,
2147
2148
min_count : int = ...,
2148
2149
** kwargs : Any ,
@@ -2305,18 +2306,16 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2305
2306
self ,
2306
2307
axis : Axis | None = ...,
2307
2308
skipna : _bool | None = ...,
2308
- level : None = ...,
2309
2309
ddof : int = ...,
2310
2310
numeric_only : _bool = ...,
2311
2311
** kwargs : Any ,
2312
2312
) -> Series : ...
2313
2313
# Not actually positional, but used to handle removal of deprecated
2314
- def set_axis (self , labels , * , axis : Axis , copy : _bool = ...) -> Self : ...
2314
+ def set_axis (self , labels , * , axis : Axis = ... , copy : _bool = ...) -> Self : ...
2315
2315
def skew (
2316
2316
self ,
2317
2317
axis : Axis | None = ...,
2318
2318
skipna : _bool | None = ...,
2319
- level : None = ...,
2320
2319
numeric_only : _bool = ...,
2321
2320
** kwargs : Any ,
2322
2321
) -> Series : ...
@@ -2326,7 +2325,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2326
2325
self ,
2327
2326
axis : Axis = ...,
2328
2327
skipna : _bool = ...,
2329
- level : None = ...,
2330
2328
ddof : int = ...,
2331
2329
numeric_only : _bool = ...,
2332
2330
** kwargs : Any ,
@@ -2347,9 +2345,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2347
2345
) -> Self : ...
2348
2346
def sum (
2349
2347
self ,
2350
- axis : Axis | None = ...,
2348
+ axis : Axis = ...,
2351
2349
skipna : _bool | None = ...,
2352
- level : None = ...,
2353
2350
numeric_only : _bool = ...,
2354
2351
min_count : int = ...,
2355
2352
** kwargs : Any ,
@@ -2434,6 +2431,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2434
2431
def to_string (
2435
2432
self ,
2436
2433
buf : FilePath | WriteBuffer [str ],
2434
+ * ,
2437
2435
columns : SequenceNotStr [Hashable ] | Index | Series | None = ...,
2438
2436
col_space : int | list [int ] | dict [HashableT , int ] | None = ...,
2439
2437
header : _bool | list [_str ] | tuple [str , ...] = ...,
@@ -2457,6 +2455,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2457
2455
def to_string (
2458
2456
self ,
2459
2457
buf : None = ...,
2458
+ * ,
2460
2459
columns : Sequence [Hashable ] | Index | Series | None = ...,
2461
2460
col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
2462
2461
header : _bool | Sequence [_str ] = ...,
@@ -2513,9 +2512,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2513
2512
) -> Self : ...
2514
2513
def var (
2515
2514
self ,
2516
- axis : Axis | None = ...,
2515
+ axis : Axis = ...,
2517
2516
skipna : _bool | None = ...,
2518
- level : None = ...,
2519
2517
ddof : int = ...,
2520
2518
numeric_only : _bool = ...,
2521
2519
** kwargs : Any ,
0 commit comments