How does one assign to numpy structured arrays?
import numpy as np
baz_dtype = np.dtype([("baz1", "str"),
("baz2", "uint16"),
("baz3", np.float32)])
dtype = np.dtype([("foo", "str"),
("bar", "uint16"),
("baz", baz_dtype)])
xx = np.zeros(2, dtype=dtype)
xx["foo"][0] = "A"
Here xx remains unchanged. The docs https://docs.scipy.org/doc/numpy/user/basics.rec.html are a little vague on this.
On a related note, is it possible to make one or more of the subtypes be lists or numpy arrays of the specified dtype?
Any tips welcome.