: : : : : : : : : : : : : : : : : : : : item realgdp infl unemp realgdp infl unemp realgdp infl unemp realgdp value value - - - - by omitting the last argumentyou obtain dataframe with hierarchical columnsin [ ]pivoted ldata pivot('date''item'in [ ]pivoted[: out[ ]value value item infl realgdp unemp infl realgdp unemp date - - - - - - - in [ ]pivoted['value'][: out[ ]item infl realgdp unemp date note that pivot is just shortcut for creating hierarchical index using set_index and reshaping with unstackin [ ]unstacked ldata set_index(['date''item']unstack('item'in [ ]unstacked[: out[ ]value item infl realgdp date unemp value infl realgdp unemp - - - - - - - - - - - reshaping and pivoting www it-ebooks info