What are the ways we can have perform item assignment in Dask Arrays? Even a very simple item assignment like: a[0] = 2 does not work.
Correct. This is the first limitation noted in the documentation.
In general, workflows that involve for loops and direct assignment of individual elements are hard to parallelize. Dask array does not make this attempt.
As of dask
version 2021.04.1, this type of assignment is now supported - see the dask assignment docs for details.
It is a fairly complete implementation of indexed assignment, including broadcasting and masked assignments. As you would expect, the assignment can be lazily embedded within a sequence of other operations. See the aforementioned docs for the very few indexed assignment cases that work in numpy
but not yet in dask
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With