-
-
Couldn't load subscription status.
- Fork 19.2k
Deprecate DataFrame indexer for iloc setitem and getitem #39022
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
Changes from 2 commits
1821317
dfd8eba
82446b5
637867b
a735e1c
d9b7295
82d4cfa
62f6414
4da631d
a4a00f7
c9199d8
6ec9a9f
32c0583
399dfc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1389,6 +1389,14 @@ def _has_valid_setitem_indexer(self, indexer) -> bool: | |
| if isinstance(indexer, dict): | ||
| raise IndexError("iloc cannot enlarge its target object") | ||
|
|
||
| if isinstance(indexer, ABCDataFrame): | ||
| warnings.warn( | ||
| "DataFrame indexer for iloc is deprecated and will be removed in " | ||
| "a future version", | ||
|
||
| FutureWarning, | ||
| stacklevel=3, | ||
| ) | ||
|
|
||
| if not isinstance(indexer, tuple): | ||
| indexer = _tuplify(self.ndim, indexer) | ||
|
|
||
|
|
@@ -1480,6 +1488,9 @@ def _get_list_axis(self, key, axis: int): | |
| raise IndexError("positional indexers are out-of-bounds") from err | ||
|
|
||
| def _getitem_axis(self, key, axis: int): | ||
| if isinstance(key, ABCDataFrame): | ||
| raise IndexError("DataFrame indexer is not allowed for iloc") | ||
phofl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| if isinstance(key, slice): | ||
| return self._get_slice_axis(key, axis=axis) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.