You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to create histograms and be able to access their sum of weights squared. When using WeightedMean storage sum_of_weights_squared just returns the number of entries, not the sum of weights squared. The same issue is true for sum_of_weights (it returns the counts instead again), but this is a smaller issue for me.
I could in principle retrieve the correct sum of weights squared if I used accumulators instead of histograms. However, for the purpose of my data analysis, this would slow down the code a lot and I would need to replicate the large nested structure of the histograms into accumulators. So I would much prefer to just use histograms, if this bug can be fixed.
To test:
importboost_histogramasbhh=bh.Histogram(bh.axis.Regular(1, 0, 2), storage=bh.storage.WeightedMean()) # Double() is the defaulth.fill([1]*3, sample=[2]*3)
h.view().sum_of_weights_squared
The last line returns
array([3.])
while the sum of weights squared is actually 12.
I am using python 3.8.
Attaching a screenshot of my notebook.
The text was updated successfully, but these errors were encountered:
I want to create histograms and be able to access their sum of weights squared. When using WeightedMean storage sum_of_weights_squared just returns the number of entries, not the sum of weights squared. The same issue is true for sum_of_weights (it returns the counts instead again), but this is a smaller issue for me.
I could in principle retrieve the correct sum of weights squared if I used accumulators instead of histograms. However, for the purpose of my data analysis, this would slow down the code a lot and I would need to replicate the large nested structure of the histograms into accumulators. So I would much prefer to just use histograms, if this bug can be fixed.
To test:
The last line returns
while the sum of weights squared is actually
12
.I am using python 3.8.
Attaching a screenshot of my notebook.
The text was updated successfully, but these errors were encountered: