【发布时间】:2019-09-28 08:47:23
【问题描述】:
我正在尝试运行 Python 笔记本 (link)。在In [18]: 行,作者使用Seaborn 绘制了一些数据,我遇到了一个错误
ValueError: 'c' 参数有 12 个元素,不能与大小为 0 的 'x' 和大小为 0 的 'y' 一起使用。
在 [18] 中:
import seaborn as sns
# sales trends
sns.factorplot(data = train_store, x = 'Month', y = "Sales",
col = 'StoreType', # per store type in cols
palette = 'plasma',
hue = 'StoreType',
row = 'Promo', # per promo in the store in rows
color = c)
Seaborn 版本:
seaborn==0.9.0
我在网上查看了有关此错误的信息,但找不到任何有用的信息。请指引我正确的方向。
更新
这是用于测试的最少代码
import pickle
import seaborn as sns
# seaborn==0.9.0
with open('train_store', 'rb') as f:
train_store = pickle.load(f)
c = '#386B7F' # basic color for plots
# sales trends
sns.factorplot(data = train_store, x = 'Month', y = "Sales",
col = 'StoreType', # per store type in cols
palette = 'plasma',
hue = 'StoreType',
row = 'Promo', # per promo in the store in rows
color = c)
train_store 数据文件链接:Link 1
【问题讨论】:
-
你能创建一个minimal reproducible example吗?
-
如果省略
color=c,输出会是什么?潜在问题可能是 #14113,但在下一个 seaborn 版本出现之前可能没有任何修复。 -
@DavidG 您好,我已经创建了用于测试的最小代码,您可以查看更新后的问题以获取更多详细信息
-
@ImportanceOfBeingErnest 您好,我已尝试删除
color=c,但仍然出现相同的错误
标签: python ubuntu seaborn kaggle