当前位置 : 主页 > 网络编程 > 其它编程 >

python_两个数据集_关联_拼接join操作merge

来源:互联网 收集:自由互联 发布时间:2023-07-02
python_两个数据集拼接 dataset3[[user_id,coupon_id,date_received]]t3 pd.merge(t3,t2,on[user_id,coupon_id],howleft)t3[this_month_user_receive_same_coupon_lastone] t3.max_date_received - t3.date_receivedt3[this_month_user_receive_same_co
python_两个数据集拼接 dataset3[[user_id,coupon_id,date_received]]t3 pd.merge(t3,t2,on[user_id,coupon_id],howleft)t3[this_month_user_receive_same_coupon_lastone] t3.max_date_received - t3.date_receivedt3[this_month_user_receive_same_coupon_firstone] t3.date_received - t3.min_date_received#根据多个字段就进行mergeother_feature3 pd.merge(t1,t,onuser_id)other_feature3 pd.merge(other_feature3,t3,on[user_id,coupon_id])other_feature3 pd.merge(other_feature3,t4,on[user_id,date_received])other_feature3 pd.merge(other_feature3,t5,on[user_id,coupon_id,date_received])other_feature3 pd.merge(other_feature3,t7,on[user_id,coupon_id,date_received])other_feature3.to_csv(data/other_feature3.csv,indexNone)#拼接数据集#两个数据框合并为一个df_train_stmt pd.concat([df_train_stmt,df_train_stmt_test],axis 0)
上一篇:vuem3u8视频播放组件
下一篇:没有了
网友评论