drop_duplicates(self, subset=None, keep="last", inplace=False)
df = df.sort_values('timestamp').drop_duplicates(['customer_id','var_name'], keep='last')
print (df)
customer_id value var_name timestamp
0 1 1 apple 2018-03-22 00:00:00.000
3 1 1 orange 2018-03-22 08:00:00.000
2 2 4 apple 2018-03-24 08:00:00.000
4 2 3 orange 2018-03-24 08:00:00.000