Kaggle competition: TalkingData AdTracking Fraud Detection Challenge
lagtime_agg = train_df.groupby('user_id')['lagtime'].agg(['mean'])
 train_df['lagtime_mean'] = train_df['user_id'].map(lagtime_agg['mean'])
 train_df.lagtime_mean=train_df.lagtime_mean.astype('int32' )<groupby>
s = pd.read_csv('.. /input/adding-to-the-blender-lb-0-9688/average_result.csv' )
user_prior_question_elapsed_time = train_df[['user_id','prior_question_elapsed_time']].groupby(['user_id'] ).tail(1)
 user_prior_question_elapsed_time.columns = ['user_id', 'prior_question_elapsed_time']<feature_engineering>
s.to_csv('submission11.csv', index=False )