MCPcopy Create free account
hub / github.com/dask/dask / test_setitem_1d

Function test_setitem_1d

dask/array/tests/test_array_core.py:4245–4257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4243
4244
4245def test_setitem_1d():
4246 x = np.arange(10)
4247 dx = da.from_array(x.copy(), chunks=(5,))
4248
4249 x[x > 6] = -1
4250 x[x % 2 == 0] = -2
4251 x[[2, 3]] = -3
4252
4253 dx[dx > 6] = -1
4254 dx[dx % 2 == 0] = -2
4255 dx[da.asarray([2, 3])] = -3
4256
4257 assert_eq(x, dx)
4258
4259
4260def test_setitem_masked():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
arangeMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected