I want to generate a bar graph from from a csv file my data looks like this:
06/14/12 SMB 12104560 8096373.6 1.5 1.08
06/15/12 SMB 10328540 8217192.68 1.26 1.24
06/18/12 SMB 5495294 8232792.78 0.67 0.85
I want the first column to be the x-axis and the last column to be the y-axis, Also if possible I just want to use the last 5 rows of data. This is what I have tried so far but
Thanks
Edit New code:
data = numpy.loadtxt(StringIO(etf + '.csv' ,dtype= [("date", "S8"), ("value", "f8")]) , usecols=(0,-1))
x = numpy.arange(len(data))
pl1.bar(x,data["value"], width = 0.8)
p1.xticks(x+.4, data["date"])
p1.show()
new error: TypeError: __init__() got an unexpected keyword argument 'dtype'
1 Answer