How to force min and max value range when styling a dataframe column ?
Example :
df = pd.DataFrame(columns = ['column'], data = [-1, 0, 1, 2])
df.style.background_gradient(cmap='coolwarm_r')
This produces a column where value 0 is red ; however I would like 0 to be white, i.e. the middle of the 'coolwarm' colormap.
In this example, my understanding of the problem is that the default colormap interval maps my data [-1 : 2].
I would like to set it to [-2 : 2]