我有一个带有文本的col的数据框.我想应用textblob并计算每行的情绪值.
text sentiment
Run Code Online (Sandbox Code Playgroud)
这是伟大
的电影伟大的故事
当我执行以下代码时:
df['sentiment'] = list(map(lambda tweet: TextBlob(tweet), df['text']))
我收到错误:
TypeError: The `text` argument passed to `__init__(text)` must be a string, not <class 'float'>
Run Code Online (Sandbox Code Playgroud)
如何将textBLob应用于数据框中col的每一行以获取情绪值?