Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas access multiindex column

df[df.index.get_level_values('one') == 'a']
# If your levels are unnamed, or if you need to select by position (not label),
# df[df.index.get_level_values(0) == 'a']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #access #multiindex #column
ADD COMMENT
Topic
Name
4+8 =