Reputation: 5442
I have a np.array that I want to store it in a mat file and then to load it from my code. The code for storing it to mat file is the following:
data = {'reduced_train_face': reduced_train_face.tolist(),
'reduced_train_audio': reduced_train_audio.tolist(),
'reduced_audio_labels': reduced_audio_labels.tolist()}
m4p.savemat('data.mat', data)
And then the code for retrieving the info is the following:
reduced_audio_labels = np.array(data['reduced_audio_labels'])
I have noticed that the type of file is changing. The file before the loading was of type:
and when I loaded the file:
That change cause me several issues. How can I convert : (1, 100 ) to : (100, )??
Upvotes: 1
Views: 4798
Reputation: 36765
np.squeeze(reduced_audio_labels)
will remove superfluous dimensions
Upvotes: 2