sports = [‘跑步‘, ‘打球‘, ‘打‘, ‘强‘, ‘壮‘, ‘体育‘, ‘运动员‘, ‘运动‘, ‘活动‘, ‘训练‘, ‘得分‘, ‘比赛‘, ‘参赛‘, ‘赢‘, ‘球‘]
found = NoAQ[‘question‘].str.contains(‘|‘.join(sports)) # question列,每行字符串,至少包含sports其中一个
sports_idx = NoAQ[‘question‘][found].index # 获得其 行索引
NoAQ.iloc[sports_idx] = 1
原文:https://www.cnblogs.com/douzujun/p/14375658.html