Feb. 23, 2013
4:51 p.m.
On Saturday, February 23, 2013 00:45:55 Brett Olsen wrote:
a = np.ones(30) idx = np.array([2, 3, 2]) a += 2 * np.bincount(idx, minlength=len(a))
a
array([ 1., 1., 5., 3., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
Hi! OK, but is there any reason why Santhu's first option doesn't work? Shouldn't it work? Cheers, Ze