Skip to content

Commit 3ab1ac0

Browse files
committed
ENH: fix vectorization using frompyfunc
1 parent 22d7f58 commit 3ab1ac0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

quantecon/ecdf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def __call__(self, x):
4848
Fraction of the sample less than x
4949
5050
"""
51-
f = lambda a, b: a <= b
52-
vf = np.vectorize(f)
53-
return np.mean(vf(self.observations, x))
51+
def f(a):
52+
return np.mean(self.observations <= a)
53+
vf = np.frompyfunc(f, 1, 1)
54+
return vf(x)

0 commit comments

Comments
 (0)