如何将项目列表插入数据框的单元格中?在这段代码中,clean_text函数返回一个列表,然后我想将该列表保存在“abstract_processed”和“body_processed”列的特定行中
for i,content in dfp["abstract"].iteritems():
if type(content) == type("this is a string"):
dfp.loc[i,'abstract_processed']=clean_text(content,word_tokenize,stopwords)
else:
dfp.loc[i,'abstract_processed']="lacking"
for i,content in dfp["body_text"].iteritems():
if type(content) == type("this is a string"):
dfp.loc[i,'body_processed']=clean_text(content,word_tokenize,stopwords)
else:
dfp.loc[i,'body_processed']="lacking"
dfp.head()
目前没有回答
相关问题 更多 >
编程相关推荐