df = pd.DataFrame({ "HR": [50, 63, 40, 68, 35, 44, 31], "Engineering": [77, 85, 62, 89, 58, 56, 59], "Marketing": [50, 35, 79, 43, 67, 31, 24], "Sales": [59, 62, 33, 77, 72, 55, 66], "Customer Service": [31, 34, 61, 70, 39, 49, 81], "Distribution": [35, 21, 66, 90, 31, 67, 81], "Logistics": [50, 54, 13, 71, 32, 58, 51], "Production": [22, 51, 54, 28, 40, 41, 62], "Maintenance": [50, 32, 61, 69, 50, 49, 41], "Quality Control": [20, 21, 88, 89, 39, 66, 32] }, index=["New York", "San Francisco", "Los Angeles", "Chicago", "Miami", "Las Vegas", "Boston"]) df = df.T df = df.loc[df.sum(axis=1).sort_values().index] df