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
df = pd.DataFrame.from_items([('a', [1,2]), ('b', ([3,4]))])
df.index = pd.MultiIndex.from_tuples([('A', 'B'),('C', 'D')],
names=['k1', 'k2'])
# A dataframe, with a multiindex:
>>> df
a b
k1 k2
A B 1 3
C D 2 4
.ix[('A','B')] succeeds .ix['A','B'] succeeds as the A, B is tried as a tuple (.ix tries hard here)
propose that we change .loc to disallow the 2nd case and instead raise a KeyError
its more 'strict'
The text was updated successfully, but these errors were encountered:
@y-p ahh yes.........I guess there is not a way to disambiguate if the tuple exists in a mi in the index, versus the case where the individual elements existing in both an index and a column......
yeah. I think in some places in pandas the type is used to dismbiguate behaviour
(tuple vs. list trigger different code paths). I noticed a while back that the semantics
of sets aren't exploited yet. Maybe we can put that to good use someday
(with slighly verbose syntax on python 2.6), as if pandas' signature overloading wasn't
ridiculous already
What should .iloc[{1,2,3,5}] mean? random permutation of rows?
label-uniquified slice? foo? bar?
from ML
https://groups.google.com/forum/?fromgroups=#!topic/pydata/fzPGjVrj9lU
.ix[('A','B')]
succeeds.ix['A','B']
succeeds as theA, B
is tried as a tuple (.ix
tries hard here)propose that we change
.loc
to disallow the 2nd case and instead raise a KeyErrorits more 'strict'
The text was updated successfully, but these errors were encountered: