[SciPy-User] scikits.timeseries: How to define frequency of 15minutes

Wes McKinney wesmckinn at gmail.com
Mon May 17 13:45:48 EDT 2010


On Mon, May 17, 2010 at 8:39 AM, Georges Schutz
<georges.schutz at internet.lu> wrote:
> Hi Martin,
> It is good to hear that there are others facing the same problem because
> this my raise the importance of that issue for future plans.
>
> The solution you propose would be OK for me, I think I could live a
> while with being restricted to the proposed frequencies even if I would
> look foreword to customizable frequency on the long term.
>
> Thanks
> Georges Schutz
>
> On 05/05/2010 12:03, Martin Felder wrote:
>> Hi *,
>>
>> just for the record, I'm having the exact same problem as Georges. I
>> read through your discussion from three weeks ago, but I also don't feel
>> up to modifying the C code myself (being a Fortran kind of guy...).
>>
>> I understand implementing custom user-defined frequencies is probably a
>> lot of effort, but maybe it's less troublesome to just add some
>> frequencies often used (=by Georges and me, and hopefully others?) to
>> the currently implemented ones? I'd be extremely happy to have 12h, 6h,
>> 3h, 15min and 10min intervals in addition to the existing ones.
>>
>> If you could point me to the part of the code that would have to be
>> modified for that, maybe I can find someone more apt in C who can
>> implement it.
>>
>> Thanks,
>> Martin
>>
>>
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

On this note and per an offline discussion I had with Martin-- I'd be
interested to see what people think about the approach I've taken to
dealing with this problem in pandas
(http://code.google.com/p/pandas/). For example, it's relatively
trivial to do something like:

offset = Minute(15)
ts_15min = ts.asfreq(offset)

and to fill forward, interpolate the resulting series, among other
things. One of the key differences between the pandas data structures
and scikits.timeseries.TimeSeries is that data is not required to be
fixed-frequency, but can be explicitly "reindexed" to the desired
frequency. I find in my applications that I will often generate a
"date range of interest" (with the desired frequency) and then conform
all my data to that date range, e.g.:

conformed_data = data.reindex(date_range)

Of course you trade performance for flexibility. But IO is still by
and large the biggest bottleneck I've encountered.



More information about the SciPy-User mailing list