- - hierarchical indexing plays critical role in reshaping data and group-based operations like forming pivot table for examplethis data could be rearranged into dataframe using its unstack methodin [ ]data unstack(out[ ] - - - - - - nan nan the inverse operation of unstack is stackin [ ]data unstack(stack(out[ ] - - - - - - stack and unstack will be explored in more detail in with dataframeeither axis can have hierarchical indexin [ ]frame dataframe(np arange( reshape(( ))index=[[' '' '' '' '][ ]]columns=[['ohio''ohio''colorado']['green''red''green']]in [ ]frame out[ ]ohio green red colorado green the hierarchical levels can have names (as strings or any python objectsif sothese will show up in the console output (don' confuse the index names with the axis labels!)in [ ]frame index names ['key ''key 'in [ ]frame columns names ['state''color'in [ ]frame getting started with pandas www it-ebooks info