TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe' while plotting a seaborn.regplot

Update: this bug is solved in Seaborn version 0.10.1 (April 2020).

I encountered the same problem. It is issue 1950 at Seaborn's github. Related to running a 32-bit version of numpy. It will be solved in the next release.

To work around the problem, I changed line 84 of my local version of Seaborn's algorithm.py:

resampler = integers(0, n, n, dtype=np.int_)

This happened with:

  • numpy version: 1.18.1

  • seaborn version: 0.10.0

I had this issue from my machine too!!

I've tried modifying the Seaborn's algorithm.py code as mentioned as JohanC mentioned, but It didn't work...

The I realized that my python version was 32-bit, so I installed a newer python 64-bit version and run the same code.

The version I downloaded and installed was 64-bit (3.8.2) of this link.

That made my python run the script without problems!!