(self)
| 758 | assert_array_equal(diff(x, n=2, axis=0), out4) |
| 759 | |
| 760 | def test_n(self): |
| 761 | x = list(range(3)) |
| 762 | assert_raises(ValueError, diff, x, n=-1) |
| 763 | output = [diff(x, n=n) for n in range(1, 5)] |
| 764 | expected = [[1, 1], [0], [], []] |
| 765 | assert_(diff(x, n=0) is x) |
| 766 | for n, (expected, out) in enumerate(zip(expected, output), start=1): |
| 767 | assert_(type(out) is np.ndarray) |
| 768 | assert_array_equal(out, expected) |
| 769 | assert_equal(out.dtype, np.int_) |
| 770 | assert_equal(len(out), max(0, len(x) - n)) |
| 771 | |
| 772 | def test_times(self): |
| 773 | x = np.arange('1066-10-13', '1066-10-16', dtype=np.datetime64) |
nothing calls this directly
no test coverage detected