-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TYP: ExtensionArray delete() and searchsorted() #41513
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
1bf4b5d
16bcc1a
c0d426f
cce79a9
0a9cd7a
f37d215
22b147a
065454f
cde198e
b986eba
2d85ddb
493ab41
f8f8b93
704abef
f8d4267
9c391a0
4e60e04
6a888ef
2370384
42802ec
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 |
---|---|---|
|
@@ -813,7 +813,12 @@ def unique(self: ExtensionArrayT) -> ExtensionArrayT: | |
uniques = unique(self.astype(object)) | ||
return self._from_sequence(uniques, dtype=self.dtype) | ||
|
||
def searchsorted(self, value, side="left", sorter=None): | ||
def searchsorted( | ||
self, | ||
value: ArrayLike, | ||
side: Literal["left", "right"] = "left", | ||
sorter: ArrayLike | None = None, | ||
): | ||
Dr-Irv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
Find indices where elements should be inserted to maintain order. | ||
|
||
|
@@ -1308,7 +1313,7 @@ def __hash__(self) -> int: | |
# ------------------------------------------------------------------------ | ||
# Non-Optimized Default Methods | ||
|
||
def delete(self: ExtensionArrayT, loc) -> ExtensionArrayT: | ||
def delete(self: ExtensionArrayT, loc: PositionalIndexer) -> ExtensionArrayT: | ||
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. This is in the 'public' base EA class. it was added in #39405. @jbrockmendel is this method public? Is it part of the EA interface? does it need a docstring? 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. good catch ill make a note to add a docstring |
||
indexer = np.delete(np.arange(len(self)), loc) | ||
return self.take(indexer) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.