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.
The Cumulative Distribution Function (CDF) plot is a lin-lin plot with data overlay and confidence limits. It shows the cumulative density of any data set over time (i.e., Probability vs. size).
How to Plot a Distribution Plot with Seaborn? Seaborn has different types of distribution plots that you might want to use. These plot types are: KDE Plots ( kdeplot() ), and Histogram Plots ( histplot() ). Both of these can be achieved through the generic displot() function, or through their respective functions.
An ECDF represents the proportion or count of observations falling below each unique value in a dataset. Compared to a histogram or density plot, it has the advantage that each observation is visualized directly, meaning that there are no binning or smoothing parameters that need to be adjusted.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With