Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save animeshsrivastava24/2171278efd3e44e3d0ece85307e0ff26 to your computer and use it in GitHub Desktop.
Save animeshsrivastava24/2171278efd3e44e3d0ece85307e0ff26 to your computer and use it in GitHub Desktop.
Converting .mat to .csv using python
import scipy.io
import numpy as np
data = scipy.io.loadmat("subject.mat")
for i in data:
if '__' not in i and 'readme' not in i:
np.savetxt(("filesforyou/"+i+".csv"),data[i],delimiter=',')
@SlowMonk
Copy link

SlowMonk commented Apr 5, 2019

ValueError: Expected 1D or 2D array, got 3D array instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment