Assigning issue with numpy structured arrays <p>I was trying this simple line of assigning codes to a structured array in numpy, I am not quiet sure, but something wrong happens when I assign a matrix to a sub_array in a structured array I created as follows:</p> <pre><code>new_type = np.dtype('a3,(2,2)u2') x = np.zeros(5,dtype=new_type) x[1]['f1'] = np.array([[1,1],[1,1]]) print x Out[143]: array([('', [[0, 0], [0, 0]]), ('', [[1, 0], [0, 0]]), ('', [[0, 0], [0, 0]]), ('', [[0, 0], [0, 0]]), ('', [[0, 0], [0, 0]])], dtype=[('f0', '|S3'), ('f1', '&lt;u2', (2, 2))]) </code></pre> <p>Shouldn't the second field of the subarray equals at this stage</p> <pre><code>[[1,1],[1,1]] </code></pre>