I have a 2d array and I want to calculate the histogram for each row of the array without the 'for' loop. This is what I've already tried before.
data=np.random.randint(1,10,size=(40000,2000)
h=np.zeros(data.shape[0],9)
for i in range(data.shape[0])
h[i],k=np.histogram(data[i,:],bins=range(1,11))
Comments
Post a Comment