小编use*_*031的帖子

AttributeError:模块“预处理器”没有属性“clean”

我正在尝试使用预处理器库来清理存储在 Pandas 数据框中的文本。我已经安装了最新版本(https://pypi.org/project/tweet-preprocessor/),但收到以下错误消息:

import preprocessor as p
#forming a separate feature for cleaned tweets
for i,v in enumerate(df['text']):
    df.loc[v,'text'] = p.clean(i)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-183-94e08e1aff33> in <module>
      1 #forming a separate feature for cleaned tweets
      2 for i,v in enumerate(df['text']):
----> 3     df.loc[v,'text'] = p.clean(i)

AttributeError: module 'preprocessor' has no attribute 'clean'
Run Code Online (Sandbox Code Playgroud)

python preprocessor attributeerror

3
推荐指数
1
解决办法
6559
查看次数

不区分大小写的搜索与 sed 匹配?

我正在尝试使用 SED 从两个单词(例如“Account”和“Recognized”)中提取文本,并且我希望搜索不区分大小写。所以我尝试使用 I 参数,但收到此错误消息:

cat Security.txt | sed -n "/Account/,/Recognized/pI" | sed -e '1d' -e '$d' sed: -e expression #1, char 24: extra characters after command

bash sed case-insensitive

2
推荐指数
1
解决办法
4232
查看次数