[Numpy-discussion] fixing up datetime
Wed Jun 8 19:53:09 CDT 2011
On Wed, Jun 8, 2011 at 4:57 AM, Wes McKinney <firstname.lastname@example.org> wrote:
> So in summary, w.r.t. time series data and datetime, the only things I
> care about from a datetime / pandas point of view:
> - Ability to easily define custom timedeltas
Can you elaborate on this a bit? I'm guessing you're not referring to the
timedelta64 in NumPy, which is simply an integer with an associated unit.
> - Generate datetime objects, or some equivalent, which can be used to
> back pandas data structures
Do you mean mechanisms to generate sequences of datetime's? I'm fixing up
arange to work reasonably with datetimes at the moment.
> - (possible now??) Ability to have a set of frequency-naive dates
> (possibly not in order).
This should work just as well as if you have an arbitrary set of integers
specifying the locations of the sample points.
This last point actually matters. Suppose you wanted to get the worst
> 5-performing days in the S&P 500 index:
> In : spx.index
> <class 'pandas.core.daterange.DateRange'>
> offset: <1 BusinessDay>, tzinfo: None
> [1999-12-31 00:00:00, ..., 2011-05-10 00:00:00]
> length: 2963
> # but this is OK
> In : spx.order()[:5]
> 2008-10-15 00:00:00 -0.0903497960942
> 2008-12-01 00:00:00 -0.0892952780505
> 2008-09-29 00:00:00 -0.0878970494885
> 2008-10-09 00:00:00 -0.0761670761671
> 2008-11-20 00:00:00 -0.0671229140321
> - W
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion