code for ploting bar chart:
import pylab as pl
data = """35389 6
35316 7
33921 8
1914 5
21 4
3 3
3 2
"""
values = []
dates = []
for line in data.split("\n"):
x, y = line.split()
values.append(int(x))
dates.append(int(y))
fig = pl.figure()
ax = pl.subplot(111)
ax.bar(dates, values, width=100)
ax.xaxis_date()
Give this error :
File "try2.py", line 17, in x, y = line.split() ValueError: need more than 0 values to unpack
How to fix it?