TypeError: only size-1 arrays can be converted to Python scalars when using trapz method

This is my python code import numpy as np from scipy.integrate import quad, trapz, simps import math def f(x): return math.exp(-(x**2/2))/math.sqrt(2*math.pi) result, error = quad(f, 0, np.inf) …