@@ -45,6 +45,8 @@ from pandas.core.indexes.multi import MultiIndex
45
45
from pandas .core .indexes .period import PeriodIndex
46
46
from pandas .core .indexes .timedeltas import TimedeltaIndex
47
47
from pandas .core .indexing import (
48
+ _AtIndexer ,
49
+ _iAtIndexer ,
48
50
_iLocIndexer ,
49
51
_IndexSliceTuple ,
50
52
_LocIndexer ,
@@ -224,7 +226,7 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
224
226
| slice
225
227
| _IndexSliceTuple
226
228
| Callable ,
227
- MaskType | list [HashableT ] | slice | Callable ,
229
+ MaskType | list [HashableT ] | IndexType | Callable ,
228
230
]
229
231
),
230
232
) -> _T : ...
@@ -285,6 +287,44 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
285
287
value : Scalar | NAType | NaTType | ArrayLike | Series | list | dict | None ,
286
288
) -> None : ...
287
289
290
+ class _iAtIndexerFrame (_iAtIndexer ):
291
+ def __getitem__ (self , idx : tuple [int , int ]) -> Scalar : ...
292
+ def __setitem__ (
293
+ self ,
294
+ idx : tuple [int , int ],
295
+ value : Scalar | NAType | NaTType | None ,
296
+ ) -> None : ...
297
+
298
+ class _AtIndexerFrame (_AtIndexer ):
299
+ def __getitem__ (
300
+ self ,
301
+ idx : tuple [
302
+ int
303
+ | StrLike
304
+ | Timestamp
305
+ | tuple [Scalar , ...]
306
+ | Callable [[DataFrame ], ScalarT ],
307
+ int | StrLike | tuple [Scalar , ...],
308
+ ],
309
+ ) -> Scalar : ...
310
+ def __setitem__ (
311
+ self ,
312
+ idx : (
313
+ MaskType | StrLike | _IndexSliceTuple | list [ScalarT ] | IndexingInt | slice
314
+ ),
315
+ value : (
316
+ Scalar
317
+ | NAType
318
+ | NaTType
319
+ | ArrayLike
320
+ | Series
321
+ | DataFrame
322
+ | list
323
+ | Mapping [Hashable , Scalar | NAType | NaTType ]
324
+ | None
325
+ ),
326
+ ) -> None : ...
327
+
288
328
# With mypy 1.14.1 and python 3.12, the second overload needs a type-ignore statement
289
329
if sys .version_info >= (3 , 12 ):
290
330
class _GetItemHack :
@@ -816,7 +856,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
816
856
level : int | _str = ...,
817
857
fill_value : Scalar | None = ...,
818
858
limit : int | None = None ,
819
- tolerance : float | None = ...,
859
+ tolerance : float | Timedelta | None = ...,
820
860
) -> Self : ...
821
861
@overload
822
862
def rename (
@@ -1108,7 +1148,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1108
1148
def groupby ( # pyright: ignore reportOverlappingOverload
1109
1149
self ,
1110
1150
by : Scalar ,
1111
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1112
1151
level : IndexLabel | None = ...,
1113
1152
as_index : Literal [True ] = True ,
1114
1153
sort : _bool = ...,
@@ -1120,7 +1159,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1120
1159
def groupby (
1121
1160
self ,
1122
1161
by : Scalar ,
1123
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1124
1162
level : IndexLabel | None = ...,
1125
1163
as_index : Literal [False ] = ...,
1126
1164
sort : _bool = ...,
@@ -1132,7 +1170,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1132
1170
def groupby ( # pyright: ignore reportOverlappingOverload
1133
1171
self ,
1134
1172
by : DatetimeIndex ,
1135
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1136
1173
level : IndexLabel | None = ...,
1137
1174
as_index : Literal [True ] = True ,
1138
1175
sort : _bool = ...,
@@ -1144,7 +1181,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1144
1181
def groupby ( # pyright: ignore reportOverlappingOverload
1145
1182
self ,
1146
1183
by : DatetimeIndex ,
1147
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1148
1184
level : IndexLabel | None = ...,
1149
1185
as_index : Literal [False ] = ...,
1150
1186
sort : _bool = ...,
@@ -1156,7 +1192,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1156
1192
def groupby ( # pyright: ignore reportOverlappingOverload
1157
1193
self ,
1158
1194
by : TimedeltaIndex ,
1159
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1160
1195
level : IndexLabel | None = ...,
1161
1196
as_index : Literal [True ] = True ,
1162
1197
sort : _bool = ...,
@@ -1168,7 +1203,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1168
1203
def groupby (
1169
1204
self ,
1170
1205
by : TimedeltaIndex ,
1171
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1172
1206
level : IndexLabel | None = ...,
1173
1207
as_index : Literal [False ] = ...,
1174
1208
sort : _bool = ...,
@@ -1180,7 +1214,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1180
1214
def groupby ( # pyright: ignore reportOverlappingOverload
1181
1215
self ,
1182
1216
by : PeriodIndex ,
1183
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1184
1217
level : IndexLabel | None = ...,
1185
1218
as_index : Literal [True ] = True ,
1186
1219
sort : _bool = ...,
@@ -1192,7 +1225,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1192
1225
def groupby (
1193
1226
self ,
1194
1227
by : PeriodIndex ,
1195
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1196
1228
level : IndexLabel | None = ...,
1197
1229
as_index : Literal [False ] = ...,
1198
1230
sort : _bool = ...,
@@ -1204,7 +1236,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1204
1236
def groupby ( # pyright: ignore reportOverlappingOverload
1205
1237
self ,
1206
1238
by : IntervalIndex [IntervalT ],
1207
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1208
1239
level : IndexLabel | None = ...,
1209
1240
as_index : Literal [True ] = True ,
1210
1241
sort : _bool = ...,
@@ -1216,7 +1247,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1216
1247
def groupby (
1217
1248
self ,
1218
1249
by : IntervalIndex [IntervalT ],
1219
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1220
1250
level : IndexLabel | None = ...,
1221
1251
as_index : Literal [False ] = ...,
1222
1252
sort : _bool = ...,
@@ -1228,7 +1258,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1228
1258
def groupby ( # type: ignore[overload-overlap] # pyright: ignore reportOverlappingOverload
1229
1259
self ,
1230
1260
by : MultiIndex | GroupByObjectNonScalar | None = ...,
1231
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1232
1261
level : IndexLabel | None = ...,
1233
1262
as_index : Literal [True ] = True ,
1234
1263
sort : _bool = ...,
@@ -1240,7 +1269,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1240
1269
def groupby ( # type: ignore[overload-overlap]
1241
1270
self ,
1242
1271
by : MultiIndex | GroupByObjectNonScalar | None = ...,
1243
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1244
1272
level : IndexLabel | None = ...,
1245
1273
as_index : Literal [False ] = ...,
1246
1274
sort : _bool = ...,
@@ -1252,7 +1280,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1252
1280
def groupby ( # pyright: ignore reportOverlappingOverload
1253
1281
self ,
1254
1282
by : Series [SeriesByT ],
1255
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1256
1283
level : IndexLabel | None = ...,
1257
1284
as_index : Literal [True ] = True ,
1258
1285
sort : _bool = ...,
@@ -1264,7 +1291,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1264
1291
def groupby (
1265
1292
self ,
1266
1293
by : Series [SeriesByT ],
1267
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1268
1294
level : IndexLabel | None = ...,
1269
1295
as_index : Literal [False ] = ...,
1270
1296
sort : _bool = ...,
@@ -1276,7 +1302,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1276
1302
def groupby (
1277
1303
self ,
1278
1304
by : CategoricalIndex | Index | Series ,
1279
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1280
1305
level : IndexLabel | None = ...,
1281
1306
as_index : Literal [True ] = True ,
1282
1307
sort : _bool = ...,
@@ -1288,7 +1313,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1288
1313
def groupby (
1289
1314
self ,
1290
1315
by : CategoricalIndex | Index | Series ,
1291
- axis : AxisIndex | _NoDefaultDoNotUse = ...,
1292
1316
level : IndexLabel | None = ...,
1293
1317
as_index : Literal [False ] = ...,
1294
1318
sort : _bool = ...,
@@ -1591,13 +1615,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1591
1615
axis : Axis = 0 ,
1592
1616
skipna : _bool = True ,
1593
1617
numeric_only : _bool = False ,
1594
- ) -> Series : ...
1618
+ ) -> Series [ int ] : ...
1595
1619
def idxmin (
1596
1620
self ,
1597
1621
axis : Axis = 0 ,
1598
1622
skipna : _bool = True ,
1599
1623
numeric_only : _bool = False ,
1600
- ) -> Series : ...
1624
+ ) -> Series [ int ] : ...
1601
1625
def mode (
1602
1626
self ,
1603
1627
axis : Axis = 0 ,
@@ -1683,7 +1707,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1683
1707
def __iter__ (self ) -> Iterator [Hashable ]: ...
1684
1708
# properties
1685
1709
@property
1686
- def at (self ): ... # Not sure what to do with this yet; look at source
1710
+ def at (self ) -> _AtIndexerFrame : ...
1687
1711
@property
1688
1712
def columns (self ) -> Index [str ]: ...
1689
1713
@columns .setter # setter needs to be right next to getter; otherwise mypy complains
@@ -1695,7 +1719,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1695
1719
@property
1696
1720
def empty (self ) -> _bool : ...
1697
1721
@property
1698
- def iat (self ): ... # Not sure what to do with this yet; look at source
1722
+ def iat (self ) -> _iAtIndexerFrame : ...
1699
1723
@property
1700
1724
def iloc (self ) -> _iLocIndexerFrame [Self ]: ...
1701
1725
@property
0 commit comments