(self)
| 1179 | assert_equal(np.conjugate(x), conjugate(xm)) |
| 1180 | |
| 1181 | def test_count_func(self): |
| 1182 | # Tests count |
| 1183 | assert_equal(1, count(1)) |
| 1184 | assert_equal(0, array(1, mask=[1])) |
| 1185 | |
| 1186 | ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0]) |
| 1187 | res = count(ott) |
| 1188 | assert_(res.dtype.type is np.intp) |
| 1189 | assert_equal(3, res) |
| 1190 | |
| 1191 | ott = ott.reshape((2, 2)) |
| 1192 | res = count(ott) |
| 1193 | assert_(res.dtype.type is np.intp) |
| 1194 | assert_equal(3, res) |
| 1195 | res = count(ott, 0) |
| 1196 | assert_(isinstance(res, ndarray)) |
| 1197 | assert_equal([1, 2], res) |
| 1198 | assert_(getmask(res) is nomask) |
| 1199 | |
| 1200 | ott = array([0., 1., 2., 3.]) |
| 1201 | res = count(ott, 0) |
| 1202 | assert_(isinstance(res, ndarray)) |
| 1203 | assert_(res.dtype.type is np.intp) |
| 1204 | assert_raises(np.AxisError, ott.count, axis=1) |
| 1205 | |
| 1206 | def test_count_on_python_builtins(self): |
| 1207 | # Tests count works on python builtins (issue#8019) |
nothing calls this directly
no test coverage detected