У меня есть датафрейм с 2 столбцами: один - это названия видов спорта, а другой - количество спортсменов в каждом из них.Я попытался построить гистограмму, используя:
ax = div1[['Sport','Athletes']].plot(kind='bar', title="abcd", figsize=(15, 10), legend=True, fontsize=12)
[Данные, использованные для построения гистограммы] [1]
Но я получил следующую ошибку:
TypeError Traceback (most recent call last)
<ipython-input-36-29052602d3cd> in <module>()
----> 1 ax = div1[['Sport','Athletes']].plot(kind='bar', title="abcd", figsize=(15, 10), legend=True, fontsize=12)
/opt/conda/lib/python3.5/site-packages/pandas/tools/plotting.py in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
3772 fontsize=fontsize, colormap=colormap, table=table,
3773 yerr=yerr, xerr=xerr, secondary_y=secondary_y,
-> 3774 sort_columns=sort_columns, **kwds)
3775 __call__.__doc__ = plot_frame.__doc__
3776
/opt/conda/lib/python3.5/site-packages/pandas/tools/plotting.py in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
2641 yerr=yerr, xerr=xerr,
2642 secondary_y=secondary_y, sort_columns=sort_columns,
-> 2643 **kwds)
2644
2645
/opt/conda/lib/python3.5/site-packages/pandas/tools/plotting.py in _plot(data, x, y, subplots, ax, kind, **kwds)
2468 plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
2469
-> 2470 plot_obj.generate()
2471 plot_obj.draw()
2472 return plot_obj.result
/opt/conda/lib/python3.5/site-packages/pandas/tools/plotting.py in generate(self)
1039 def generate(self):
1040 self._args_adjust()
-> 1041 self._compute_plot_data()
1042 self._setup_subplots()
1043 self._make_plot()
/opt/conda/lib/python3.5/site-packages/pandas/tools/plotting.py in _compute_plot_data(self)
1148 if is_empty:
1149 raise TypeError('Empty {0!r}: no numeric data to '
-> 1150 'plot'.format(numeric_data.__class__.__name__))
1151
1152 self.data = numeric_data
TypeError: Empty 'DataFrame': no numeric data to plot
Может кто-нибудь сказать, где я иду не так?Заранее спасибо.[1]: https://i.stack.imgur.com/yeIXz.png