[Numpy-discussion] Can't set an element of a subset of an array, , ,
Tue Dec 8 18:52:26 CST 2009
> Okay, I'm stuck. Why doesn't this work?
> In : mask
> Out: array([False, False, False, ..., False, False, False], dtype=bool)
> In : mask[data['horizon']==i] = True
mask[data['horizon']==i] creates a copy. mask[data['horizon']==i]
assigns to the copy, which then gets thrown away.
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion