We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
mi = MultiIndex.from_tuples([(1, 2), (2, 2), (3, 2)]) mi.drop([1, 4], level=0) # does not raise mi.drop(4, level=0) # raises
The docs say
Raises KeyError If not all of the labels are found in the selected axis
I think both statements should raise KeyError https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.drop.html
KeyError
Both are raising KeyError: 'labels [4] not found in level'
KeyError: 'labels [4] not found in level'
For regular Indexes this holds True
index = Index([1, 2]) index.drop([1, 3]) # Raises
pd.show_versions()
master
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
The docs say
I think both statements should raise
KeyError
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.drop.html
Expected Output
Both are raising
KeyError: 'labels [4] not found in level'
For regular Indexes this holds True
Output of
pd.show_versions()
master
The text was updated successfully, but these errors were encountered: