@@ -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 ,
@@ -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 :
@@ -1591,13 +1631,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1591
1631
axis : Axis = 0 ,
1592
1632
skipna : _bool = True ,
1593
1633
numeric_only : _bool = False ,
1594
- ) -> Series : ...
1634
+ ) -> Series [ int ] : ...
1595
1635
def idxmin (
1596
1636
self ,
1597
1637
axis : Axis = 0 ,
1598
1638
skipna : _bool = True ,
1599
1639
numeric_only : _bool = False ,
1600
- ) -> Series : ...
1640
+ ) -> Series [ int ] : ...
1601
1641
def mode (
1602
1642
self ,
1603
1643
axis : Axis = 0 ,
@@ -1683,7 +1723,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1683
1723
def __iter__ (self ) -> Iterator [Hashable ]: ...
1684
1724
# properties
1685
1725
@property
1686
- def at (self ): ... # Not sure what to do with this yet; look at source
1726
+ def at (self ) -> _AtIndexerFrame : ...
1687
1727
@property
1688
1728
def columns (self ) -> Index [str ]: ...
1689
1729
@columns .setter # setter needs to be right next to getter; otherwise mypy complains
@@ -1695,7 +1735,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1695
1735
@property
1696
1736
def empty (self ) -> _bool : ...
1697
1737
@property
1698
- def iat (self ): ... # Not sure what to do with this yet; look at source
1738
+ def iat (self ) -> _iAtIndexerFrame : ...
1699
1739
@property
1700
1740
def iloc (self ) -> _iLocIndexerFrame [Self ]: ...
1701
1741
@property
0 commit comments