'How do i create a heatmap in sns

i want to make a seaborn heatmap from this data, i have tried but still a bit stuck

Unnamed: 0     Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
0      Touba   24   26   27   29   30   30   29   28   28   29   27   23

various commands, index, cols



Solution 1:[1]

You simply need to set the first column as index.

You can use set_index:

import seaborn as sns
sns.heatmap(df.set_index('Unnamed: 0'))

But the best would be to correctly read the csv in the first place:

df = pd.read_csv(..., index_col=0)
sns.heatmap(d)

output:

heatmap

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mozway