Add and access object-type field of a numpy structured array
I am using numpy 1.16.2. In brief, I am wondering how to add an object-type field to a structured array. The standard way via the recfunctions module throws an error and I suppose there is a reason for this. Therefore, I wonder whether there is anything wrong with my workaround. Furthermore, I would like to understand why this workaround is necessary and whether I need to use extra caution when accessing the newly created array. Now here come the details: I have a numpy structured array: import numpy as np a = np.zeros(3, dtype={'names':['A','B','C'], 'formats':['int','int','float']}) for i in