1

When one category is composed of NANs (but other columns contain good data), pairplot fails:

For example, in the iris dataset, if all measurements of a certain species are missing measurements for "petal_width", pairplot fails. Bummer, because there are good measurements for sepal_length, etc. ! Just because one type of data is missing, doesn't mean the other kinds aren't useful to look at!

iris.loc[(iris.species=='setosa'), 'petal_width']=pd.np.nan

Gives the error:

ZeroDivisionError: 0.0 cannot be raised to a negative power

Any stragegies to fix?

Looked here, and here, without much illumination. Github indicates it's been fixed, but still getting the error in Seaborn 0.9.

https://github.com/mwaskom/seaborn/issues/1699

Seaborn pairplot error when dataset has NaN values

joelostblom
  • 43,590
  • 17
  • 150
  • 159
EHB
  • 1,127
  • 3
  • 13
  • 24

1 Answers1

1

The fix you are linking has been merged to the master and 0.9 branches on GitHub, but is not part of the released version of seaborn 0.9.0. It will likely be there in seaborn 0.9.1, which has not been released yet.

To access this functionality now, you can install the GitHub master branch version of seaborn, e.g. using pip:

pip install git+https://github.com/mwaskom/seaborn.git
joelostblom
  • 43,590
  • 17
  • 150
  • 159