You can also do this if you want to play with pandas. However, I love the Punchagan way.
# replicating your dataframe lake = pd.DataFrame({'co tp': ['DE Lake', 'Forest', 'FR Lake', 'Forest'], 'area': [10, 20, 30, 40], 'count': [7, 5, 2, 3]}) lake.set_index('co tp', inplace=True)
SammyRod Nov 13 '18 at 23:46 2018-11-13 23:46
source share