NCAS-CMS / cf-python

A CF-compliant Earth Science data analysis library
http://ncas-cms.github.io/cf-python
MIT License
119 stars 19 forks source link

normalisation of `cf.histogram` #794

Open JonathanGregory opened 2 months ago

JonathanGregory commented 2 months ago

It would be convenient if cf.histogram had options to normalise the result by (a) dividing by the total of counts, giving probability in each bin, or (b) also dividing by the width of each bin, giving the probability density function. Please excuse me if I have overlooked an existing method for this.

davidhassell commented 1 month ago

Dear Jonathan,

As we discussed offline, this is good idea, and is easy to implement. I shall add create a PR shortly.

JonathanGregory commented 1 month ago

Thank you!