【发布时间】:2020-05-14 03:51:28
【问题描述】:
我有一个数据框 df:
sentiment | topic
1 | 1
-4 | 0
2 | 1
-1 | 0
1 | 0
3 | 1
我想制作一个散点图,看看情绪值如何根据主题排列。
我的代码:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_sql_table("df", result)
sns.catplot(x="topic", y="sentiment", order=["0", "1"], data=df)
plt.show()
但剧情是空的?
Seaborn 是否无法正确地从数据框中获取值?
【问题讨论】:
标签: pandas seaborn scatter-plot