| 4380 | assert_(z[2] is masked) |
| 4381 | |
| 4382 | def test_round_with_output(self): |
| 4383 | # Testing round with an explicit output |
| 4384 | |
| 4385 | xm = array(np.random.uniform(0, 10, 12)).reshape(3, 4) |
| 4386 | xm[:, 0] = xm[0] = xm[-1, -1] = masked |
| 4387 | |
| 4388 | # A ndarray as explicit input |
| 4389 | output = np.empty((3, 4), dtype=float) |
| 4390 | output.fill(-9999) |
| 4391 | result = np.round(xm, decimals=2, out=output) |
| 4392 | # ... the result should be the given output |
| 4393 | assert_(result is output) |
| 4394 | assert_equal(result, xm.round(decimals=2, out=output)) |
| 4395 | |
| 4396 | output = empty((3, 4), dtype=float) |
| 4397 | result = xm.round(decimals=2, out=output) |
| 4398 | assert_(result is output) |
| 4399 | |
| 4400 | def test_round_with_scalar(self): |
| 4401 | # Testing round with scalar/zero dimension input |