By default python uses Banker's rounding(round towards the nearest even for halfs), ie ( 10.5 becomes 10, 11.5 becomes 12). I want my halfs to be rounded towards the right always. (10.5 becomes 11, 11.5 becomes 12, 12.5 becomes 13, and of-course 10.2 becomes 10 and 10.7 becomes 11)
import pandas as pd
import numpy as np
data = [['tom', 10.5], ['nick', 11.5], ['jack', 10.2], ['juli', 10.7]]
df = pd.DataFrame(data, columns = ['Name', 'Age'])
#df = df.round({'Age': 0})
df["Age"] = df["Age"].apply(np.round)
EXPECTED VALUES FOR COLUMN AGE IS: 11,12,10,11