I am trying to convert a .mat file to csv using python. The code I am using is
import scipy.io
import numpy as np
data = scipy.io.loadmat("wiki.mat")
for i in data:
if '__' not in i and 'readme' not in i:
np.savetxt(("file.csv"),data[i],delimiter=',')
When ever I run this code, I get error as follows:
Traceback (most recent call last):
File "test.py", line 8, in <module>
np.savetxt(("file.csv"),data[i],delimiter=',')
File "/Library/Python/2.7/site-packages/numpy/lib/npyio.py", line 1258, in savetxt
% (str(X.dtype), format))
TypeError: Mismatch between array dtype ('[('dob', 'O'), ('photo_taken', 'O'), ('full_path', 'O'), ('gender', 'O'), ('name', 'O'), ('face_location', 'O'), ('face_score', 'O'), ('second_face_score', 'O')]') and format specifier ('%.18e')
I am trying to convert the .mat file from this link: https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/static/imdb_meta.tar
Please help me out with some working solution!