(self)
| 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. |
nothing calls this directly
no test coverage detected