Multiplying each element from a list by a scalar
<p>I have to prepare my data for animation and I ran across a problem</p>

<pre><code>t = numpy.linspace(0, 1/10, 1/10000)
x = [1, 3, 5, 7, 9]
S = [ 0.09642699 -1.75110819 -0.00915477 -0.42833324 -0.01772692 -0.00885592
 -0.01136874  0.4106214   0.09199903  1.73339635]
realResponse = [x * numpy.cos(311.64*t) for x in numpy.dot(eigenvector, modalconstant)]
#realResponse = numpy.delete(realResponse, my_list, axis=0)
</code></pre>

<p>Now this <code>realResponse</code> list turns out to be... well.. nothing</p>

<pre><code>    print(realResponse)# prints: [array([], dtype=float64), 
                                  array([], dtype=float64), array([], dtype=float64),....
</code></pre>

<p>I don't know what seems to be the problem. I carefully followed <a href="https://stackoverflow.com/questions/8194959/in-python-how-will-you-multiply-individual-elements-of-an-array-with-a-floating">this topic.</a></p>

<p>Anyway I also tried</p>

<pre><code>realResponse = list()
for i in range(0, 10):
    realResponse[i] = S[i] * numpy.cos(eigenvalue[311.64*t)
</code></pre>

<p>and turns out to be an error:</p>

<blockquote>
  <p>IndexError: list assignment index out of range</p>
</blockquote>