【发布时间】:2020-10-01 19:14:10
【问题描述】:
我有一个包含“位置”和“职位”两列的数据框。我需要检查 Job Title 中的哪些行中包含 Locations 的名称。
Location Job Title
0 New York New York Regional Manager Las Vegas and San Diego
1 New York City Full Stack Engineer
2 San Francisco Bay Area Director of Guitar Studies
3 Greater Los Angeles New England Institute of Technology
4 Greater Chicago New England Institute of Technology
... ... ...
984710 NaN Catering Sales Manager
984711 NaN Director, Research & Development and
984712 NaN HR Manager
984713 NaN Director of Development
984714 NaN Development Officer
Location 中有 625 行,Job Location 中有接近一百万行。
我试过df['exist1']= df['Location'].isin(df['Job Title'])
之后,我尝试根据 True 值对其进行过滤,但它将 625 以下的每个值都显示为 TRUE。 Location 列中没有低于 625 的值。
我哪里错了?任何帮助将不胜感激。
【问题讨论】:
-
这需要用for循环或者numpy cherry char来完成
-
如果可能的话,你能告诉我吗
标签: python pandas numpy filtering