sorter = ['TOT', 'ATL', 'BOS', 'BRK', 'CHA', 'CHH', 'CHI', 'CLE', 'DAL',
    'DEN', 'DET', 'GSW', 'HOU', 'IND', 'LAC', 'LAL', 'MEM', 'MIA', 'MIL',
    'MIN', 'NJN', 'NOH', 'NOK', 'NOP', 'NYK', 'OKC', 'ORL', 'PHI', 'PHO',
    'POR', 'SAC', 'SAS', 'SEA', 'TOR', 'UTA', 'VAN', 'WAS', 'WSB']
sorterIndex = dict(zip(sorter, list(range(len(sorter)))))
df['Tm_Rank'] = df['Tm'].map(sorterIndex)
df.sort(['Player', 'Year', 'Tm_Rank'], ascending=[True, True, True],
    inplace=True)
df.drop('Tm_Rank', 1, inplace=True)
print(df)
df['Tm_Rank'] = df['Tm'].map(sorterIndex)
df.sort(['Tm_Rank', 'Player', 'Year'], ascending=[True, True, True],
    inplace=True)
df.drop('Tm_Rank', 1, inplace=True)
print(df)
sorting by a custom list in pandas