@@ -22,10 +22,7 @@ from pandas import (
22
22
)
23
23
from pandas .core .arraylike import OpsMixin
24
24
from pandas .core .generic import NDFrame
25
- from pandas .core .groupby .generic import (
26
- _DataFrameGroupByNonScalar ,
27
- _DataFrameGroupByScalar ,
28
- )
25
+ from pandas .core .groupby .generic import DataFrameGroupBy
29
26
from pandas .core .groupby .grouper import Grouper
30
27
from pandas .core .indexes .base import Index
31
28
from pandas .core .indexing import (
@@ -208,7 +205,6 @@ class DataFrame(NDFrame, OpsMixin):
208
205
@property
209
206
def style (self ) -> Styler : ...
210
207
def items (self ) -> Iterable [tuple [Hashable , Series ]]: ...
211
- def iteritems (self ) -> Iterable [tuple [Label , Series ]]: ...
212
208
def iterrows (self ) -> Iterable [tuple [Label , Series ]]: ...
213
209
def itertuples (self , index : _bool = ..., name : _str | None = ...): ...
214
210
def __len__ (self ) -> int : ...
@@ -294,6 +290,7 @@ class DataFrame(NDFrame, OpsMixin):
294
290
def to_stata (
295
291
self ,
296
292
path : FilePath | WriteBuffer [bytes ],
293
+ * ,
297
294
convert_dates : dict [HashableT , StataDateFormat ] | None = ...,
298
295
write_index : _bool = ...,
299
296
byteorder : Literal ["<" , ">" , "little" , "big" ] | None = ...,
@@ -304,7 +301,6 @@ class DataFrame(NDFrame, OpsMixin):
304
301
convert_strl : list [HashableT ] | None = ...,
305
302
compression : CompressionOptions = ...,
306
303
storage_options : StorageOptions = ...,
307
- * ,
308
304
value_labels : dict [Hashable , dict [float , str ]] | None = ...,
309
305
) -> None : ...
310
306
def to_feather (self , path : FilePath | WriteBuffer [bytes ], ** kwargs ) -> None : ...
@@ -992,20 +988,6 @@ class DataFrame(NDFrame, OpsMixin):
992
988
filter_func : Callable | None = ...,
993
989
errors : IgnoreRaise = ...,
994
990
) -> None : ...
995
- @overload
996
- def groupby (
997
- self ,
998
- by : Scalar ,
999
- axis : AxisType = ...,
1000
- level : Level | None = ...,
1001
- as_index : _bool = ...,
1002
- sort : _bool = ...,
1003
- group_keys : _bool = ...,
1004
- squeeze : _bool = ...,
1005
- observed : _bool = ...,
1006
- dropna : _bool = ...,
1007
- ) -> _DataFrameGroupByScalar : ...
1008
- @overload
1009
991
def groupby (
1010
992
self ,
1011
993
by : GroupByObjectNonScalar | None = ...,
@@ -1017,9 +999,10 @@ class DataFrame(NDFrame, OpsMixin):
1017
999
squeeze : _bool = ...,
1018
1000
observed : _bool = ...,
1019
1001
dropna : _bool = ...,
1020
- ) -> _DataFrameGroupByNonScalar : ...
1002
+ ) -> DataFrameGroupBy : ...
1021
1003
def pivot (
1022
1004
self ,
1005
+ * ,
1023
1006
index : IndexLabel = ...,
1024
1007
columns : IndexLabel = ...,
1025
1008
values : IndexLabel = ...,
@@ -1126,14 +1109,18 @@ class DataFrame(NDFrame, OpsMixin):
1126
1109
self ,
1127
1110
method : Literal ["pearson" , "kendall" , "spearman" ] = ...,
1128
1111
min_periods : int = ...,
1112
+ numeric_only : _bool = ...,
1113
+ ) -> DataFrame : ...
1114
+ def cov (
1115
+ self , min_periods : int | None = ..., ddof : int = ..., numeric_only : _bool = ...
1129
1116
) -> DataFrame : ...
1130
- def cov (self , min_periods : int | None = ..., ddof : int = ...) -> DataFrame : ...
1131
1117
def corrwith (
1132
1118
self ,
1133
1119
other : DataFrame | Series ,
1134
1120
axis : AxisType | None = ...,
1135
1121
drop : _bool = ...,
1136
1122
method : Literal ["pearson" , "kendall" , "spearman" ] = ...,
1123
+ numeric_only : _bool = ...,
1137
1124
) -> Series : ...
1138
1125
@overload
1139
1126
def count (
@@ -1144,8 +1131,12 @@ class DataFrame(NDFrame, OpsMixin):
1144
1131
self , axis : AxisType = ..., level : None = ..., numeric_only : _bool = ...
1145
1132
) -> Series : ...
1146
1133
def nunique (self , axis : AxisType = ..., dropna : bool = ...) -> Series : ...
1147
- def idxmax (self , axis : AxisType = ..., skipna : _bool = ...) -> Series : ...
1148
- def idxmin (self , axis : AxisType = ..., skipna : _bool = ...) -> Series : ...
1134
+ def idxmax (
1135
+ self , axis : AxisType = ..., skipna : _bool = ..., numeric_only : _bool = ...
1136
+ ) -> Series : ...
1137
+ def idxmin (
1138
+ self , axis : AxisType = ..., skipna : _bool = ..., numeric_only : _bool = ...
1139
+ ) -> Series : ...
1149
1140
@overload
1150
1141
def mode (
1151
1142
self ,
@@ -1170,13 +1161,15 @@ class DataFrame(NDFrame, OpsMixin):
1170
1161
self ,
1171
1162
q : float = ...,
1172
1163
axis : AxisType = ...,
1164
+ numeric_only : _bool = ...,
1173
1165
interpolation : QuantileInterpolation = ...,
1174
1166
) -> Series : ...
1175
1167
@overload
1176
1168
def quantile (
1177
1169
self ,
1178
1170
q : list [float ] | np .ndarray ,
1179
1171
axis : AxisType = ...,
1172
+ numeric_only : _bool = ...,
1180
1173
interpolation : QuantileInterpolation = ...,
1181
1174
) -> DataFrame : ...
1182
1175
def to_timestamp (
@@ -1296,6 +1289,7 @@ class DataFrame(NDFrame, OpsMixin):
1296
1289
@overload
1297
1290
def any (
1298
1291
self ,
1292
+ * ,
1299
1293
axis : None ,
1300
1294
bool_only : _bool | None = ...,
1301
1295
skipna : _bool = ...,
@@ -1304,6 +1298,7 @@ class DataFrame(NDFrame, OpsMixin):
1304
1298
@overload
1305
1299
def any (
1306
1300
self ,
1301
+ * ,
1307
1302
axis : AxisType = ...,
1308
1303
bool_only : _bool | None = ...,
1309
1304
skipna : _bool = ...,
@@ -1521,13 +1516,15 @@ class DataFrame(NDFrame, OpsMixin):
1521
1516
axis : AxisType | None = ...,
1522
1517
skipna : _bool | None = ...,
1523
1518
level : None = ...,
1519
+ numeric_only : _bool = ...,
1524
1520
** kwargs ,
1525
1521
) -> Series : ...
1526
1522
def kurtosis (
1527
1523
self ,
1528
1524
axis : AxisType | None = ...,
1529
1525
skipna : _bool | None = ...,
1530
1526
level : None = ...,
1527
+ numeric_only : _bool = ...,
1531
1528
** kwargs ,
1532
1529
) -> Series : ...
1533
1530
def last (self , offset ) -> DataFrame : ...
@@ -1538,58 +1535,46 @@ class DataFrame(NDFrame, OpsMixin):
1538
1535
def lt (
1539
1536
self , other , axis : AxisType = ..., level : Level | None = ...
1540
1537
) -> DataFrame : ...
1541
- @overload
1542
- def mad (
1543
- self ,
1544
- axis : AxisType | None = ...,
1545
- skipna : _bool | None = ...,
1546
- level : None = ...,
1547
- ) -> Series : ...
1548
- @overload
1549
- def mad (
1550
- self ,
1551
- axis : AxisType | None = ...,
1552
- skipna : _bool | None = ...,
1553
- * ,
1554
- level : Level ,
1555
- ** kwargs ,
1556
- ) -> DataFrame : ...
1557
1538
def mask (
1558
1539
self ,
1559
1540
cond : Series | DataFrame | np .ndarray ,
1560
1541
other = ...,
1561
1542
inplace : _bool = ...,
1562
1543
axis : AxisType | None = ...,
1563
1544
level : Level | None = ...,
1564
- errors : _str = ...,
1545
+ * , # Not actually positional-only, but needed due to depr in 1.5.0
1565
1546
try_cast : _bool = ...,
1566
1547
) -> DataFrame : ...
1567
1548
def max (
1568
1549
self ,
1569
1550
axis : AxisType | None = ...,
1570
1551
skipna : _bool | None = ...,
1571
1552
level : None = ...,
1553
+ numeric_only : _bool = ...,
1572
1554
** kwargs ,
1573
1555
) -> Series : ...
1574
1556
def mean (
1575
1557
self ,
1576
1558
axis : AxisType | None = ...,
1577
1559
skipna : _bool | None = ...,
1578
1560
level : None = ...,
1561
+ numeric_only : _bool = ...,
1579
1562
** kwargs ,
1580
1563
) -> Series : ...
1581
1564
def median (
1582
1565
self ,
1583
1566
axis : AxisType | None = ...,
1584
1567
skipna : _bool | None = ...,
1585
1568
level : None = ...,
1569
+ numeric_only : _bool = ...,
1586
1570
** kwargs ,
1587
1571
) -> Series : ...
1588
1572
def min (
1589
1573
self ,
1590
1574
axis : AxisType | None = ...,
1591
1575
skipna : _bool | None = ...,
1592
1576
level : None = ...,
1577
+ numeric_only : _bool = ...,
1593
1578
** kwargs ,
1594
1579
) -> Series : ...
1595
1580
def mod (
@@ -1643,6 +1628,7 @@ class DataFrame(NDFrame, OpsMixin):
1643
1628
axis : AxisType | None = ...,
1644
1629
skipna : _bool | None = ...,
1645
1630
level : None = ...,
1631
+ numeric_only : _bool = ...,
1646
1632
min_count : int = ...,
1647
1633
** kwargs ,
1648
1634
) -> Series : ...
@@ -1651,6 +1637,7 @@ class DataFrame(NDFrame, OpsMixin):
1651
1637
axis : AxisType | None = ...,
1652
1638
skipna : _bool = ...,
1653
1639
level : None = ...,
1640
+ numeric_only : _bool = ...,
1654
1641
min_count : int = ...,
1655
1642
** kwargs ,
1656
1643
) -> Series : ...
@@ -1820,30 +1807,17 @@ class DataFrame(NDFrame, OpsMixin):
1820
1807
skipna : _bool | None = ...,
1821
1808
level : None = ...,
1822
1809
ddof : int = ...,
1810
+ numeric_only : _bool = ...,
1823
1811
** kwargs ,
1824
1812
) -> Series : ...
1825
- @overload
1826
- def set_axis (
1827
- self , labels , inplace : Literal [True ], axis : AxisType = ...
1828
- ) -> None : ...
1829
- @overload
1830
- def set_axis (
1831
- self , labels , inplace : Literal [False ], axis : AxisType = ...
1832
- ) -> DataFrame : ...
1833
- @overload
1834
- def set_axis (self , labels , * , axis : AxisType = ...) -> DataFrame : ...
1835
- @overload
1836
- def set_axis (
1837
- self ,
1838
- labels ,
1839
- axis : AxisType = ...,
1840
- inplace : _bool | None = ...,
1841
- ) -> DataFrame | None : ...
1813
+ # Not actually positional, but used to handle removal of deprecated
1814
+ def set_axis (self , labels , * , axis : AxisType , copy : bool = ...) -> DataFrame : ...
1842
1815
def skew (
1843
1816
self ,
1844
1817
axis : AxisType | None = ...,
1845
1818
skipna : _bool | None = ...,
1846
1819
level : None = ...,
1820
+ numeric_only : _bool = ...,
1847
1821
** kwargs ,
1848
1822
) -> Series : ...
1849
1823
def slice_shift (self , periods : int = ..., axis : AxisType = ...) -> DataFrame : ...
@@ -1854,6 +1828,7 @@ class DataFrame(NDFrame, OpsMixin):
1854
1828
skipna : _bool = ...,
1855
1829
level : None = ...,
1856
1830
ddof : int = ...,
1831
+ numeric_only : _bool = ...,
1857
1832
** kwargs ,
1858
1833
) -> Series : ...
1859
1834
def sub (
@@ -1875,6 +1850,7 @@ class DataFrame(NDFrame, OpsMixin):
1875
1850
axis : AxisType | None = ...,
1876
1851
skipna : _bool | None = ...,
1877
1852
level : None = ...,
1853
+ numeric_only : _bool = ...,
1878
1854
min_count : int = ...,
1879
1855
** kwargs ,
1880
1856
) -> Series : ...
@@ -2010,6 +1986,7 @@ class DataFrame(NDFrame, OpsMixin):
2010
1986
skipna : _bool | None = ...,
2011
1987
level : None = ...,
2012
1988
ddof : int = ...,
1989
+ numeric_only : _bool = ...,
2013
1990
** kwargs ,
2014
1991
) -> Series : ...
2015
1992
def where (
@@ -2023,7 +2000,7 @@ class DataFrame(NDFrame, OpsMixin):
2023
2000
inplace : _bool = ...,
2024
2001
axis : AxisType | None = ...,
2025
2002
level : Level | None = ...,
2026
- errors : _str = ...,
2003
+ * , # Not actually positional-only, but needed due to depr in 1.5.0
2027
2004
try_cast : _bool = ...,
2028
2005
) -> DataFrame : ...
2029
2006
# Move from generic because Series is Generic and it returns Series[bool] there
0 commit comments