When I append elements to a list that have the following format and type:
data.append([float, float, string])
Then stack the list using:
data = np.hstack(data)
And then finally reshape the array and transpose using:
data = np.reshape(data,(-1,3)).T
All the array elements in data are changed to strings. I want (and expected) the first and second columns in data to be of type float and the third of type string, but instead they are all of type string. [Interestingly, if I do not append the string elements to data and adjust the newshape to (-1,2), both columns are floats.] I cannot figure this one out. Any help would be appreciated.