for i in range(len(df1)):
output=[]
data= str(df1.iloc[i].NOTE)
data1=data.lower()
data1 = word_tokenize(data1)
for words in data1:
if words not in stop_words:
output.append(words)
if any(words.isdigit() for words in output):
output.remove(words)
print(df1.iloc[i].AMRI_PRESCRIPTION_ID,df1.iloc[i].AMRI_CLINICAL_NOTE_Q_ID,output)
这里output
是tokenized
值的列表。
上面的打印内容给出了结果:
127 1 ['second', 'episode', 'fever', 'last', 'week']
我需要将该值保存在数据帧中,然后将同一数据帧保存到数据库中的表中。请帮忙
目前没有回答
相关问题 更多 >
编程相关推荐