【发布时间】:2021-11-24 15:17:12
【问题描述】:
我有这个用于情感分析的数据集,使用以下代码加载数据:
url = 'https://raw.githubusercontent.com/jdvelasq/datalabs/master/datasets/amazon_cells_labelled.tsv'
df = pd.read_csv(url, sep='\t', names=["Sentence", "Feeling"])
问题是 DataFrame 与 NaN 匹配,但它只是整个句子的一部分。
现在的输出是这样的:
sentence feeling
I do not like it. NaN
I give it a bad score. 0
输出应如下所示:
sentence feeling
I do not like it. I give it a bad score 0
你能帮我根据分数连接或加载数据集吗?
【问题讨论】:
标签: python pandas loading sentiment-analysis