I have data in the two lists value and freq like this:
value freq 1 2 2 1 3 3 6 2 7 3 8 3 ....
and I want the output to be
bin freq 1-3 6 4-6 2 7-9 6 ...
I can write few lines of code to do this. However, I am looking if there are builitin functions in standard python or Numpy? I found the solution when you are given data in array/list with repetition i.e. they are not already grouped into frequency table(eg. d= [1,1,2,3,3,3,6,6,7,7,7,8,8,8,...]
. However, in this case I could not find the answers. I do not want to convert my data into single expanded list like d
first and use histogram function.