img = mpimg.imread('file.tif') #imports image
im_x = np.sum(img, axis=0) #sum the rows of the array
hist = pl.hist(im_x) #returns a list - this works fine
test = np.array(hist) #turns hist into a numpy array so i can plot it
plt.plot(test)
plt.show()
I'm trying to import an image to an array, sum the values of each row, then plot this in a histogram.
The code above gives me the 'setting an array element with a sequence error' message, which I don't understand as it's a numpy array.
I've only been using python for a week, so it could be something really obvious I'm doing wrong.