python 索引设置为列_python – 将DataFrame列标题设置为MultiIndex
如何将具有单级列的现有数据框转换为具有分层索引列(MultiIndex)?示例数据帧:In [1]:import pandas as pdfrom pandas import Series, DataFramedf = DataFrame(np.arange(6).reshape((2,3)),index=['A','B'],columns=['one','two','three'])dfOut ...