Fitting Two Different Functions Python