Helper function for assignment from other structured arrays

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Helper function for assignment from other structured arrays

Feng Yu
Hi,

Assignment between structured arrays are matching by the order of fields, not by names of fields.

Is there a recommended way of assignment by matching field names? I can see one way is to explicitly looping over the names; another possibility is to use the field names of the target array to index the source array.

It would be nice if a recommended practice is provided as example near the documentation on the topic: https://docs.scipy.org/doc/numpy/user/basics.rec.html#assignment-from-other-structured-arrays

Thanks,

Yu

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion