-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ERR: MultiIndex searchsorted #14990
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
ERR: MultiIndex searchsorted #14990
Conversation
Added searchsorted implementation to MultiIndex
@ShaharBental on the issue I indicated that this should simply raise a |
Current coverage is 84.66% (diff: 100%)@@ master #14990 diff @@
==========================================
Files 144 144
Lines 51056 51072 +16
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43225 43241 +16
Misses 7831 7831
Partials 0 0
|
@jreback Sorry, changed it to simply raise a NotImplementedError |
@@ -1470,6 +1470,9 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None): | |||
|
|||
return _ensure_platform_int(indexer) | |||
|
|||
def searchsorted(self, value, side='left', sorter=None): | |||
raise NotImplementedError() |
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.
add a helpful message that explains one should use multi-index indexing here.
# Test if MultiIndex searchsorted raises the NotImplementedException | ||
df_mi = pd.MultiIndex([[0], ["a"]], [[0], [0]]) | ||
with self.assertRaises(Exception) as context: | ||
df_mi.searchsorted((1, "b")) |
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.
with self.assertRaises(NotImplementedError):
...
is enough
pls add a note in other api changes in 0.20.0 |
closing as stale. please ping if you'd like to continue. |
git diff upstream/master | flake8 --diff