-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN/REF: indexing typing, prune unreachable branches #27351
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
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5506cc6
mark indexing methods
jbrockmendel 3716f41
Merge branch 'master' of https://github.com/pandas-dev/pandas into in…
jbrockmendel b75e0f9
Merge branch 'master' of https://github.com/pandas-dev/pandas into in…
jbrockmendel 31f44f5
types
jbrockmendel 6148c02
change hasattr check
jbrockmendel 152d884
refactor out setitem_with_indexer_missing
jbrockmendel b18ecdb
Merge branch 'master' of https://github.com/pandas-dev/pandas into in…
jbrockmendel 35a76c8
remove no-longer-necessary Panel-compat code from GH#10360
jbrockmendel 44eb317
cleanups becasue we know 2d
jbrockmendel 8b2e880
Merge branch 'master' of https://github.com/pandas-dev/pandas into in…
jbrockmendel bf170eb
all extant usages of _get_loc pass an int key
jbrockmendel 4e6e113
trim never-reached branches
jbrockmendel df7cac4
remove marks
jbrockmendel 5fb03e1
simplify ixs
jbrockmendel 75e0bc1
remove comments
jbrockmendel 139aeeb
Merge branch 'master' of https://github.com/pandas-dev/pandas into in…
jbrockmendel 437f8fe
dont use index_len
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3495,7 +3495,7 @@ def __delitem__(self, key): | |
deleted = False | ||
|
||
maybe_shortcut = False | ||
if hasattr(self, "columns") and isinstance(self.columns, MultiIndex): | ||
if self.ndim == 2 and isinstance(self.columns, MultiIndex): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the future change to use ABCMultiIndex |
||
try: | ||
maybe_shortcut = key not in self.columns._engine | ||
except TypeError: | ||
|
@@ -5264,9 +5264,6 @@ def _dir_additions(self): | |
} | ||
return super()._dir_additions().union(additions) | ||
|
||
# ---------------------------------------------------------------------- | ||
# Getting and setting elements | ||
|
||
# ---------------------------------------------------------------------- | ||
# Consolidation of internals | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
axis
is a pretty common keyword can you put that asAxis
in pandas._typing? We probably also want to addstr
as a type for it since it should accept "index" and "columns" as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can we add the return type here?
-> 'DataFrame
'?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look and see what we can determine about return types. For Axis/str/int, in all these cases, I've put int because these are private methods and only ever get ints.