Skip to content

Blinding #506

Answered by nsmith-
rkansal47 asked this question in Q&A
Apr 15, 2021 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

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)

producing

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()

producing

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@nsmith-
Comment options

@lgray
Comment options

Comment options

You must be logged in to vote
1 reply
@nsmith-
Comment options

Answer selected by lgray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants