大家好,我对python编程很陌生。我有一组列的数据,如图所示。每个职业都有相关的硬技能,但实际上是硬技能和技术技能的结合。我的目标是创建一个新的专栏,将每一项技能归类为硬技能或技术,以便以后更容易对其进行过滤。我写了一本技术技能词典。我想看看字典词和硬技能栏单词是否匹配。你能帮我弄一下密码吗?字典中的单词如下:
dict = {tech_skills:'Android (操作系统),'Apple IOS','Apple IPhone',‘计算机键盘’,'Computer Terminals','Corel Wordperfect Office','FaceTime','Gmail','Google‘,'Google’,'Google‘,'Google+','Microsoft Internet Explorer','Microsoft Office','Microsoft Outlook','Microsoft PowerPoint','Microsoft Visio','Microsoft Windows','Microsoft Windows NT','Microsoft‘,'Microsoft’,‘移动设备’,'Skype','Tableau (商业智能软件)‘}
发布于 2021-05-31 07:41:53
# Copy hard_skills_name onto a new column
df['matched'] = df['hard_skills_name']
# replace with 1 if matched with the techskills
df['matched'].replace(dict['tech_skills'],1,inplace=True)
# replace non-matched with 0
df['matched'][df['matched'] != 1] = 0 然后您可以检查匹配的数据帧:
print(df[df['matched']=1])https://stackoverflow.com/questions/67768867
复制相似问题