Skip to content

RuntimeWarning: divide by zero encountered in true_divide & invalid value encountered in multiply #3

@rraadd88

Description

@rraadd88

Hi @BenjaminDoran ,
I find unidip very helpful in identifying unimodal distributions. Thanks for the development of this package!

Regarding the warning I get, this happens when I run dip.diptst

/python3.6/site-packages/unidip/dip.py:27: RuntimeWarning: divide by zero encountered in true_divide
  slopes = (work_cdf[1:] - work_cdf[0]) / distances
/python3.6/site-packages/unidip/dip.py:30: RuntimeWarning: invalid value encountered in multiply
  gcm.extend(work_cdf[0] + distances[:minslope_idx] * minslope)

After the warning, the process stalls for a very long time.
Looking at the values, I couldn't pinpoint the reason why this is happening. Any suggestions?
I wonder how I could avoid this warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions