Closed Wongboo closed 3 months ago
Cannot plot certain data with kdeplot, warning that dataset has 0 variance which is not.
/gpfs/share/code/pku_env/micromamba/envs/pytorch_cpu/lib/python3.12/site-packages/pandas/core/nanops.py:1016: RuntimeWarning: invalid value encountered in subtract sqr = _ensure_numeric((avg - values) ** 2) <ipython-input-20-d1f90ecbf4e4>:1: UserWarning: Dataset has 0 variance; skipping density estimate. Pass `warn_singular=False` to disable this warning. sns.kdeplot(s, bw_adjust=.25, log_scale=True)
Checking dataset
In [32]: print(s.mean(), s.std(), s.max(), s.min()) 7.094745e-11 2.368824e-10 1.5460646e-08 0.0
disable log_scale or use a fraction of sample such as s[10000:] does no help. dataset npy zipped file exp2.zip
log_scale
s[10000:]
Variance may not be literally zero while still close enough for density estimation to fail. You could try changing the scale of your data perhaps.
Cannot plot certain data with kdeplot, warning that dataset has 0 variance which is not.
Checking dataset
disable
log_scale
or use a fraction of sample such ass[10000:]
does no help. dataset npy zipped file exp2.zip