@@ -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 (
@@ -294,6 +291,7 @@ class DataFrame(NDFrame, OpsMixin):
294
291
def to_stata (
295
292
self ,
296
293
path : FilePath | WriteBuffer [bytes ],
294
+ * ,
297
295
convert_dates : dict [HashableT , StataDateFormat ] | None = ...,
298
296
write_index : _bool = ...,
299
297
byteorder : Literal ["<" , ">" , "little" , "big" ] | None = ...,
@@ -304,7 +302,6 @@ class DataFrame(NDFrame, OpsMixin):
304
302
convert_strl : list [HashableT ] | None = ...,
305
303
compression : CompressionOptions = ...,
306
304
storage_options : StorageOptions = ...,
307
- * ,
308
305
value_labels : dict [Hashable , dict [float , str ]] | None = ...,
309
306
) -> None : ...
310
307
def to_feather (self , path : FilePath | WriteBuffer [bytes ], ** kwargs ) -> None : ...
@@ -992,20 +989,6 @@ class DataFrame(NDFrame, OpsMixin):
992
989
filter_func : Callable | None = ...,
993
990
errors : IgnoreRaise = ...,
994
991
) -> 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
992
def groupby (
1010
993
self ,
1011
994
by : GroupByObjectNonScalar | None = ...,
@@ -1017,9 +1000,10 @@ class DataFrame(NDFrame, OpsMixin):
1017
1000
squeeze : _bool = ...,
1018
1001
observed : _bool = ...,
1019
1002
dropna : _bool = ...,
1020
- ) -> _DataFrameGroupByNonScalar : ...
1003
+ ) -> DataFrameGroupBy : ...
1021
1004
def pivot (
1022
1005
self ,
1006
+ * ,
1023
1007
index : IndexLabel = ...,
1024
1008
columns : IndexLabel = ...,
1025
1009
values : IndexLabel = ...,
@@ -1170,13 +1154,15 @@ class DataFrame(NDFrame, OpsMixin):
1170
1154
self ,
1171
1155
q : float = ...,
1172
1156
axis : AxisType = ...,
1157
+ numeric_only : _bool = ...,
1173
1158
interpolation : QuantileInterpolation = ...,
1174
1159
) -> Series : ...
1175
1160
@overload
1176
1161
def quantile (
1177
1162
self ,
1178
1163
q : list [float ] | np .ndarray ,
1179
1164
axis : AxisType = ...,
1165
+ numeric_only : _bool = ...,
1180
1166
interpolation : QuantileInterpolation = ...,
1181
1167
) -> DataFrame : ...
1182
1168
def to_timestamp (
@@ -1296,6 +1282,7 @@ class DataFrame(NDFrame, OpsMixin):
1296
1282
@overload
1297
1283
def any (
1298
1284
self ,
1285
+ * ,
1299
1286
axis : None ,
1300
1287
bool_only : _bool | None = ...,
1301
1288
skipna : _bool = ...,
@@ -1304,6 +1291,7 @@ class DataFrame(NDFrame, OpsMixin):
1304
1291
@overload
1305
1292
def any (
1306
1293
self ,
1294
+ * ,
1307
1295
axis : AxisType = ...,
1308
1296
bool_only : _bool | None = ...,
1309
1297
skipna : _bool = ...,
@@ -1521,13 +1509,15 @@ class DataFrame(NDFrame, OpsMixin):
1521
1509
axis : AxisType | None = ...,
1522
1510
skipna : _bool | None = ...,
1523
1511
level : None = ...,
1512
+ numeric_only : _bool = ...,
1524
1513
** kwargs ,
1525
1514
) -> Series : ...
1526
1515
def kurtosis (
1527
1516
self ,
1528
1517
axis : AxisType | None = ...,
1529
1518
skipna : _bool | None = ...,
1530
1519
level : None = ...,
1520
+ numeric_only : _bool = ...,
1531
1521
** kwargs ,
1532
1522
) -> Series : ...
1533
1523
def last (self , offset ) -> DataFrame : ...
@@ -1538,58 +1528,46 @@ class DataFrame(NDFrame, OpsMixin):
1538
1528
def lt (
1539
1529
self , other , axis : AxisType = ..., level : Level | None = ...
1540
1530
) -> 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
1531
def mask (
1558
1532
self ,
1559
1533
cond : Series | DataFrame | np .ndarray ,
1560
1534
other = ...,
1561
1535
inplace : _bool = ...,
1562
1536
axis : AxisType | None = ...,
1563
1537
level : Level | None = ...,
1564
- errors : _str = ...,
1538
+ * , # Not actually positional-only, but needed due to depr in 1.5.0
1565
1539
try_cast : _bool = ...,
1566
1540
) -> DataFrame : ...
1567
1541
def max (
1568
1542
self ,
1569
1543
axis : AxisType | None = ...,
1570
1544
skipna : _bool | None = ...,
1571
1545
level : None = ...,
1546
+ numeric_only : _bool = ...,
1572
1547
** kwargs ,
1573
1548
) -> Series : ...
1574
1549
def mean (
1575
1550
self ,
1576
1551
axis : AxisType | None = ...,
1577
1552
skipna : _bool | None = ...,
1578
1553
level : None = ...,
1554
+ numeric_only : _bool = ...,
1579
1555
** kwargs ,
1580
1556
) -> Series : ...
1581
1557
def median (
1582
1558
self ,
1583
1559
axis : AxisType | None = ...,
1584
1560
skipna : _bool | None = ...,
1585
1561
level : None = ...,
1562
+ numeric_only : _bool = ...,
1586
1563
** kwargs ,
1587
1564
) -> Series : ...
1588
1565
def min (
1589
1566
self ,
1590
1567
axis : AxisType | None = ...,
1591
1568
skipna : _bool | None = ...,
1592
1569
level : None = ...,
1570
+ numeric_only : _bool = ...,
1593
1571
** kwargs ,
1594
1572
) -> Series : ...
1595
1573
def mod (
@@ -1643,6 +1621,7 @@ class DataFrame(NDFrame, OpsMixin):
1643
1621
axis : AxisType | None = ...,
1644
1622
skipna : _bool | None = ...,
1645
1623
level : None = ...,
1624
+ numeric_only : _bool = ...,
1646
1625
min_count : int = ...,
1647
1626
** kwargs ,
1648
1627
) -> Series : ...
@@ -1651,6 +1630,7 @@ class DataFrame(NDFrame, OpsMixin):
1651
1630
axis : AxisType | None = ...,
1652
1631
skipna : _bool = ...,
1653
1632
level : None = ...,
1633
+ numeric_only : _bool = ...,
1654
1634
min_count : int = ...,
1655
1635
** kwargs ,
1656
1636
) -> Series : ...
@@ -1820,30 +1800,17 @@ class DataFrame(NDFrame, OpsMixin):
1820
1800
skipna : _bool | None = ...,
1821
1801
level : None = ...,
1822
1802
ddof : int = ...,
1803
+ numeric_only : _bool = ...,
1823
1804
** kwargs ,
1824
1805
) -> 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 : ...
1806
+ # Not actually positional, but used to handle removal of deprecated
1807
+ def set_axis (self , labels , * , axis : AxisType , copy : bool = ...) -> DataFrame : ...
1842
1808
def skew (
1843
1809
self ,
1844
1810
axis : AxisType | None = ...,
1845
1811
skipna : _bool | None = ...,
1846
1812
level : None = ...,
1813
+ numeric_only : _bool = ...,
1847
1814
** kwargs ,
1848
1815
) -> Series : ...
1849
1816
def slice_shift (self , periods : int = ..., axis : AxisType = ...) -> DataFrame : ...
@@ -1854,6 +1821,7 @@ class DataFrame(NDFrame, OpsMixin):
1854
1821
skipna : _bool = ...,
1855
1822
level : None = ...,
1856
1823
ddof : int = ...,
1824
+ numeric_only : _bool = ...,
1857
1825
** kwargs ,
1858
1826
) -> Series : ...
1859
1827
def sub (
@@ -1875,6 +1843,7 @@ class DataFrame(NDFrame, OpsMixin):
1875
1843
axis : AxisType | None = ...,
1876
1844
skipna : _bool | None = ...,
1877
1845
level : None = ...,
1846
+ numeric_only : _bool = ...,
1878
1847
min_count : int = ...,
1879
1848
** kwargs ,
1880
1849
) -> Series : ...
@@ -2010,6 +1979,7 @@ class DataFrame(NDFrame, OpsMixin):
2010
1979
skipna : _bool | None = ...,
2011
1980
level : None = ...,
2012
1981
ddof : int = ...,
1982
+ numeric_only : _bool = ...,
2013
1983
** kwargs ,
2014
1984
) -> Series : ...
2015
1985
def where (
@@ -2023,7 +1993,7 @@ class DataFrame(NDFrame, OpsMixin):
2023
1993
inplace : _bool = ...,
2024
1994
axis : AxisType | None = ...,
2025
1995
level : Level | None = ...,
2026
- errors : _str = ...,
1996
+ * , # Not actually positional-only, but needed due to depr in 1.5.0
2027
1997
try_cast : _bool = ...,
2028
1998
) -> DataFrame : ...
2029
1999
# Move from generic because Series is Generic and it returns Series[bool] there
0 commit comments