In [2]:
# Libraries
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
import random as rng
import numpy as np
%matplotlib inline
In [15]:
data = pd.read_csv("ocrdummy.csv")
In [16]:
data
Out[16]:
Name
Year 1
Year 2
Year 3
Year 4
Year 5
Year 6
Year 7
Year 8
Year 9
Year 10
0
Rush Henrietta
45
34
53
65
34
29
45
50
20
45
1
Cougar Tech
65
60
70
35
40
65
60
59
55
60
2
Pittsford
22
24
15
30
6
14
19
22
10
40
3
Brighton
15
35
25
20
17
19
10
9
8
15
4
Chili
20
30
22
33
44
33
31
23
29
31
5
Gates
30
15
5
60
34
22
20
20
20
19
6
Fairport
19
13
14
19
13
12
15
16
18
18
In [47]:
data.iloc[0]
Out[47]:
Name Rush Henrietta
Year 1 45
Year 2 34
Year 3 53
Year 4 65
Year 5 34
Year 6 29
Year 7 45
Year 8 50
Year 9 20
Year 10 45
Name: 0, dtype: object
In [51]:
row = data.iloc[0]
row.plot(kind='bar')
plt.show()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-51-7931bff5099e> in <module>()
1 row = data.iloc[0]
----> 2 row.plot(kind='bar')
3 plt.show()
/Users/dinbecevic/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in __call__(self, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)
3495 colormap=colormap, table=table, yerr=yerr,
3496 xerr=xerr, label=label, secondary_y=secondary_y,
-> 3497 **kwds)
3498 __call__.__doc__ = plot_series.__doc__
3499
/Users/dinbecevic/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)
2585 yerr=yerr, xerr=xerr,
2586 label=label, secondary_y=secondary_y,
-> 2587 **kwds)
2588
2589
/Users/dinbecevic/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _plot(data, x, y, subplots, ax, kind, **kwds)
2382 plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
2383
-> 2384 plot_obj.generate()
2385 plot_obj.draw()
2386 return plot_obj.result
/Users/dinbecevic/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in generate(self)
983 def generate(self):
984 self._args_adjust()
--> 985 self._compute_plot_data()
986 self._setup_subplots()
987 self._make_plot()
/Users/dinbecevic/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _compute_plot_data(self)
1092 if is_empty:
1093 raise TypeError('Empty {0!r}: no numeric data to '
-> 1094 'plot'.format(numeric_data.__class__.__name__))
1095
1096 self.data = numeric_data
TypeError: Empty 'DataFrame': no numeric data to plot
Content source: cougarTech2228/Scouting-2016
Similar notebooks: