@@ -308,6 +308,21 @@ else:
308308 @overload
309309 def __getitem__ (self , key : Hashable ) -> Series : ...
310310
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+
311326class DataFrame (NDFrame , OpsMixin , _GetItemHack ):
312327
313328 __hash__ : ClassVar [None ] # type: ignore[assignment] # pyright: ignore[reportIncompatibleMethodOverride]
@@ -458,6 +473,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
458473 def to_gbq (
459474 self ,
460475 destination_table : str ,
476+ * ,
461477 project_id : str | None = ...,
462478 chunksize : int | None = ...,
463479 reauth : bool = ...,
@@ -524,6 +540,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
524540 def to_parquet (
525541 self ,
526542 path : FilePath | WriteBuffer [bytes ],
543+ * ,
527544 engine : ParquetEngine = ...,
528545 compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
529546 index : bool | None = ...,
@@ -535,6 +552,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
535552 def to_parquet (
536553 self ,
537554 path : None = ...,
555+ * ,
538556 engine : ParquetEngine = ...,
539557 compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
540558 index : bool | None = ...,
@@ -564,6 +582,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
564582 def to_html (
565583 self ,
566584 buf : FilePath | WriteBuffer [str ],
585+ * ,
567586 columns : SequenceNotStr [Hashable ] | Index | Series | None = ...,
568587 col_space : ColspaceArgType | None = ...,
569588 header : _bool = ...,
@@ -611,6 +630,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
611630 def to_html (
612631 self ,
613632 buf : None = ...,
633+ * ,
614634 columns : Sequence [Hashable ] | None = ...,
615635 col_space : ColspaceArgType | None = ...,
616636 header : _bool = ...,
@@ -746,27 +766,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
746766 def eval (
747767 self , expr : _str , * , inplace : Literal [False ] = ..., ** kwargs : Any
748768 ) -> 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 ]
763769 @overload
764770 def select_dtypes (
765- self , include : StrDtypeArg , exclude : AstypeArgExtList | None = ...
771+ self , include : StrDtypeArg , exclude : _AstypeArgExtList | None = ...
766772 ) -> Never : ...
767773 @overload
768774 def select_dtypes (
769- self , include : AstypeArgExtList | None , exclude : StrDtypeArg
775+ self , include : _AstypeArgExtList | None , exclude : StrDtypeArg
770776 ) -> Never : ...
771777 @overload
772778 def select_dtypes (self , exclude : StrDtypeArg ) -> Never : ...
@@ -775,19 +781,19 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
775781 @overload
776782 def select_dtypes (
777783 self ,
778- include : AstypeArgExtList ,
779- exclude : AstypeArgExtList | None = ...,
784+ include : _AstypeArgExtList ,
785+ exclude : _AstypeArgExtList | None = ...,
780786 ) -> Self : ...
781787 @overload
782788 def select_dtypes (
783789 self ,
784- include : AstypeArgExtList | None ,
785- exclude : AstypeArgExtList ,
790+ include : _AstypeArgExtList | None ,
791+ exclude : _AstypeArgExtList ,
786792 ) -> Self : ...
787793 @overload
788794 def select_dtypes (
789795 self ,
790- exclude : AstypeArgExtList ,
796+ exclude : _AstypeArgExtList ,
791797 ) -> Self : ...
792798 def insert (
793799 self ,
@@ -810,6 +816,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
810816 def reindex (
811817 self ,
812818 labels : Axes | None = ...,
819+ * ,
813820 index : Axes | None = ...,
814821 columns : Axes | None = ...,
815822 axis : Axis | None = ...,
@@ -1301,8 +1308,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
13011308 def pivot (
13021309 self ,
13031310 * ,
1311+ columns : IndexLabel ,
13041312 index : IndexLabel = ...,
1305- columns : IndexLabel = ...,
13061313 values : IndexLabel = ...,
13071314 ) -> Self : ...
13081315 def pivot_table (
@@ -1320,11 +1327,18 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
13201327 ) -> Self : ...
13211328 @overload
13221329 def stack (
1323- self , level : IndexLabel = ..., dropna : _bool = ..., sort : _bool = ...
1330+ self ,
1331+ level : IndexLabel = ...,
1332+ * ,
1333+ future_stack : Literal [True ],
13241334 ) -> Self | Series : ...
13251335 @overload
13261336 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 ] = ...,
13281342 ) -> Self | Series : ...
13291343 def explode (
13301344 self , column : Sequence [Hashable ], ignore_index : _bool = ...
@@ -1576,14 +1590,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
15761590 method : Literal ["pearson" , "kendall" , "spearman" ] = ...,
15771591 numeric_only : _bool = ...,
15781592 ) -> 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 ]: ...
15871594 def nunique (self , axis : Axis = ..., dropna : bool = ...) -> Series : ...
15881595 def idxmax (
15891596 self , axis : Axis = ..., skipna : _bool = ..., numeric_only : _bool = ...
@@ -1780,6 +1787,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
17801787 self ,
17811788 start_time : _str | dt .time ,
17821789 end_time : _str | dt .time ,
1790+ inclusive : IntervalClosedType = ...,
17831791 axis : Axis | None = ...,
17841792 ) -> Self : ...
17851793 @overload
@@ -1980,8 +1988,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
19801988 @final
19811989 def head (self , n : int = ...) -> Self : ...
19821990 @final
1983- def infer_objects (self ) -> Self : ...
1984- # def info
1991+ def infer_objects (self , copy : _bool | None = ...) -> Self : ...
19851992 @overload
19861993 def interpolate (
19871994 self ,
@@ -2077,15 +2084,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
20772084 self ,
20782085 axis : Axis | None = ...,
20792086 skipna : _bool | None = ...,
2080- level : None = ...,
20812087 numeric_only : _bool = ...,
20822088 ** kwargs : Any ,
20832089 ) -> Series : ...
20842090 def min (
20852091 self ,
20862092 axis : Axis | None = ...,
20872093 skipna : _bool | None = ...,
2088- level : None = ...,
20892094 numeric_only : _bool = ...,
20902095 ** kwargs : Any ,
20912096 ) -> Series : ...
@@ -2117,8 +2122,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
21172122 periods : int = ...,
21182123 fill_method : None = ...,
21192124 freq : DateOffset | dt .timedelta | _str | None = ...,
2120- * ,
2121- axis : Axis = ...,
21222125 fill_value : Scalar | NAType | None = ...,
21232126 ) -> Self : ...
21242127 def pop (self , item : _str ) -> Series : ...
@@ -2133,7 +2136,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
21332136 self ,
21342137 axis : Axis | None = ...,
21352138 skipna : _bool | None = ...,
2136- level : None = ...,
21372139 numeric_only : _bool = ...,
21382140 min_count : int = ...,
21392141 ** kwargs : Any ,
@@ -2142,7 +2144,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
21422144 self ,
21432145 axis : Axis | None = ...,
21442146 skipna : _bool = ...,
2145- level : None = ...,
21462147 numeric_only : _bool = ...,
21472148 min_count : int = ...,
21482149 ** kwargs : Any ,
@@ -2305,18 +2306,16 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23052306 self ,
23062307 axis : Axis | None = ...,
23072308 skipna : _bool | None = ...,
2308- level : None = ...,
23092309 ddof : int = ...,
23102310 numeric_only : _bool = ...,
23112311 ** kwargs : Any ,
23122312 ) -> Series : ...
23132313 # 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 : ...
23152315 def skew (
23162316 self ,
23172317 axis : Axis | None = ...,
23182318 skipna : _bool | None = ...,
2319- level : None = ...,
23202319 numeric_only : _bool = ...,
23212320 ** kwargs : Any ,
23222321 ) -> Series : ...
@@ -2326,7 +2325,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23262325 self ,
23272326 axis : Axis = ...,
23282327 skipna : _bool = ...,
2329- level : None = ...,
23302328 ddof : int = ...,
23312329 numeric_only : _bool = ...,
23322330 ** kwargs : Any ,
@@ -2347,9 +2345,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23472345 ) -> Self : ...
23482346 def sum (
23492347 self ,
2350- axis : Axis | None = ...,
2348+ axis : Axis = ...,
23512349 skipna : _bool | None = ...,
2352- level : None = ...,
23532350 numeric_only : _bool = ...,
23542351 min_count : int = ...,
23552352 ** kwargs : Any ,
@@ -2434,6 +2431,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
24342431 def to_string (
24352432 self ,
24362433 buf : FilePath | WriteBuffer [str ],
2434+ * ,
24372435 columns : SequenceNotStr [Hashable ] | Index | Series | None = ...,
24382436 col_space : int | list [int ] | dict [HashableT , int ] | None = ...,
24392437 header : _bool | list [_str ] | tuple [str , ...] = ...,
@@ -2457,6 +2455,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
24572455 def to_string (
24582456 self ,
24592457 buf : None = ...,
2458+ * ,
24602459 columns : Sequence [Hashable ] | Index | Series | None = ...,
24612460 col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
24622461 header : _bool | Sequence [_str ] = ...,
@@ -2513,9 +2512,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
25132512 ) -> Self : ...
25142513 def var (
25152514 self ,
2516- axis : Axis | None = ...,
2515+ axis : Axis = ...,
25172516 skipna : _bool | None = ...,
2518- level : None = ...,
25192517 ddof : int = ...,
25202518 numeric_only : _bool = ...,
25212519 ** kwargs : Any ,
0 commit comments