I am having trouble to fit experimental data to a complementary error function in Python 3.7.4. More precisely, I want to fit my data to the complementary error function consisting of the integrand function with the parameters a, b, c, and the cerf function doing the actual integration. The integration should go from x (the argument of the function) to
Tag: integration
TypeError: only size-1 arrays can be converted to Python scalars when using trapz method
This is my python code And am getting this error: Why is that so? Integration using quad method worked fine but not with trapz method Answer As a user commented, you can only use math functions with scalar values, for arrays you have to use math functions provided in NumPy library.