0

Win 10, Python 3.7, Scipy 1.3.2, Anaconda

I was looking at this question on here.

I tried out the code in the answer,

import numpy as np
from scipy import integrate
from scipy.special import erf
from scipy.special import j0
import quadpy

q = np.linspace(0.03, 1.0, 500)


def f(t):
    return t * 0.5 * (erf((t - 40) / 3) - 1) * j0(np.multiply.outer(q, t))


y, _ = integrate.quad_vec(f, 0, 50)
y1, _ = quadpy.quad(f, 0, 50)

print(y - y1)

but got the following error...

  File "D:/Python codes/temp.py", line 14, in <module>
    y, _ = integrate.quad_vec(f, 0, 50)

AttributeError: module 'scipy.integrate' has no attribute 'quad_vec'

Given that neither to questioner or answerer encountered this problem what could be causing it on my system?

DrBwts
  • 3,470
  • 6
  • 38
  • 62

1 Answers1

2

According to the release notes, scipy.integrate.quad_vec was released with scipy version 1.4.0. Thus you need to upgrade your scipy.

joni
  • 6,840
  • 2
  • 13
  • 20