MCPcopy Create free account
hub / github.com/numpy/numpy / test_xtestCount

Method test_xtestCount

numpy/ma/tests/test_old_ma.py:162–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 assert_(eq(np.concatenate((x, y, x)), concatenate((x, ym, x))))
161
162 def test_xtestCount(self):
163 # Test count
164 ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
165 assert_(count(ott).dtype.type is np.intp)
166 assert_equal(3, count(ott))
167 assert_equal(1, count(1))
168 assert_(eq(0, array(1, mask=[1])))
169 ott = ott.reshape((2, 2))
170 assert_(count(ott).dtype.type is np.intp)
171 assert_(isinstance(count(ott, 0), np.ndarray))
172 assert_(count(ott).dtype.type is np.intp)
173 assert_(eq(3, count(ott)))
174 assert_(getmask(count(ott, 0)) is nomask)
175 assert_(eq([1, 2], count(ott, 0)))
176
177 def test_testMinMax(self):
178 # Test minimum and maximum.

Callers

nothing calls this directly

Calls 7

arrayFunction · 0.90
assert_Function · 0.90
assert_equalFunction · 0.90
getmaskFunction · 0.90
countFunction · 0.85
eqFunction · 0.85
reshapeMethod · 0.80

Tested by

no test coverage detected