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
In [23]: df = DataFrame({'a':[1,2,3],'b':[1,2,3],'c':[1,2,3]})
In [24]: x = df.set_index(['a','b'])
In [25]: x
Out[25]:
c
a b
1 1 1
2 2 2
3 3 3
[3 rows x 1 columns]
In [26]: x.T.get((1,1))
Out[26]:
c 1
Name: (1, 1), dtype: int64
In [27]: x.T.get((1,5),default='foo')
Out[27]: 'foo'
x.get((1,5),default='foo',axis=0) should work (still need the info_axis to be the default though)
The text was updated successfully, but these errors were encountered:
http://stackoverflow.com/questions/22636487/selection-in-multi-indexed-dataframe-when-key-does-not-exists/22637762#22637762
x.get((1,5),default='foo',axis=0)
should work (still need theinfo_axis
to be the default though)The text was updated successfully, but these errors were encountered: