You can use np.bincount, like so -
out_shape = (3,3) # Input param
# Get linear indices corresponding to coords with the output array shape.
# These form the IDs for accumulation in the next step.
ids = np.ravel_multi_index(coords.T,out_shape)
# Use bincount to get 1-weighted accumulations. Since bincount assumes 1D
# array, we need to do reshaping before and after for desired output.
out = np.bincount(ids,minlength=np.prod(out_shape)).reshape(out_shape)
If you are trying to assign values other than 1s, you can use the additional input argument to feed in weights to np.bincount.
Sample run -
In [2]: coords
Out[2]:
array([[1, 2],
[1, 2],
[1, 2],
[0, 0]])
In [3]: out_shape = (3,3) # Input param
...: ids = np.ravel_multi_index(coords.T,out_shape)
...: out = np.bincount(ids,minlength=np.prod(out_shape)).reshape(out_shape)
...:
In [4]: out
Out[4]:
array([[1, 0, 0],
[0, 0, 3],
[0, 0, 0]], dtype=int64)