【发布时间】:2019-08-22 07:17:33
【问题描述】:
我使用 WordBlob 创建了一个包含来自文本文档的列表的列表。现在我想在每个列表中创建一个差异最大的列表,我只对极性感兴趣。我想将最高和最低的数字附加到另一个列表中,然后将它们相互减去。但是我怎么能引用“极性”中的数字呢?这是我的嵌套列表:
[[Sentiment(polarity=0.35, subjectivity=0.65),
Sentiment(polarity=0.0, subjectivity=0.0),
Sentiment(polarity=0.0, subjectivity=0.0),
Sentiment(polarity=0.6, subjectivity=0.87),
Sentiment(polarity=0.0, subjectivity=0.0),
Sentiment(polarity=0.0, subjectivity=0.0)],
[Sentiment(polarity=0.0, subjectivity=0.0),
Sentiment(polarity=0.5, subjectivity=0.8),
Sentiment(polarity=0.0, subjectivity=0.0),
Sentiment(polarity=-0.29, subjectivity=0.54),
Sentiment(polarity=0.0, subjectivity=0.0),
Sentiment(polarity=0.25, subjectivity=1.0)],
[Sentiment(polarity=0.5, subjectivity=0.8),
Sentiment(polarity=0.0, subjectivity=0.0)]]
有人有想法吗?感谢您的帮助。
【问题讨论】:
标签: python nested-lists textblob