smash-transport/sparkx

Add weights parameter to add_value function in Histogram

Hendrik1704 opened this issue · 1 comments

I had the idea that it might be useful to have an optional weight parameter associated to the add_value function in the Histogram class.
Depending on the input, one would either have a single value as a weight or, if the input is a list of values, a list of weights.
Currently, this is not possible or only if one generates a histogram for each value and then performs a weighted average over the histograms. I think it's a useful thing to add, and it is also one functionality in the NumPy histogram.

@NGoetz, @nilssass, What do you think?

Done in PR #202