MCPcopy
hub / github.com/numpy/numpy / test_testTakeTransposeInnerOuter

Method test_testTakeTransposeInnerOuter

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

Source from the content-addressed store, hash-verified

538 assert_(maximum.reduce(x) == 4)
539
540 def test_testTakeTransposeInnerOuter(self):
541 # Test of take, transpose, inner, outer products
542 x = arange(24)
543 y = np.arange(24)
544 x[5:6] = masked
545 x = x.reshape(2, 3, 4)
546 y = y.reshape(2, 3, 4)
547 assert_(eq(np.transpose(y, (2, 0, 1)), transpose(x, (2, 0, 1))))
548 assert_(eq(np.take(y, (2, 0, 1), 1), take(x, (2, 0, 1), 1)))
549 assert_(eq(np.inner(filled(x, 0), filled(y, 0)),
550 inner(x, y)))
551 assert_(eq(np.outer(filled(x, 0), filled(y, 0)),
552 outer(x, y)))
553 y = array(['abc', 1, 'def', 2, 3], object)
554 y[2] = masked
555 t = take(y, [0, 3, 4])
556 assert_(t[0] == 'abc')
557 assert_(t[1] == 2)
558 assert_(t[2] == 3)
559
560 def test_testInplace(self):
561 # 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
eqFunction · 0.85
reshapeMethod · 0.80
takeMethod · 0.80
innerMethod · 0.80
outerMethod · 0.45

Tested by

no test coverage detected