I want to create an array with 3 columns. The first one a string, the other two integers used for calculations. Then more rows will be added through the append function (below).
To have such a mixed datatype data, we could use object
as dtype before appending or stacking -
a = np.array([["String",1,2]], dtype=object)
b = [["another string", 3, 4]]
a = np.vstack((a,np.asarray(b,object)))
Sample run -
In [40]: a = np.array([["String",1,2]], dtype=object)
In [41]: b = [["another string", 3, 4]]
In [42]: np.vstack((a,np.asarray(b,object)))
Out[42]:
array([['String', 1, 2],
['another string', 3, 4]], dtype=object)