Skip to content

Commit 6cc08be

Browse files
committed
ENH, TST: use builtin float to avoid deprecated warnings and add tests for dtype
1 parent ffb765c commit 6cc08be

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

quantecon/ecdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ def __call__(self, x):
5151
def f(a):
5252
return np.mean(self.observations <= a)
5353
vf = np.frompyfunc(f, 1, 1)
54-
return vf(x).astype(np.float)
54+
return vf(x).astype(float)

quantecon/tests/test_ecdf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ def test_ascending(self):
3434
def test_vectorized(self):
3535
"ecdf: testing vectorized __call__ method"
3636
t = np.linspace(-1, 1, 100)
37-
self.assertEqual(t.shape, self.ecdf(t).shape)
37+
e = self.ecdf(t)
38+
self.assertEqual(t.shape, e.shape)
39+
self.assertEqual(e.dtype, float)
3840
t = np.linspace(-1, 1, 100).reshape(2, 2, 25)
39-
self.assertEqual(t.shape, self.ecdf(t).shape)
41+
e = self.ecdf(t)
42+
self.assertEqual(t.shape, e.shape)
43+
self.assertEqual(e.dtype, float)

0 commit comments

Comments
 (0)