 <p>The ability to take the product of a scalar and an array is a feature of numpy arrays (see <a href="http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html" rel="nofollow">broadcasting</a>) but clearly not of Cython's memoryviews. The way this can be done is by looping over the chunk of memory and multiplying each entry with the desired value. Alternatively, just stick with numpy arrays.</p> <p>Example code: </p> <pre><code>cdef double[:, :] c = np.empty((1, 3)) cdef int i for i in range(3): c[0, i] = a[0, i] * a[0, i] * 0.5 </code></pre>