Seaborn showing scientific notation in heatmap for 3-digit numbers

前端 未结 1 1072
刺人心
刺人心 2020-12-07 14:50

I\'m creating a heatmap from a pandas pivot_table as below:

table2 = pd.pivot_table(df,values=\'control\',columns=\'Year\',index=\'Region\',aggfunc=np.sum)
s         


        
相关标签:
1条回答
  • 2020-12-07 14:59

    According to the docs, the param fmt=.2g is being applied because you've set annot=True so you can modify the format being applied to:

    sns.heatmap(table2,annot=True,cmap='Blues', fmt='g')
    
    0 讨论(0)
提交回复
热议问题