numpy\'s round int doesn\'t seem to be consistent with how it deals with xxx.5
In [2]: np.rint(1.5) Out[2]: 2.0 In [3]: np.rint(10.5) Out[3]: 10.0 <
In [2]: np.rint(1.5) Out[2]: 2.0 In [3]: np.rint(10.5) Out[3]: 10.0
The built-in round function seems to do what you want, although it only works on scalars:
def correct_round(x): try: y = [ round(z) for z in x ] except: y = round(x) return y
and then to verify:
print correct_round([-2.5,-1.5,-0.5,0.5,1.5,2.5]) > [-3.0, -2.0, -1.0, 1.0, 2.0, 3.0]