I have matlab code and I want to change it to python code. To do this , I want to know how to get index of max value of histogram in python
In matlab it's easy to get index
for example
array1 = [0 1 2 2 3 4 4 4 4 5 6 6 7 8 9]
a1 = hist(array1,max(array1)-min(array1))
[value , index] = max(a1)
u=[index-2:1:index+2]
array_matrix = a1(u)
% then value = 4 , index = 5
but how can I get in python?
I know there's matplotlib and numpy to get histogram. but I don't know how to get max value and index of it.