我从CSV加载数据帧,如下所示:
$> cat data/min_max.out
inc nb_core matrix_name min_ratio max_ratio size
1 [4] blur -0.04448199907127215 0.013399553205103443 0.37
2 [4, 4] blur -0.04453722751332001 0.013489091403327214 0.68
3 [16] blur -0.00284065321351612 0.0010090201007384447 0.39
将其加载到Pandas中并尝试使用Seaborn进行绘制时,出现错误ValueError: Could not interpret input 'matrix_name'
data = pd.read_csv("data/min_max.out", sep="\t")
print(data["matrix_name"])
输出
0 blur 1 blur 2 blur Name: matrix_name, dtype: object
sns.countplot(x="matrix_name", df=data)
输出
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-32-ed2cdb4855ad> in <module> 1 print(data["matrix_name"]) ----> 2 sns.countplot(x="matrix_name", df=data) /usr/local/lib/python3.7/site-packages/seaborn/categorical.py in countplot(x, y, hue, data, order, hue_order, orient, color, palette, saturation, dodge, ax, **kwargs) 3551 estimator, ci, n_boot, units, 3552 orient, color, palette, saturation, -> 3553 errcolor, errwidth, capsize, dodge) 3554 3555 plotter.value_label = "count" /usr/local/lib/python3.7/site-packages/seaborn/categorical.py in __init__(self, x, y, hue, data, order, hue_order, estimator, ci, n_boot, units, orient, color, palette, saturation, errcolor, errwidth, capsize, dodge) 1605 """Initialize the plotter.""" 1606 self.establish_variables(x, y, hue, data, orient, -> 1607 order, hue_order, units) 1608 self.establish_colors(color, palette, saturation) 1609 self.estimate_statistic(estimator, ci, n_boot) /usr/local/lib/python3.7/site-packages/seaborn/categorical.py in establish_variables(self, x, y, hue, data, orient, order, hue_order, units) 153 if isinstance(input, string_types): 154 err = "Could not interpret input '{}'".format(input) --> 155 raise ValueError(err) 156 157 # Figure out the plotting orientation ValueError: Could not interpret input 'matrix_name'
这是一个愚蠢的测试图。您不会在其中找到任何有趣的东西,这很正常。
这是在Jupyter Notebook中运行的。