# AttributeError: 'function' object has no attribute 'quad' in Python

from scipy import linalg from scipy.integrate import quad import numpy as np a = integrate.quad(lambda x: x**2, 0, 4.5) print(a)

AttributeError Traceback (most recent call last) <ipython-input-132-c7f6592004af> in <module>() 2 from scipy.integrate import quad 3 import numpy as np ----> 4 a = integrate.quad(lambda x: x**2, 0, 4.5) 5 6 AttributeError: 'function' object has no attribute 'quad'

I have no idea what happen, anyone could help me? Thanks!

## Answers

The code imports quad; You don't need to qualify it:

from scipy.integrate import quad # <---- .... a = quad(lambda x: x**2, 0, 4.5)