-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Series.drop() with MultiIndex: inconsistent behaviour #8594
Labels
Milestone
Comments
xref to #6599 |
This bug is still present in 0.23.2 |
proost
added a commit
to proost/pandas
that referenced
this issue
Dec 20, 2019
5 tasks
proost
added a commit
to proost/pandas
that referenced
this issue
Dec 23, 2019
proost
added a commit
to proost/pandas
that referenced
this issue
Dec 26, 2019
proost
added a commit
to proost/pandas
that referenced
this issue
Dec 26, 2019
jreback
pushed a commit
that referenced
this issue
Dec 26, 2019
AlexKirko
pushed a commit
to AlexKirko/pandas
that referenced
this issue
Dec 29, 2019
andrewsanchez
added a commit
to andrewsanchez/q2-diversity
that referenced
this issue
Feb 12, 2020
This prevents attempting to drop columns that don't exist in merged.columns after setting the index, while still dropping columns that are present in merged.columns. Attempting to do see raises an exception in pandas >= 1. Please see pandas-dev/pandas#8594 for details.
andrewsanchez
added a commit
to andrewsanchez/q2-diversity
that referenced
this issue
Feb 12, 2020
This prevents attempting to drop columns that don't exist in merged.columns after setting the index, while still dropping columns that are present in merged.columns. Attempting to do see raises an exception in pandas >= 1. Please see pandas-dev/pandas#8594 for details.
andrewsanchez
added a commit
to andrewsanchez/q2-diversity
that referenced
this issue
Feb 13, 2020
This prevents attempting to drop columns that don't exist in merged.columns after setting the index, while still dropping columns that are present in merged.columns. Attempting to do so raises an exception in pandas >= 1. Please see pandas-dev/pandas#8594 for details.
nbokulich
pushed a commit
to qiime2/q2-diversity
that referenced
this issue
Feb 14, 2020
* Use MultiIndex.codes instead of labels (no longer support) Please see these links for the rational if interested: pandas-dev/pandas#13443 pandas-dev/pandas#23752 * Unpack and name values returned by _reindex_with_metadata This makes it easier to see what's going on below with the values returned by this function. * Initial patch to handle new pandas error This prevents attempting to drop columns that don't exist in merged.columns after setting the index, while still dropping columns that are present in merged.columns. Attempting to do so raises an exception in pandas >= 1. Please see pandas-dev/pandas#8594 for details. * Avoid mutating `merged` in place by assigning to new variable This avoids attempting to drop columns that had already been dropped in previous calls to _reindex_with_metadata in the for loop in `alpha_rarefaction`. Co-authored-by: Matthew Dillon <matthewrdillon@gmail.com> Co-authored-by: Matthew Dillon <matthewrdillon@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
The behaviour below occurs in versions
'0.15.0rc1-21-g32c5016'
and'0.14.1'
.When the
label
passed to thedrop
method of aSeries
is not in the axis:(a) if the index is not a
MultiIndex
then an exception is raised (in most cases; see issue #8530)(b) if the index is a
MultiIndex
then an exception is not raised; the original series is returnedExamples of current behaviour:
(a)
(b)
I propose that in (b) an exception be raised. Furthermore, an exception should be raised in (b) if (for instance) the label passed to
drop
had been4
, because although4
is in the axis, it is not in the specified level.The exception message in (b) would have to refer to the level, e.g.:
The text was updated successfully, but these errors were encountered: