def remove_last_odd_row(fr):
    nrow = fr.shape[0]
if nrow % 2 > 0:
    return fr[:nrow - 1]
else:
    return fr
fr = fr.groupby('fruitname').apply(remove_last_odd_row).reset_index(drop=True)
python pandas dataframe : removing selected rows