简体   繁体   中英

How to use python's seaborn to plot CDF?

When I use the sns.kdeplot and let culmulative=True, the error is

Cumulative distributions are currentlyonly implemented in statsmodels.Please install statsmodels.

Even though I have already installed statsmodels.

From the source code , we can see that all Seaborn does is attempt to import

try:
    import statsmodels.nonparametric.api as smnp
    _has_statsmodels = True
except ImportError:
    _has_statsmodels = False

at a module level, and should _has_statsmodels be False , the _univariate_kdeplot function attempts to fall back on SciPy, which does not support cumulative distributions for this purpose.

So there is nothing murky happening in Seaborn here, you simply have an ImportError from an installation or setup issue regarding statsmodels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM