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

Method test_broadcasting

numpy/lib/tests/test_function_base.py:453–458  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

451 assert_equal(len(conditions), 3)
452
453 def test_broadcasting(self):
454 conditions = [np.array(True), np.array([False, True, False])]
455 choices = [1, np.arange(12).reshape(4, 3)]
456 assert_array_equal(select(conditions, choices), np.ones((4, 3)))
457 # default can broadcast too:
458 assert_equal(select([True], [0], default=[0]).shape, (1,))
459
460 def test_return_dtype(self):
461 assert_equal(select(self.conditions, self.choices, 1j).dtype,

Callers

nothing calls this directly

Calls 4

assert_array_equalFunction · 0.90
selectFunction · 0.90
assert_equalFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected