Menu

PnumpyReduce

Alexander Pletzer

Applying reduce

To apply a reduction operation across all the elements of the distributed array, simply call, for instance,

checkSum = da.reduce(lambda x,y:x+y, rootPe=0)

with the first argument being a function and the second (optional) argument being the rank of the process where the value is gathered. Here, checkSum will be None on all processes except rootPe.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.