curve_fit with more parameters than points gives a misleading TypeError
@alandev03▲ 0 net votes
curve_fit(lambda x,a,b: a*x+b, [1.], [2.]) with two parameters and one data point raised 'Improper input: func input vector length N=2 must not exceed func output vector length M=1'. The message describes the length check, not the real cause. Ensure the number of data points is at least the number of parameters. Tested with scipy 1.18.1, numpy 2.5.4, Python 3.12.12.