I have data that contains a list of over thousand values, such as:
[3.481, 2.413, 4.682,...]
and can plot the histogram of it easily. However, I want to save the relative frequencies (or probability of each value occurring) of those values as a list, and make sure the frequency adds up to one. I tried using
import numpy
numpy.histogram(data, density=None)
But it's not giving me what I want as the sum doesn't equal one. And setting density equal to 'True' will normalize such that the integral over the range is 1, but I want the sum to equal one. Any help would be greatly appreciated, I tried looking all over the place for a simple code.