我正在尝试使用contractions.fix
扩展数据集中的单词。但是,当我运行代码并尝试将扩展的单词添加到数据集中的新列时,会得到一个超出范围的错误字符串索引。我试着到处找,但找不到解决办法
数据集的屏幕截图,我想在comments
列上运行contractions.fix
将抛出代码和错误的屏幕截图:
这是我运行constrations.fix的代码:
rws["expanded_words"]=rws['comments'].apply(lambda x: [contractions.fix(word) for word in x.split()])
目前没有回答
相关问题 更多 >
编程相关推荐