In my Python script, I have floating what I want bin. Now I am doing:
min_val = 0.0
max_val = 1.0
num_bins = 20
my_bins = numpy.linspace(min_val, max_val, num_bins)
hist,my_bins = numpy.histogram(myValues, bins=my_bins)
But now I want to add two more bins to account for values that are <0.0 and for those that are> 1.0. Thus, one box should include all values in (-inf, 0), and the other in [1, inf)
Is there an easy way to do this while continuing to use the numpy function histogram?
source
share