[SciPy-Dev] Problem with manipulating dates in the time series object
gharras
gharras at ethz.ch
Wed Sep 22 08:06:47 EDT 2010
Hi there,
I really like the time series object from scipy but I have a problem
with manipulating dates.
Here is a copy from my ipython session:
-----------------------------------------------------------------------------
In [748]: myts=ts.time_series(data=n.arange(20).reshape(2,10).T,
dates=n.arange(10)+720000, freq='D')
In [749]: myts
Out[749]:
timeseries(
[[ 0 10]
[ 1 11]
[ 2 12]
[ 3 13]
[ 4 14]
[ 5 15]
[ 6 16]
[ 7 17]
[ 8 18]
[ 9 19]],
dates =
[17-Apr-1972 ... 26-Apr-1972],
freq = D)
In [750]: myts.dates[myts.weekday==1]+=1
In [751]: myts.dates
Out[751]:
DateArray([17-Apr-1972, 19-Apr-1972, 19-Apr-1972, 20-Apr-1972,
21-Apr-1972, 22-Apr-1972, 23-Apr-1972, 24-Apr-1972, 26-Apr-1972,
26-Apr-1972],
freq='D')
In [752]: myts.has_duplicated_dates()
Out[752]: False
-----------------------------------------------------------------------------
In words: I can change the dates by hand (in line 750), but the object
is not aware of it, i.e. it still thinks that it does not contain any
duplicates but the dates were however affected by the manipulation in
line 750, cf. line 751.
Is there a work-around?
all the best.
Cheers,
Georges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100922/08d7ff8c/attachment.html>
More information about the SciPy-Dev
mailing list