Skip to content

Instantly share code, notes, and snippets.

@sjqtentacles
Created September 13, 2015 23:32
Show Gist options
  • Save sjqtentacles/bc2f69b0c4430211bcad to your computer and use it in GitHub Desktop.
Save sjqtentacles/bc2f69b0c4430211bcad 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=',')
@mounareddy2023
Copy link

TypeError: Mismatch between array dtype ('[('cycle', 'O')]') and format specifier ('%.18e')

@sjqtentacles
Copy link
Author

yeah this code worked on my macbook 4 years ago, idk if it still does ...

wow I was a shitty programmer back then

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