我想根据关键字的特定字符串创建类别,该字符串比指定的类别"其他"更为真实.
例如,如果在列中找到"健康",则将该关键字行命名为"健康",如果是"治疗师",则命名为"治疗师"
- 通过代码创建"类别"列
- 根据条件分配类别
我可以在Excel上创建一个表,并使用索引匹配,我想切换到Python,将其应用于大型数据集,
Below is the sample data,
keyword | category |
---|---|
HR Consultancy UK-d-uk-159_bing | other |
it support COMPANY LONDON-D-UK-G1161_bing | other |
global sales training platform openings | sales |
tele private practice therapist | therapist |
asset grant management system | other |
digital team project management solution openings | other |
global training platform openings | other |
tele practice therapist | therapist |
global sales training platform openings | sales |
tele health practice | health |
asset grant management | other |
digital team project management solution | other |