-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Address some TODO comments #23208
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
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 |
---|---|---|
|
@@ -3205,7 +3205,7 @@ def is_dtype_instance_mapper(idx, dtype): | |
exclude_these.iloc[idx] = not any(map(f, exclude)) | ||
|
||
dtype_indexer = include_these & exclude_these | ||
return self.loc[com.get_info_slice(self, dtype_indexer)] | ||
return self.loc[_get_info_slice(self, dtype_indexer)] | ||
|
||
def _box_item_values(self, key, values): | ||
items = self.columns[self.columns.get_loc(key)] | ||
|
@@ -8040,3 +8040,13 @@ def _from_nested_dict(data): | |
|
||
def _put_str(s, space): | ||
return u'{s}'.format(s=s)[:space].ljust(space) | ||
|
||
|
||
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. don't put this here, pandas/core/indexing.py is better or pandas/core/index/api.py 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.
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. ok, can you just inline it then where it is used (make it a local function) instead. |
||
def _get_info_slice(obj, indexer): | ||
"""Slice the info axis of `obj` with `indexer`.""" | ||
if not hasattr(obj, '_info_axis_number'): | ||
msg = 'object of type {typ!r} has no info axis' | ||
raise TypeError(msg.format(typ=type(obj).__name__)) | ||
slices = [slice(None)] * obj.ndim | ||
slices[obj._info_axis_number] = indexer | ||
return tuple(slices) |
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.
just move the local function here