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

Method test_testArrayMethods

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

Source from the content-addressed store, hash-verified

665 assert_equal(str(xm), str(masked_print_option))
666
667 def test_testArrayMethods(self):
668 a = array([1, 3, 2])
669 assert_(eq(a.any(), a._data.any()))
670 assert_(eq(a.all(), a._data.all()))
671 assert_(eq(a.argmax(), a._data.argmax()))
672 assert_(eq(a.argmin(), a._data.argmin()))
673 assert_(eq(a.choose(0, 1, 2, 3, 4),
674 a._data.choose(0, 1, 2, 3, 4)))
675 assert_(eq(a.compress([1, 0, 1]), a._data.compress([1, 0, 1])))
676 assert_(eq(a.conj(), a._data.conj()))
677 assert_(eq(a.conjugate(), a._data.conjugate()))
678 m = array([[1, 2], [3, 4]])
679 assert_(eq(m.diagonal(), m._data.diagonal()))
680 assert_(eq(a.sum(), a._data.sum()))
681 assert_(eq(a.take([1, 2]), a._data.take([1, 2])))
682 assert_(eq(m.transpose(), m._data.transpose()))
683
684 def test_testArrayAttributes(self):
685 a = array([1, 3, 2])

Callers

nothing calls this directly

Calls 11

arrayFunction · 0.90
assert_Function · 0.90
eqFunction · 0.85
compressMethod · 0.80
conjugateMethod · 0.80
takeMethod · 0.80
anyMethod · 0.45
allMethod · 0.45
argmaxMethod · 0.45
argminMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected