2021
07-09
07-09
python 实现添加标签&打标签的操作
普通打标签odue_df=df_train_stmt.loc[(df_train_stmt.AGE3>0)|(df_train_stmt.AGE4>0)|(df_train_stmt.AGE5>0)|(df_train_stmt.AGE6>0),['XACCOUNT']].drop_duplicates()odue_df['label']=1cust_df=df_acct[['CUSTR_NBR','XACCOUNT']].drop_duplicates()#做合并df_y=pd.merge(cust_df,odue_df,how='left',on='XACCOUNT').groupby('CUSTR_NBR').agg({'label':max}).reset_index().fillna(0)使用函数来打标签#标注标签Labeldeflab...
继续阅读 >