-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: @doc - base.py & indexing.py #31970
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 3 commits
06a5d9e
9a4abae
e580a96
ede988c
41a7552
6cd8082
1534dad
703f7a6
a1b0e0b
5077ab0
8ea6e1b
8e320ce
1ee2cf7
7bf242e
61e87af
224cec8
e01e108
48cfcda
20f96f2
76ed611
95a86ee
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
Substitution, | ||
cache_readonly, | ||
deprecate_kwarg, | ||
doc, | ||
) | ||
from pandas.util._validators import validate_bool_kwarg, validate_fillna_kwargs | ||
|
||
|
@@ -51,7 +52,7 @@ | |
_extension_array_shared_docs, | ||
try_cast_to_ea, | ||
) | ||
from pandas.core.base import NoNewAttributesMixin, PandasObject, _shared_docs | ||
from pandas.core.base import IndexOpsMixin, NoNewAttributesMixin, PandasObject | ||
import pandas.core.common as com | ||
from pandas.core.construction import array, extract_array, sanitize_array | ||
from pandas.core.indexers import check_array_indexer, deprecate_ndim_indexing | ||
|
@@ -1352,8 +1353,7 @@ def memory_usage(self, deep=False): | |
""" | ||
return self._codes.nbytes + self.dtype.categories.memory_usage(deep=deep) | ||
|
||
@Substitution(klass="Categorical") | ||
@Appender(_shared_docs["searchsorted"]) | ||
@doc(IndexOpsMixin.searchsorted, klass="Categorical") | ||
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. should this be inheriting from core.arrays.base.ExtensionArray instead? Also I can't see this docstring in the published docs. 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. I agree with this comment here - this seems strange to use |
||
def searchsorted(self, value, side="left", sorter=None): | ||
# searchsorted is very performance sensitive. By converting codes | ||
# to same dtype as self.codes, we get much faster performance. | ||
|
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 believe I am in the minority on this view and don't want to be overly difficult, but can you refactor the
IndexOpsMixin
as a pre-cursor to this, or leave this module separate from the rest of changes (which look good btw)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.
Yes, that is a good idea. I would convert this back to using
_shared_docs
. This PR is already too large, and I should really put them separately.