Some thing like this should also work
import numpy as np
def proper_round(a):
'''
given any real number 'a' returns an integer closest to 'a'
'''
a_ceil = np.ceil(a)
a_floor = np.floor(a)
if np.abs(a_ceil - a) < np.abs(a_floor - a):
return int(a_ceil)
else:
return int(a_floor)