Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when creating custom seaborn colormap

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!

like image 402
user356 Avatar asked Mar 12 '26 12:03

user356


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
like image 195
Zephyr Avatar answered Mar 14 '26 02:03

Zephyr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!