代码如下:
Matched =np.array([False]*NewAGs.shape[0])
NewAGs["Tower"] = np.nan
for rowNum in range(Keywords.shape[0]):
## Get the keyword in the current row.
keyword = Keywords.lowerKeywords[rowNum]
## Get Assignment groups with the keyword:
index = (re.search("^" + keyword + "[^w+]", NewAGs.lowerAG[0]) or
re.search("[^w+]"+keyword+"[^w+]", NewAGs.lowerAG[0]) or
re.search("[^w+]"+keyword+"$", NewAGs.lowerAG[0]) or
re.search("^"+keyword+"$", NewAGs.lowerAG[0]))
print(bool(index))
## Select Only the Unmatched Assignment groups:
index = index and index != -1
print(sum(index))
if index != 0
NewAGs['Tower'[index]] <- Keywords['Tower'[rowNum]]
Matched <- Matched or index
目前没有回答
相关问题 更多 >
编程相关推荐