(self)
| 1300 | assert np.sqrt(np.ma.masked) is np.ma.masked |
| 1301 | |
| 1302 | def test_count_func(self): |
| 1303 | # Tests count |
| 1304 | assert_equal(1, count(1)) |
| 1305 | assert_equal(0, array(1, mask=[1])) |
| 1306 | |
| 1307 | ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0]) |
| 1308 | res = count(ott) |
| 1309 | assert_(res.dtype.type is np.intp) |
| 1310 | assert_equal(3, res) |
| 1311 | |
| 1312 | ott = ott.reshape((2, 2)) |
| 1313 | res = count(ott) |
| 1314 | assert_(res.dtype.type is np.intp) |
| 1315 | assert_equal(3, res) |
| 1316 | res = count(ott, 0) |
| 1317 | assert_(isinstance(res, ndarray)) |
| 1318 | assert_equal([1, 2], res) |
| 1319 | assert_(getmask(res) is nomask) |
| 1320 | |
| 1321 | ott = array([0., 1., 2., 3.]) |
| 1322 | res = count(ott, 0) |
| 1323 | assert_(isinstance(res, ndarray)) |
| 1324 | assert_(res.dtype.type is np.intp) |
| 1325 | assert_raises(AxisError, ott.count, axis=1) |
| 1326 | |
| 1327 | def test_count_on_python_builtins(self): |
| 1328 | # Tests count works on python builtins (issue#8019) |
nothing calls this directly
no test coverage detected