終於解決了它,因爲我想在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)
做了什麼,我一直在尋找。