Skip to content

Commit cb67837

Browse files
authored
TYP: _item_cache and _ixs (#47506)
* typ: _item_cache and _ixs * fixup docstring * linting
1 parent 428540b commit cb67837

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pandas/core/frame.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3558,16 +3558,16 @@ def T(self) -> DataFrame:
35583558
# ----------------------------------------------------------------------
35593559
# Indexing Methods
35603560

3561-
def _ixs(self, i: int, axis: int = 0):
3561+
def _ixs(self, i: int, axis: int = 0) -> Series:
35623562
"""
35633563
Parameters
35643564
----------
35653565
i : int
35663566
axis : int
35673567
3568-
Notes
3569-
-----
3570-
If slice passed, the resulting data will be a view.
3568+
Returns
3569+
-------
3570+
Series
35713571
"""
35723572
# irow
35733573
if axis == 0:

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ def __getstate__(self) -> dict[str, Any]:
20142014
}
20152015

20162016
@final
2017-
def __setstate__(self, state):
2017+
def __setstate__(self, state) -> None:
20182018
if isinstance(state, BlockManager):
20192019
self._mgr = state
20202020
elif isinstance(state, dict):
@@ -2047,7 +2047,7 @@ def __setstate__(self, state):
20472047
elif len(state) == 2:
20482048
raise NotImplementedError("Pre-0.12 pickles are no longer supported")
20492049

2050-
self._item_cache = {}
2050+
self._item_cache: dict[Hashable, Series] = {}
20512051

20522052
# ----------------------------------------------------------------------
20532053
# Rendering Methods

pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ def _take_with_is_copy(self, indices, axis=0) -> Series:
932932
"""
933933
return self.take(indices=indices, axis=axis)
934934

935-
def _ixs(self, i: int, axis: int = 0):
935+
def _ixs(self, i: int, axis: int = 0) -> Any:
936936
"""
937937
Return the i-th value or values in the Series by location.
938938

0 commit comments

Comments
 (0)