objects if the index is lexicographically sorted starting with the outermost levelthat isthe result of calling sortlevel( or sort_index(summary statistics by level many descriptive and summary statistics on dataframe and series have level option in which you can specify the level you want to sum by on particular axis consider the above dataframewe can sum by level on either the rows or columns like soin [ ]frame sum(level='key 'out[ ]state ohio colorado color green red green key in [ ]frame sum(level='color'axis= out[ ]color green red key key under the hoodthis utilizes pandas' groupby machinery which will be discussed in more detail later in the book using dataframe' columns it' not unusual to want to use one or more columns from dataframe as the row indexalternativelyyou may wish to move the row index into the dataframe' columns here' an example dataframein [ ]frame dataframe({' 'range( )' 'range( - )' '['one''one''one''two''two''two''two']' '[ ]}in [ ]frame out[ ] one one one two two two two getting started with pandas www it-ebooks info