[Numpy-discussion] subset of array - statistics
bevan
bevan07@gmail....
Thu Mar 13 16:01:51 CDT 2008
Hello,
I am new to the world of Python and numpy but am very excited by what I have
seen so far.
I have been playing around with some rainfall data. The data is daily rainfall
for a period, say 30 years in the form:
Year Month JulianDay Rain (mm)
1970 1 1 0.0
1970 1 2 0.5
.................................
2008 3 65 2.5
I have successfully imported the data into lists and then created a single
array from the lists.
I can get the rainfall total over the entire period using:
raindata = numpy.array([yr,mth,jd,rain_mm],dtype=float)
print data[3,:].sum(axis=0)
or
raindata= numpy.rec.fromarrays
([yr,mth,jd,rain_mm],names='year,month,julian,rain_mm')
print raindata.rain_mm.sum(axis=0)
But what i would like to do is get an average rainfall for each month and also
the ability to get rainfall totals for any month and Year
I thought it would be straight forward but have not gotten my head around it
yet. Thanks for your help and thakns to the people eho have develoepd and
maintain numpy & python
More information about the Numpy-discussion
mailing list