i have numpy array called "precip" shape (2,3,3) corresponds (time, lat, lon) array([[[ 0.05368402, 0.43843025, 0.09521903], [ 0.22627141, 0.12920409, 0.17039465], [ 0.48148674, 0.59170703, 0.41321763]], [[ 0.63621704, 0.11119242, 0.25992372], [ 0.67846732, 0.3710733 , 0.25641174], [ 0.1992151 , 0.86837441, 0.80136514]]]) i have numpy array called "idx" list of indices, shape (3, 4): array([[0,0,1,1], # time [0,2,0,2], # x coordinate [0,2,0,2]]) # y coordinate so far have been able index "precip" variable "idx" variable array shape (4,), ie. >>>accum = precip[idx[0,:],idx[1,:],idx[2,:]] array([ 0.05368402, 0.41321763, 0.63621704, 0.80136514]) but, need array of zeros "accum" shape (3,3), populated sum of "precip" each pair of coordinates in "idx". other gridpoints not listed in "idx" 0. basically want array ...