Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Item Assignment Not Supported in Dask

Tags:

dask

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.

like image 358
Alger Remirata Avatar asked Dec 02 '16 15:12

Alger Remirata


2 Answers

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.

like image 117
MRocklin Avatar answered Oct 22 '22 07:10

MRocklin


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.

like image 4
dhassell Avatar answered Oct 22 '22 06:10

dhassell