MCPcopy Index your code
hub / github.com/numpy/numpy / test_concatenate_alongaxis

Method test_concatenate_alongaxis

numpy/ma/tests/test_core.py:245–269  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

243 assert_equal(np.concatenate((x, y, x)), concatenate((x, ym, x)))
244
245 def test_concatenate_alongaxis(self):
246 # Tests concatenations.
247 x, y, _, m1, m2, xm, ym, z, _, xf = self._create_data()
248 # Concatenation along an axis
249 s = (3, 4)
250 x = x.reshape(s)
251 y = y.reshape(s)
252 xm = xm.reshape(s)
253 ym = ym.reshape(s)
254 xf = xf.reshape(s)
255
256 assert_equal(xm.mask, np.reshape(m1, s))
257 assert_equal(ym.mask, np.reshape(m2, s))
258 xmym = concatenate((xm, ym), 1)
259 assert_equal(np.concatenate((x, y), 1), xmym)
260 assert_equal(np.concatenate((xm.mask, ym.mask), 1), xmym._mask)
261
262 x = zeros(2)
263 y = array(ones(2), mask=[False, True])
264 z = concatenate((x, y))
265 assert_array_equal(z, [0, 0, 1, 1])
266 assert_array_equal(z.mask, [False, False, False, True])
267 z = concatenate((y, x))
268 assert_array_equal(z, [1, 1, 0, 0])
269 assert_array_equal(z.mask, [False, True, False, False])
270
271 def test_concatenate_flexible(self):
272 # Tests the concatenation on flexible arrays.

Callers

nothing calls this directly

Calls 8

_create_dataMethod · 0.95
assert_equalFunction · 0.90
concatenateFunction · 0.90
arrayFunction · 0.90
onesFunction · 0.90
assert_array_equalFunction · 0.90
zerosFunction · 0.85
reshapeMethod · 0.80

Tested by

no test coverage detected