我正在尝试在 Python 中使用散景可视化数据框。这是我的数据框的样子:
我使用以下代码生成折线图:
visualized_result.plot_bokeh(kind='line', x='x', y=['y', 'y38'], xlabel='x-values', ylabel='functions', title='Best Function')
现在我收到以下错误:
Exception Traceback (most recent call last)
<ipython-input-50-6fd221ec89a7> in <module>
----> 1 visualized_result.plot_bokeh(kind='line', x='x', y=['y', 'y38'], xlabel='x-values', ylabel='functions', title='Best Function')
~/opt/anaconda3/lib/python3.8/site-packages/pandas_bokeh/plot.py in __call__(self, *args, **kwargs)
1785
1786 def __call__(self, *args, **kwargs):
-> 1787 return plot(self.df, *args, **kwargs)
1788
1789 @property
~/opt/anaconda3/lib/python3.8/site-packages/pandas_bokeh/plot.py in plot(df_in, x, y, kind, figsize, use_index, title, legend, logx, logy, xlabel, ylabel, xticks, yticks, xlim, ylim, fontsize_title, fontsize_label, fontsize_ticks, fontsize_legend, color, colormap, category, histogram_type, stacked, weights, bins, normed, cumulative, show_average, plot_data_points, plot_data_points_size, number_format, disable_scientific_axes, show_figure, return_html, panning, zooming, sizing_mode, toolbar_location, hovertool, hovertool_string, rangetool, vertical_xlabel, x_axis_location, webgl, reuse_plot, **kwargs)
342 )
343 else:
--> 344 raise Exception(
345 "Please provide for the <x> parameter either a column name of the DataFrame/Series or an array of the same length."
346 )
Exception: Please provide for the <x> parameter either a column name of the DataFrame/Series or an array of the same length.
有人可以帮我这里发生了什么吗?我有一种感觉,这实际上应该很简单。非常感谢你的帮助