Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'module' object has no attribute 'corrplot'

Tags:

python

seaborn

import seaborn as sns
import matplotlib.pyplot as plt

sns.corrplot(rets,annot=False,diag_names=False)

I get this error after I call the function above...don't know whats going on

AttributeError                            Traceback (most recent call last)
<ipython-input-32-33914bef0513> in <module>()
----> 1 sns.corrplot(rets,annot=False,diag_names=False)

AttributeError: 'module' object has no attribute 'corrplot'
like image 622
sambeth Avatar asked Oct 15 '16 13:10

sambeth


2 Answers

The corrplot function was deprecated in seaborn version v0.6: https://seaborn.github.io/whatsnew.html#other-additions-and-changes:

The corrplot() and underlying symmatplot() functions have been deprecated in favor of heatmap(), which is much more flexible and robust. These two functions are still available in version 0.6, but they will be removed in a future version.

Note that the function actually still exists in the seaborn codebase, but you have to directly import it from seaborn.linearmodels and you will get a warning that it is subject to removal in a future release.

like image 87
mwaskom Avatar answered Oct 01 '22 17:10

mwaskom


Import using the command for corrplot and symmatplot

from seaborn.linearmodels import corrplot,symmatplot
like image 35
Ravi.Dudi Avatar answered Oct 01 '22 17:10

Ravi.Dudi