(self)
| 893 | assert_array_equal(diff(x, n=2, axis=0), out4) |
| 894 | |
| 895 | def test_n(self): |
| 896 | x = list(range(3)) |
| 897 | assert_raises(ValueError, diff, x, n=-1) |
| 898 | output = [diff(x, n=n) for n in range(1, 5)] |
| 899 | expected = [[1, 1], [0], [], []] |
| 900 | assert_(diff(x, n=0) is x) |
| 901 | for n, (expected_n, output_n) in enumerate(zip(expected, output), start=1): |
| 902 | assert_(type(output_n) is np.ndarray) |
| 903 | assert_array_equal(output_n, expected_n) |
| 904 | assert_equal(output_n.dtype, np.int_) |
| 905 | assert_equal(len(output_n), max(0, len(x) - n)) |
| 906 | |
| 907 | def test_times(self): |
| 908 | x = np.arange('1066-10-13', '1066-10-16', dtype=np.datetime64) |
nothing calls this directly
no test coverage detected