import scipy.io as scio #load mat = scio.loadmat(MatPath) #save scio.savemat(MatPath, {'valname': val})