(Warning - I am a newbie)
I imported mat files using scipy.io:
data = spio.loadmat('data.mat', struct_as_record=True, squeeze_me=True)
data = data['b']
>>> <type 'numpy.void'>
Which gave me a file that is of type numpy.void. Each line has 17 entries that are types string, float, array
print(data.shape)
>>> (11000,)
I have another list of strings which I converted to a numpy.array:
filenames = np.array([filenames])
filenames = np.ndarray.flatten(filenames)
print (filenames.shape)
>>> (11000,)
print(data.dtype)
print(filenames.dtype)
>>> [('fieldname1', 'O'), ('fieldname2', 'O'), ('fieldname3', 'O'), ('fieldname4', 'O'), ('fieldname5', 'O'), ('fieldname6', 'O'), ('fieldname7', 'O'), ('fieldname8', 'O'), ('fieldname9', 'O'), ('fieldname10', 'O'), ('fieldname11', 'O'), ('fieldname12', 'O'), ('fieldname13', 'O'), ('fieldname14', 'O'), ('fieldname15', 'O'), ('fieldname16', 'O'), ('fieldname17', 'O')]
>>> |S16
I want to concatenate these along a column:
NEW = np.concatenate((data, filenames), axis=1)
But I am getting this error:
>>> TypeError: invalid type promotion
Any help would be very much appreciated.