[SciPy-User] formating monthly freq data using scikits.timeseries

Solomon Negusse Solomon.Negusse@twdb.state.tx...
Thu Nov 4 08:07:20 CDT 2010


Pierre, I just tested the method you described and it worked great. Thanks a lot. 
-Solomon

>>> Pierre GM <pgmdevlist@gmail.com> 11/2/2010 3:39 AM >>>

On Nov 1, 2010, at 11:05 PM, Solomon Negusse wrote:

> Hi All,
> I have some hydrologic data that I need to reformat for  use in a hydrodynamic simulation.  The data comes in the shape of (number of years, 13) where the first column is the year and subsequent columns are  data for each month.  How do I read in such data using tsfromtxt and convert it 2D format with just datetime and data columns of daily or sub-daily frequency?

If I understand correctly what you're trying to do, you can't directly.
First, load your data using an annual frequency, with the date at the first column. You'll end up w/ a timeseries of shape (N,12), with N the number of months.
Then, create a second timeseries with a monthly frequency, starting at the first year and with length the .size of your first series. Fill the second one with values of the first one (using eg. monthly_series.flat = annual_series.flat). That should give you a (Nx12) series of monthly data. 
>From there, you can use convert to transform the monthly series into a series of daily frequency.

_______________________________________________
SciPy-User mailing list
SciPy-User@scipy.org 
http://mail.scipy.org/mailman/listinfo/scipy-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20101104/54a6506f/attachment-0001.html 


More information about the SciPy-User mailing list