Error when creating custom seaborn colormap

Viewed 1219

I'm trying to create my own colormap object for a seaborn heatmap.

But when I type in:

import seaborn as sns
new_map = sns.diverging_palette(220, 10, as_cmap=True)

I get the following error:

TypeError: 'float' object cannot be interpreted as an integer

What am I doing wrong?

Thanks in advance!

1 Answers

According to this issue, it is a bug which you can solve by downgrading numpy to a version prior to 1.18:

pip install numpy==1.17.4

or upgrade seaborn to a version newer than 0.9.1:

pip install seaborn==1.10.0
Related