sambeth
sambeth

Reputation: 1600

'module' object has no attribute 'corrplot'

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'

Upvotes: 9

Views: 10952

Answers (3)

Gomez NL
Gomez NL

Reputation: 942

corrplot or symmatplot has been deprecated in favor of heatmap .

#Example usage
>>> import numpy as np; np.random.seed(0)
>>> import seaborn as sns; sns.set()
>>> data = np.random.rand(10, 12)
>>> ax = sns.heatmap(data)

Check this for more about heatmap: http://seaborn.pydata.org/generated/seaborn.heatmap.html#seaborn.heatmap

Upvotes: 1

Ravi.Dudi
Ravi.Dudi

Reputation: 1364

Import using the command for corrplot and symmatplot

from seaborn.linearmodels import corrplot,symmatplot

Upvotes: 2

mwaskom
mwaskom

Reputation: 49002

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.

Upvotes: 8

Related Questions