首页 > 解决方案 > 如何在numpy中创建一个数组来存储python中字符串的清理文本?

问题描述

#array for saving the cleaned text
normalized_corpus = numpy.full(fill_value='',shape=initiate.shape,dtype='str')
for k,text in enumerate(initiate.values):
    #doing all text cleaning
    text = lower(text)
    text = lemmatize_text(text)
    text = remove_special_characters(text)
    normalized_corpus[k] = text

当我执行上面的代码时,我得到了以下错误。请帮帮我。

[我在初始化形状时出错 错误

标签: pythonnumpynlpdata-science

解决方案


推荐阅读