Skip to content

pandas: fix various arguments for Series.iloc and DataFrame.loc #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class _iLocIndexerFrame(_iLocIndexer):
) -> None: ...

class _LocIndexerFrame(_LocIndexer):
@overload
def __getitem__(self, idx: Union[Union[IndexType, MaskType], Tuple[Union[IndexType, MaskType, slice], Union[List[StrLike], slice]]],) -> DataFrame: ...
@overload
def __getitem__(self, idx: Tuple[StrLike, StrLike],) -> Scalar: ...
@overload
Expand All @@ -63,8 +65,6 @@ class _LocIndexerFrame(_LocIndexer):
@overload
def __getitem__(self, idx: Tuple[Union[IndexType, MaskType], StrLike],) -> Series[Dtype]: ...
@overload
def __getitem__(self, idx: Union[Union[IndexType, MaskType], Tuple[Union[IndexType, MaskType], Union[List[StrLike], slice]]],) -> DataFrame: ...
@overload
def __getitem__(self, idx: Index) -> DataFrame: ...

def __setitem__(
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _iLocIndexerSeries(_iLocIndexer, Generic[S1]):
@overload
def __getitem__(self, idx: int) -> S1: ...
@overload
def __getitem__(self, idx: Index) -> Series[S1]: ...
def __getitem__(self, idx: Union[Index, slice]) -> Series[S1]: ...
# set item
@overload
def __setitem__(self, idx: int, value: S1) -> None: ...
Expand All @@ -37,7 +37,7 @@ class _iLocIndexerSeries(_iLocIndexer, Generic[S1]):

class _LocIndexerSeries(_LocIndexer, Generic[S1]):
@overload
def __getitem__(self, idx: Union[MaskType, Sequence[str]],) -> Series[S1]: ...
def __getitem__(self, idx: Union[MaskType, Index, Sequence[str], slice],) -> Series[S1]: ...
@overload
def __getitem__(self, idx: Union[int, str],) -> S1: ...
@overload
Expand Down