我正在尝试使用预处理器库来清理存储在 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) 我正在尝试使用 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