Python Peak Fitting Matlab For Loop