pandas stack()函数可用于转置,但功能绝不仅仅限于转置。真正的转置是df.T

实际上转置是df.T

pandas stack()函数可用于转置,但功能绝不仅仅限于转置。真正的转置是df.T_第1张图片

http://pandas.pydata.org/pandas-docs/stable/reshaping.html#reshaping-and-pivot-tables 

  • Reshaping and Pivot Tables
    • Reshaping by pivoting DataFrame objects
    • Reshaping by stacking and unstacking
      • Multiple Levels
      • Missing Data
      • With a MultiIndex
    • Reshaping by Melt
    • Combining with stats and GroupBy
    • Pivot tables
      • Adding margins
    • Cross tabulations
      • Normalization
      • Adding Margins
    • Tiling
    • Computing indicator / dummy variables
    • Factorizing values

你可能感兴趣的:(pandas stack()函数可用于转置,但功能绝不仅仅限于转置。真正的转置是df.T)