so when I use the savemat command it tends to overwrite the file. Is there a possible way to append instead of overwriting? I know a work-around would be to put everything i
Another option if you need to append huge data is the next:
self.upload1 = sio.loadmat(self.namedir,self.params)
sio.savemat('params_lo.mat', self.upload1)
With this form you load the data and add the new variables. Be careful because if they have the same name it doesn't change its values. So in order to correct this I delete all the variables that I want to change.
self.upload = sio.loadmat(self.namedir)
for i in self.str_vars:
try:
del self.upload[i]
except:
continue
sio.savemat('params_lo.mat', self.upload)
self.upload1 = sio.loadmat(self.namedir,self.params)
sio.savemat('params_lo.mat', self.upload1)