Kenny
Kenny

Reputation: 1982

Custom binning boundary to approach Gaussian histogram

I'd like to compute custom bin edges so that the new histogram shape will approach Gaussian. Think of the shape you'll get after Box-Cox transformation, but I want to keep the original values.

These new bin edges will be fed into histplot or distplot in python. I've read of qcut but that will make the shape approaching uniform distribution.

Example in chart below :

  1. Bins could be 0-2, 2-30, 30-50, etc.
  2. Or keep 0 apart as it's outlier. Bins then could be 0, 1-10, 10-25, etc. How would you modify approach to skip 0 in the calculation of new bin edges ?

Surprisingly I have not been able to find a solution for python.

The closest question is in Matlab Specifying bin edges when fitting a normal distribution using histfit

enter image description here

Upvotes: 0

Views: 38

Answers (0)

Related Questions