-
Hi, is there a recommended way of blinding histogram plots? i.e. is there a way to perhaps remove specific non-sparse bins, or set the values of specific bins to 0 after filling a histogram? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I think this can be achieved with a few lines, scale the histograms to zero. assuming you have a list of histograms, or a dict: raw_hists = {'hist1': stuff, 'hist2' ...}
blinded_hists = deepcopy(raw_hists)
for hist in blinded_hists:
hist.scale(0.)
# then go on to plot blinded_hists You could stick the above in a function, control it with a bool so you can unblind easily later. @nsmith- your thoughts? |
Beta Was this translation helpful? Give feedback.
-
With coffea hists: import coffea.hist
import numpy as np
h = coffea.hist.Hist("Events", coffea.hist.Bin("x", "axis", 10, 0, 1))
h.fill(x=np.random.normal(loc=0.5, scale=0.2, size=1000))
# blind bins 2 and 3
h.values()[()][2:4] = 0
coffea.hist.plot1d(h) With hist: import hist
import numpy as np
h = (
hist.Hist.new.Reg(10, 0, 1, name="x", label="axis")
.Weight()
.fill(x=np.random.normal(loc=0.5, scale=0.2, size=1000))
)
# blind bins 2 and 3
h.view().value[2:4] = 0
h.plot1d() |
Beta Was this translation helpful? Give feedback.
With coffea hists:
producing
With hist:
producing