批量添加多列

依赖df.apply中的 result_type='expand'

def merge_tri_to_item(df):
    return [item_name, item_state, item_status]
items_df[['item_name', 'item_state', 'item_status',]] = items_df.apply(merge_tri_to_item,axis=1,result_type='expand')

这样可以完成多列的数据添加

原文地址:https://www.cnblogs.com/cizao/p/13262771.html