You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assiging to structured array rows with list/array fails (Trac #1758) #2353
Assigning to a structured array with a tuple works, with a list results in an error. Would be good if this could be made to work (this is an enhancement request). With an array gives no warning or exception, but results in garbage. This is a bug.
For the array assignment part, it does work when no casting has to be done. From Skipper on-list:
This is a casting issue. Your array is an integer array. You can
assign with an array.
arr = np.zeros((5,), dtype=[('var1','f8'),('var2','f8')])
arr[0] = np.array([10.0,20])
arr[0]
(10.0, 20.0)
Still a bug, since casting elements of a tuple works fine.
Activity
numpy-gitbot commentedon Oct 19, 2012
@rgommers wrote on 2011-03-09
For the array assignment part, it does work when no casting has to be done. From Skipper on-list:
Still a bug, since casting elements of a tuple works fine.
charris commentedon Feb 20, 2014
Still fails 1.9-devel.
MAINT: improve struct assignment, allow multi fields views
MAINT: improve struct assignment, allow multi fields views