[Pandas-dev] Why is it not possible to access index entries like columns?

Tyler Hardin th020394 at gmail.com
Sun Jun 11 16:11:50 EDT 2017


Hi,

Is it just a matter of implementing the lookup in the . and [] operator
methods to return df.index.get_level_values() with the argument, or is
there some deeper reason this can't work that I'm not seeing?

E.g. I want df['date'] to do df.get_level_values('date') when there is no
date column and there is a level in the index named 'date'. Presumably,
this would be a secondary lookup w/ columns taking precedence -- i.e. a
'date' column would mask a 'date' index.

Thanks,
Tyler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pandas-dev/attachments/20170611/60e562fc/attachment.html>


More information about the Pandas-dev mailing list