[SciPy-user] scikits.timeseries : how would I plot (or calculate) monthly statistics.
Pierre GM
pgmdevlist@gmail....
Wed Mar 4 14:38:46 CST 2009
On Mar 4, 2009, at 11:15 AM, Dharhas Pothina wrote:
>
> Given 10-15 years of timeseries data
What frequency ? Monthly ? Daily ?
>
> I know how to read in my timeseries and convert it to a monthly
> frequency but I'm not sure the best way to proceed from here. I
> guess one way would be to reshape the monthly timeseries array into
> 12 columns and then calculate the stats on each column but I was
> wondering if there was a more appropriate method to do this?
* If you have a monhtly frequency: just use .convert('A') and compute
the stats for each column.
* If you have a daily frequency:
well, I'm afraid you didn't give enough information: what do you want
for each month, what is the expected shape of the output ? Statistics
far all the years (eg, the mean for January irrespectively of the
year), with an output of shape (12,) ? For each year, with an output
of shape (n, 12) and n the nb of years?
The generic idea is indeed to first convert to monthly. You end up
with a (12*n, 31) series that you have to reshape. However, because
you won't need the dates, I strongly advise you to work only on
the .series part for the reshaping.
> On another note: shouldn't there be a link on this page (http://scikits.appspot.com/timeseries
> ) to the timeseries home page http://pytseries.sourceforge.net/ .
> The link on the appspot page (http://pypi.python.org/pypi/scikits.timeseries
> ) doesn't work.
Thanks for reporting. We were already aware of the problem, that shall
be fixed when timeseries will be officially released (and then, we'll
be able to put it on pypi).
More information about the SciPy-user
mailing list