Closed
Description
Hi,
I have a simple dataframe with a multiindex.
stats.index.names
Out[67]: FrozenList([u'day', u'category'])
day is a time variable, category is a string.
stats.index.inferred_type
Out[69]: 'mixed'
stats.index.dtype_str
Out[68]: 'object'
if I type
idx=pd.IndexSlice
stats.loc[idx['2015-01-01',:],:]
I get the correct slice at '2015-01-01', that is all the observations for all the categories on that day.
If I type
idx=pd.IndexSlice
stats.loc[idx['2015',:],:]
I get back (almost) all my observations, even for years other than 2015.
What can be the problem here? I cannot paste the data unfortunately but I am happy to help in any way.
Thanks