Seaborn showing scientific notation in heatmap for 3-digit numbers Seaborn showing scientific notation in heatmap for 3-digit numbers pandas pandas

Seaborn showing scientific notation in heatmap for 3-digit numbers


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')


According to the docs, the parameter fmt is set to .2g when annot=True. So, for example, if your data is float, you can use:

sns.heatmap(table2, annot=True, cmap='Blues', fmt='.3g')

By that, you're telling python to show 3 significant figures. To understand the "fmt" better, check out this answer: https://stackoverflow.com/a/65020192/4529605