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

Method test_testTakeTransposeInnerOuter

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

Source from the content-addressed store, hash-verified

476 assert_(maximum.reduce(x) == 4)
477
478 def test_testTakeTransposeInnerOuter(self):
479 # Test of take, transpose, inner, outer products
480 x = arange(24)
481 y = np.arange(24)
482 x[5:6] = masked
483 x = x.reshape(2, 3, 4)
484 y = y.reshape(2, 3, 4)
485 assert_(eq(np.transpose(y, (2, 0, 1)), transpose(x, (2, 0, 1))))
486 assert_(eq(np.take(y, (2, 0, 1), 1), take(x, (2, 0, 1), 1)))
487 assert_(eq(np.inner(filled(x, 0), filled(y, 0)),
488 inner(x, y)))
489 assert_(eq(np.outer(filled(x, 0), filled(y, 0)),
490 outer(x, y)))
491 y = array(['abc', 1, 'def', 2, 3], object)
492 y[2] = masked
493 t = take(y, [0, 3, 4])
494 assert_(t[0] == 'abc')
495 assert_(t[1] == 2)
496 assert_(t[2] == 3)
497
498 def test_testInplace(self):
499 # Test of inplace operations and rich comparisons

Callers

nothing calls this directly

Calls 12

assert_Function · 0.90
transposeFunction · 0.90
takeFunction · 0.90
filledFunction · 0.90
innerFunction · 0.90
outerFunction · 0.90
arrayFunction · 0.90
arangeFunction · 0.85
eqFunction · 0.85
reshapeMethod · 0.80
takeMethod · 0.80
outerMethod · 0.45

Tested by

no test coverage detected