I have some values in a Python Pandas Serie (type: pandas.core.series.Series)
In : serie = pd.Series([0.0,950.0,-70.0,812.0,0.0,-90.0,0.0,0.0,-90.0,0.0,-64.0,208.0,0.0,-90.0,0.0,-80.0,0.0,0.0,-80.0,-48.0,840.0,-100.0,190.0,130.0,-100.0,-100.0,0.0,-50.0,0.0,-100.0,-100.0,0.0,-90.0,0.0,-90.0,-90.0,63.0,-90.0,0.0,0.0,-90.0,-80.0,0.0,])
In : serie.min()
In : serie.max()
lwb = range(-200,1000,50)
upb = range(-150,1050,50)
You just need to use the histogram function of numpy:
import numpy as np count,division = np.histogram(serie)
where division is the automatically calculated border for your bins and count is the population inside each bin.
If you need to fix a certain number of bins, you can use the argument bins and specify a number of bins, or give it directly the boundaries between each bin.
count,division = np.histogram(serie,bins = [-201,-149,949,1001])
to plot the results you can use the matplotlib function hist, but if you are working in pandas each Series has its own handle to the hist function, and you can give it the chosen binning: