我有一个存储在数据框中的 CSV 文件。CSV 文件有一列“公司名称”。我想创建一个新列并在此新列中的特定索引处插入一个值,其中公司名称的值为 i
import pandas as pd
df=pd.read_csv('Some csv.csv')
df['New Column']= ' '
for i in df['Company Name']:
found_list=[]
for found, score, matchrow in process.extract(i, df['Company Name'], scorer=fuzz.token_set_ratio):
if score >= 75:
print('%d%% partial match: "%s" with "%s" ' % (score, i, found))
found_list.append(found)
df['New Column'].index(i).append(found_list) #I want to insert found list in 'New Column' corresponding to value i
但这给出了错误:
TypeError: 'RangeIndex' object is not callable
缥缈止盈
相关分类