How to set bounds for only one parameter
问题 I'm using curve_fit from scipy.optimize to fit my data. I have a function that fits three parameters (Z1, Z2, Z3). I wannt to provide bounds. However, I'd like to only provide a bound to Z2 (Z2 shall be below 40). I do not want to set bounds for Z1 and Z3. Is that possible? popt, pcov = curve_fit(func, xdata, ydata, p0 = [Z1, Z2, Z3], bounds = ((10, 20, 5), (100, 50, 100,))) # This way I provide bounds to Z1, Z2 and Z3 # I, however, only want to say that Z2 < 40 # Also interesting would be to