Assign value to array in dictionary: 'numpy.float64' object does not support item assignment
<p>I have several images stored as <code>np.arrays</code> in a dictionary.</p>

<p>I want to change the value <code>stackOfImages[1][i][j] = 0</code> if it is > <code>0.01</code>. </p>

<p>My code:</p>

<pre><code>for i in range(1392):
  for j in range(891):
    if diffImage[1][i][j] &gt; 0.01:
      diffImageMod[1][i][j] = 0
</code></pre>

<p>This returns:</p>

<pre><code>Traceback (most recent call last):
 File "Subtract-Frames.py", line 54, in &lt;module&gt;
   diffImageMod[1][i][j] = 0
     TypeError: 'numpy.float64' object does not support item assignment
</code></pre>

<p>What do I have to set the naughty values bigger than <code>0.01</code> to zero? I would like to keep the dict data type for the stack of images <code>diffImageMod</code>.
Am using Python 2.7.12</p>