Python-ValueError:从CSV绘制图形时,min()arg为空序列

时间:2018-09-17 13:54:56

标签: python python-3.x csv lambda seaborn

我有一个包含“描述”和“区域”字段的CSV。我想画出每个区域有多少个。运行代码时出现以下错误:

----> 4 sns.countplot(x = feedback_df['Area'], order = varieties, ax = ax)
ValueError: min() arg is an empty sequence

这是我正在运行的用于通过此操作的代码:

feedback = pd.read_csv('feedback.csv')
feedback[feedback['Description'].duplicated(keep = False)].sort_values('Description').head(8)
feedback = feedback.drop_duplicates('Description')
feedback_df = feedback.groupby('Area').filter(lambda x: len(x) > 10599)
Types = feedback_df['Area'].value_counts().index.tolist()
fig, ax = plt.subplots(figsize = (25, 10))
sns.countplot(x = variety_df['Area'], order = varieties, ax = ax)
plt.xticks(rotation = 90)
plt.show()

0 个答案:

没有答案