Hello all,
So i'm using numpy 1.6.0, and trying to convert a (4,4) numpy array of dtype 'f8' into a record array of this dtype:
dt = np.dtype([('mat','(4,4)f8')])
Here is the code snippet:
In [21]: a = np.random.randn(4,4)
In [22]: a.view(dt)
and the resulting error:
ValueError: new type not compatible with array.
Can anyone shed some light for me on why this conversion is not possible? It is certainly technically possible, since the memory layout of the two arrays should be the same.
Can anyone recommend a better way to do this conversion?
Thanks in advance!
-Bryce Ready