[Numpy-discussion] Re: Allow matrix multiplication in structured arrays

2025-06-17 Thread abel . gutierrez
Hi, Thanks for replying. I was using: ``` from numpy.lib import recfunctions as rfn xyz = rfn.structured_to_unstructured(atoms[["x", "y", "z"]]) xyz = xyz @ transform.T atoms[["x", "y", "z"]] = rfn.unstructured_to_structured( xyz, dtype=atoms[["x", "y", "z"]].dtype ) ``` But I think this is cr

[Numpy-discussion] Allow matrix multiplication in structured arrays

2025-06-13 Thread abel . gutierrez
I'm using structured arrays to store atoms data produced by LAMMPS (I'm using a structured array that follows its format). I need to rotate the positions: ``` import numpy as np transform = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=np.float64) dtype = np.dtype([("x", np.float64), ("y", n