Created
March 23, 2018 10:18
-
-
Save srdg/69d436f90be7d042d4abade086065050 to your computer and use it in GitHub Desktop.
Convert .mat files to .csv files instantly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.io | |
data = scipy.io.loadmat("filename.mat") # Enter your filename here | |
for i in data: | |
if '__' not in i and 'readme' not in i: | |
fp = open(i+".csv","w+") # numpy.savetext does not create files automatically | |
np.savetxt((i+".csv"),data[i],delimiter=',') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment