终于解决了它,因为我想在row1_order各项指标,全部10项指标中row2_order,所以我把它们改变这些值:
row1_order = ['Instruction','Instruction','Instruction','Instruction','Instruction','Instruction','Instruction','Instruction','Instruction','Instruction',
'Support Services','Support Services','Support Services','Support Services','Support Services','Support Services','Support Services','Support Services','Support Services','Support Services',
'Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.','Executive Admin.',
'School Admin.','School Admin.','School Admin.','School Admin.','School Admin.','School Admin.','School Admin.','School Admin.','School Admin.','School Admin.',
'Business Services','Business Services','Business Services','Business Services','Business Services','Business Services','Business Services','Business Services','Business Services','Business Services',
'Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant','Op. & Maint. Of Plant',
'Transportation','Transportation','Transportation','Transportation','Transportation','Transportation','Transportation','Transportation','Transportation','Transportation',
'Benefits','Benefits','Benefits','Benefits','Benefits','Benefits','Benefits','Benefits','Benefits','Benefits',
'Debt Service','Debt Service','Debt Service','Debt Service','Debt Service','Debt Service','Debt Service','Debt Service','Debt Service','Debt Service',
'Transfers','Transfers','Transfers','Transfers','Transfers','Transfers','Transfers','Transfers','Transfers','Transfers']
row2_order = ['Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service',
'Wages', 'Benefits', 'Property Service', 'Professional Services',
'Debt Service','Supplies','Other Services','Equipment',
'Dues & Fees', 'Transfer to Food Service']
,然后运行 multi_index = [np.array(row1_order), np.array(row2_order)] my_pivot_table = my_pivot_table.reindex_axis(multi_index, axis = 0)
做了什么,我一直在寻找。