I am attempting to have a cummalative total of the y values and receive a "list
index out of range" error message
import numpy
import matplotlib.pyplot as plt
import filereader
from filereader import *
My_Path="C:\\Python26\\assignment2\\datadownload.txt"
My_Data_Type=numpy.dtype([("year","int32"),("day","int32"),("MJ","float64")])
daily_solar_radiation=read_array(My_Path,My_Data_Type,separator=None)
y=[]
for i in xrange(0,365):
y+=[daily_solar_radiation["MJ"][i]]
x=[]
for i in xrange(0,365):
x+=[daily_solar_radiation["day"][i]]
plt.plot(x,y)
plt.title('Daily Radiation')
plt.xlabel('day of the year')
plt.ylabel('MJ/m**2')
plt.show()
plt.savefig('plot1.png')
from filereader import *
My_Path="C:\\Python26\\assignment2\\datadownload.txt"
My_Data_Type=numpy.dtype([("year","int32"),("day","int32"),("MJ","float64")])
daily_solar_radiation=read_array(My_Path,My_Data_Type,skip=91,separator=None)
y=[daily_solar_radiation["MJ"][0]]
for i in xrange(0,275):
y=[daily_solar_radiation["MJ"]][i]+y[i-1]
for i in xrange(0,275):
x+=[daily_solar_radiation["day"][i]]
plt.plot(x,y)
plt.title('Daily Radiation')
plt.xlabel('day of the year')
plt.ylabel('MJ/m**2')
plt.show()
plt.savefig('plot2.png')
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor