这个错误提示是因为 words 变量是一个生成器对象,无法使用下标索引。可能是在代码中使用了类似于 words[index] 的语法。建议将 words 转换成列表对象,例如:

words = list(jieba.cut(info))

for i word in enumeratewords # 判断是否为数字 if wordisdigit if i 0 and wordsi-1isdigit tag_listappendI-cellno cellno += word else tag_listappendB-cellno

原文地址: https://www.cveoy.top/t/topic/htEu 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录