@@ -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]
@@ -455,6 +470,21 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
455
470
into : type [dict ] = ...,
456
471
index : bool = ...,
457
472
) -> dict [Hashable , Any ]: ...
473
+ def to_gbq (
474
+ self ,
475
+ destination_table : str ,
476
+ * ,
477
+ project_id : str | None = ...,
478
+ chunksize : int | None = ...,
479
+ reauth : bool = ...,
480
+ if_exists : Literal ["fail" , "replace" , "append" ] = ...,
481
+ auth_local_webserver : bool = ...,
482
+ table_schema : list [dict [str , str ]] | None = ...,
483
+ location : str | None = ...,
484
+ progress_bar : bool = ...,
485
+ # Google type, not available
486
+ credentials : Any = ...,
487
+ ) -> None : ...
458
488
@classmethod
459
489
def from_records (
460
490
cls ,
@@ -516,6 +546,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
516
546
def to_parquet (
517
547
self ,
518
548
path : FilePath | WriteBuffer [bytes ],
549
+ * ,
519
550
engine : ParquetEngine = ...,
520
551
compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
521
552
index : bool | None = ...,
@@ -527,6 +558,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
527
558
def to_parquet (
528
559
self ,
529
560
path : None = ...,
561
+ * ,
530
562
engine : ParquetEngine = ...,
531
563
compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
532
564
index : bool | None = ...,
@@ -556,6 +588,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
556
588
def to_html (
557
589
self ,
558
590
buf : FilePath | WriteBuffer [str ],
591
+ * ,
559
592
columns : SequenceNotStr [Hashable ] | Index | Series | None = ...,
560
593
col_space : ColspaceArgType | None = ...,
561
594
header : _bool = ...,
@@ -603,6 +636,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
603
636
def to_html (
604
637
self ,
605
638
buf : None = ...,
639
+ * ,
606
640
columns : Sequence [Hashable ] | None = ...,
607
641
col_space : ColspaceArgType | None = ...,
608
642
header : _bool = ...,
@@ -738,27 +772,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
738
772
def eval (
739
773
self , expr : _str , * , inplace : Literal [False ] = ..., ** kwargs : Any
740
774
) -> Scalar | np .ndarray | Self | Series : ...
741
- AstypeArgExt : TypeAlias = (
742
- AstypeArg
743
- | Literal [
744
- "number" ,
745
- "datetime64" ,
746
- "datetime" ,
747
- "integer" ,
748
- "timedelta" ,
749
- "timedelta64" ,
750
- "datetimetz" ,
751
- "datetime64[ns]" ,
752
- ]
753
- )
754
- AstypeArgExtList : TypeAlias = AstypeArgExt | list [AstypeArgExt ]
755
775
@overload
756
776
def select_dtypes (
757
- self , include : StrDtypeArg , exclude : AstypeArgExtList | None = ...
777
+ self , include : StrDtypeArg , exclude : _AstypeArgExtList | None = ...
758
778
) -> Never : ...
759
779
@overload
760
780
def select_dtypes (
761
- self , include : AstypeArgExtList | None , exclude : StrDtypeArg
781
+ self , include : _AstypeArgExtList | None , exclude : StrDtypeArg
762
782
) -> Never : ...
763
783
@overload
764
784
def select_dtypes (self , exclude : StrDtypeArg ) -> Never : ...
@@ -767,19 +787,19 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
767
787
@overload
768
788
def select_dtypes (
769
789
self ,
770
- include : AstypeArgExtList ,
771
- exclude : AstypeArgExtList | None = ...,
790
+ include : _AstypeArgExtList ,
791
+ exclude : _AstypeArgExtList | None = ...,
772
792
) -> Self : ...
773
793
@overload
774
794
def select_dtypes (
775
795
self ,
776
- include : AstypeArgExtList | None ,
777
- exclude : AstypeArgExtList ,
796
+ include : _AstypeArgExtList | None ,
797
+ exclude : _AstypeArgExtList ,
778
798
) -> Self : ...
779
799
@overload
780
800
def select_dtypes (
781
801
self ,
782
- exclude : AstypeArgExtList ,
802
+ exclude : _AstypeArgExtList ,
783
803
) -> Self : ...
784
804
def insert (
785
805
self ,
@@ -802,6 +822,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
802
822
def reindex (
803
823
self ,
804
824
labels : Axes | None = ...,
825
+ * ,
805
826
index : Axes | None = ...,
806
827
columns : Axes | None = ...,
807
828
axis : Axis | None = ...,
@@ -1293,8 +1314,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1293
1314
def pivot (
1294
1315
self ,
1295
1316
* ,
1317
+ columns : IndexLabel ,
1296
1318
index : IndexLabel = ...,
1297
- columns : IndexLabel = ...,
1298
1319
values : IndexLabel = ...,
1299
1320
) -> Self : ...
1300
1321
def pivot_table (
@@ -1312,11 +1333,18 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1312
1333
) -> Self : ...
1313
1334
@overload
1314
1335
def stack (
1315
- self , level : IndexLabel = ..., dropna : _bool = ..., sort : _bool = ...
1336
+ self ,
1337
+ level : IndexLabel = ...,
1338
+ * ,
1339
+ future_stack : Literal [True ],
1316
1340
) -> Self | Series : ...
1317
1341
@overload
1318
1342
def stack (
1319
- self , level : IndexLabel = ..., future_stack : _bool = ...
1343
+ self ,
1344
+ level : IndexLabel = ...,
1345
+ dropna : _bool = ...,
1346
+ sort : _bool = ...,
1347
+ future_stack : Literal [False ] = ...,
1320
1348
) -> Self | Series : ...
1321
1349
def explode (
1322
1350
self , column : Sequence [Hashable ], ignore_index : _bool = False
@@ -1571,15 +1599,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1571
1599
method : Literal ["pearson" , "kendall" , "spearman" ] = ...,
1572
1600
numeric_only : _bool = False ,
1573
1601
) -> Series : ...
1574
- @overload
1575
- def count (
1576
- self , axis : Axis = ..., numeric_only : _bool = ..., * , level : Level
1577
- ) -> Self : ...
1578
- @overload
1579
- def count (
1580
- self , axis : Axis = ..., level : None = ..., numeric_only : _bool = ...
1581
- ) -> Series : ...
1582
- def nunique (self , axis : Axis = 0 , dropna : bool = True ) -> Series : ...
1602
+ def count (self , axis : Axis = 0 , numeric_only : _bool = ...) -> Series [int ]: ...
1603
+ def nunique (self , axis : Axis = 0 , dropna : bool = ...) -> Series : ...
1583
1604
def idxmax (
1584
1605
self ,
1585
1606
axis : Axis = 0 ,
@@ -1784,6 +1805,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1784
1805
self ,
1785
1806
start_time : _str | dt .time ,
1786
1807
end_time : _str | dt .time ,
1808
+ inclusive : IntervalClosedType = ...,
1787
1809
axis : Axis | None = 0 ,
1788
1810
) -> Self : ...
1789
1811
@overload
@@ -1998,7 +2020,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1998
2020
@final
1999
2021
def head (self , n : int = 5 ) -> Self : ...
2000
2022
@final
2001
- def infer_objects (self ) -> Self : ...
2023
+ def infer_objects (self , copy : _bool | None = ... ) -> Self : ...
2002
2024
@overload
2003
2025
def interpolate (
2004
2026
self ,
@@ -2094,15 +2116,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2094
2116
self ,
2095
2117
axis : Axis | None = ...,
2096
2118
skipna : _bool | None = True ,
2097
- level : None = ...,
2098
2119
numeric_only : _bool = False ,
2099
2120
** kwargs : Any ,
2100
2121
) -> Series : ...
2101
2122
def min (
2102
2123
self ,
2103
2124
axis : Axis | None = ...,
2104
2125
skipna : _bool | None = True ,
2105
- level : None = ...,
2106
2126
numeric_only : _bool = False ,
2107
2127
** kwargs : Any ,
2108
2128
) -> Series : ...
@@ -2134,8 +2154,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2134
2154
periods : int = 1 ,
2135
2155
fill_method : None = None ,
2136
2156
freq : DateOffset | dt .timedelta | _str | None = ...,
2137
- * ,
2138
- axis : Axis = ...,
2139
2157
fill_value : Scalar | NAType | None = ...,
2140
2158
) -> Self : ...
2141
2159
def pop (self , item : _str ) -> Series : ...
@@ -2150,7 +2168,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2150
2168
self ,
2151
2169
axis : Axis | None = ...,
2152
2170
skipna : _bool | None = True ,
2153
- level : None = ...,
2154
2171
numeric_only : _bool = False ,
2155
2172
min_count : int = 0 ,
2156
2173
** kwargs : Any ,
@@ -2159,7 +2176,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2159
2176
self ,
2160
2177
axis : Axis | None = ...,
2161
2178
skipna : _bool = True ,
2162
- level : None = ...,
2163
2179
numeric_only : _bool = False ,
2164
2180
min_count : int = 0 ,
2165
2181
** kwargs : Any ,
@@ -2322,18 +2338,16 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2322
2338
self ,
2323
2339
axis : Axis | None = ...,
2324
2340
skipna : _bool | None = True ,
2325
- level : None = ...,
2326
2341
ddof : int = 1 ,
2327
2342
numeric_only : _bool = False ,
2328
2343
** kwargs : Any ,
2329
2344
) -> Series : ...
2330
2345
# Not actually positional, but used to handle removal of deprecated
2331
- def set_axis (self , labels , * , axis : Axis , copy : _bool = ...) -> Self : ...
2346
+ def set_axis (self , labels , * , axis : Axis = ... , copy : _bool = ...) -> Self : ...
2332
2347
def skew (
2333
2348
self ,
2334
2349
axis : Axis | None = ...,
2335
2350
skipna : _bool | None = True ,
2336
- level : None = ...,
2337
2351
numeric_only : _bool = False ,
2338
2352
** kwargs : Any ,
2339
2353
) -> Series : ...
@@ -2343,7 +2357,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2343
2357
self ,
2344
2358
axis : Axis = ...,
2345
2359
skipna : _bool = True ,
2346
- level : None = ...,
2347
2360
ddof : int = 1 ,
2348
2361
numeric_only : _bool = False ,
2349
2362
** kwargs : Any ,
@@ -2364,9 +2377,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2364
2377
) -> Self : ...
2365
2378
def sum (
2366
2379
self ,
2367
- axis : Axis | None = ...,
2380
+ axis : Axis = ...,
2368
2381
skipna : _bool | None = True ,
2369
- level : None = ...,
2370
2382
numeric_only : _bool = False ,
2371
2383
min_count : int = 0 ,
2372
2384
** kwargs : Any ,
@@ -2451,6 +2463,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2451
2463
def to_string (
2452
2464
self ,
2453
2465
buf : FilePath | WriteBuffer [str ],
2466
+ * ,
2454
2467
columns : SequenceNotStr [Hashable ] | Index | Series | None = ...,
2455
2468
col_space : int | list [int ] | dict [HashableT , int ] | None = ...,
2456
2469
header : _bool | list [_str ] | tuple [str , ...] = ...,
@@ -2474,6 +2487,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2474
2487
def to_string (
2475
2488
self ,
2476
2489
buf : None = ...,
2490
+ * ,
2477
2491
columns : Sequence [Hashable ] | Index | Series | None = ...,
2478
2492
col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
2479
2493
header : _bool | Sequence [_str ] = ...,
@@ -2530,9 +2544,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2530
2544
) -> Self : ...
2531
2545
def var (
2532
2546
self ,
2533
- axis : Axis | None = ...,
2547
+ axis : Axis = ...,
2534
2548
skipna : _bool | None = True ,
2535
- level : None = ...,
2536
2549
ddof : int = 1 ,
2537
2550
numeric_only : _bool = False ,
2538
2551
** kwargs : Any ,
0 commit comments