I have a list containing more than 100,000 values in it.
I need to divide the list into multiple smaller lists based on a specific bin width say 0.1. Can anyone hel
Is this what you want? (Sample output would have been helpful :)
f = [-0.234, -0.04325, -0.43134, -0.315, -0.6322, -0.245,
-0.5325, -0.6341, -0.5214, -0.531, -0.124, -0.0252]
import numpy as np
data = np.array(f)
hist, edges = np.histogram(data, bins=10)
print hist
yields:
[2 3 0 1 0 1 2 0 1 2]
This SO question assigning points to bins might be helpful.