-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Description
I got a weird output from the following script:
import numpy as np
U = np.zeros(1, dtype=[('x', np.float32, (4,4))])
# Problematic
U[0] = np.eye(4)
print U[0]
# Works as expected
U[0] = np.eye(4, dtype=np.float32)
U['x'][0] = np.eye(4)
Output:
([[0.0, 1.875, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.875], [0.0, 0.0, 0.0, 0.0]],)
Tested on numpy 1.7.1, confirmed on 1.6.0.
As noted by Chirs Barker on the mailing list, U is a rank-zero array, not a 4X4 array.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels