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
s = pd.Series([1, 1], index=[(1, 1), (1, 1)])
s[(1, 1)]
raises KeyError: (1, 1). Within pandas._libs.index.IndexEngine._get_loc_duplicates, we're using ndarray.searchsorted which interprets the tuple as an array-like of values to search for rather than a single tuple.
The text was updated successfully, but these errors were encountered:
@GYHHAHA what is ambiguous? When Series has a multi-index, a tuple consists of labels for different levels. When Series doesn't have a multi-index, a tuple is a single label. Or is there some other case(s)?
one might expect to get 2 rather than the actual output of 1. In any case, oddities in the case of nested tuples should not imply that we shouldn't make improvements on supporting tuples.
E.g.
raises
KeyError: (1, 1)
. Withinpandas._libs.index.IndexEngine._get_loc_duplicates
, we're using ndarray.searchsorted which interprets the tuple as an array-like of values to search for rather than a single tuple.The text was updated successfully, but these errors were encountered: