Please find the below code :
Var= pd.DataFrame(df_enbrel_pd.groupby([\'source_customer_id\',\'channel_code\']).response_fact_timestamp.apply(lambda x: max(x))