Skip to content

Commit 22d7f58

Browse files
committed
ENH: vectorize __call__ function
1 parent 5be42da commit 22d7f58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quantecon/ecdf.py

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

0 commit comments

Comments
 (0)