You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to drop some of the "layers" in Dataset dimension which has non-unique values. When using xr.Dataset.drop_isel I am getting an exception because the dimension has non-unique values.
InvalidIndexError: Reindexing only valid with uniquely valued Index objects
I guess, I am surprised to see the exception as I am specifying exact index positions to drop from the dataset. I could see the reason for the exception if I am to provide dimension labels to drop instead.
Is there a way to "drop" layers for the dimension which has non-unique values in it? Any help is much appreciated!
Here is a code snippet which reproduces the problem (code is borrowed from xarray.Dataset.drop_isel which I slightly modified to have non-unique values):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have to drop some of the "layers" in Dataset dimension which has non-unique values. When using
xr.Dataset.drop_isel
I am getting an exception because the dimension has non-unique values.InvalidIndexError: Reindexing only valid with uniquely valued Index objects
I guess, I am surprised to see the exception as I am specifying exact index positions to drop from the dataset. I could see the reason for the exception if I am to provide dimension labels to drop instead.
Is there a way to "drop" layers for the dimension which has non-unique values in it? Any help is much appreciated!
Here is a code snippet which reproduces the problem (code is borrowed from
xarray.Dataset.drop_isel
which I slightly modified to have non-unique values):which produces output
Beta Was this translation helpful? Give feedback.
All reactions