[SciPy-User] scipy.signal.resample muffs my timestamps?

Skip Montanaro skip at pobox.com
Tue Jan 20 14:36:35 EST 2015


I managed to download, build and install scipy 0.15.1.  I get a
similar (though quantitatively different) result.

>>> len(t)
430509
>>> len(x)
430509
>>> res_x, res_t = signal.resample(x[::100], 250, t[::100])
>>> len(res_x)
250
>>> len(res_t)
250
>>> t[-1]
1421733595.509921
>>> res_t[-1]
1422456460.5224724
>>> pprint([datetime.datetime.fromtimestamp(t[0]),
            datetime.datetime.fromtimestamp(t[-1])])
[datetime.datetime(2015, 1, 12, 0, 0),
 datetime.datetime(2015, 1, 19, 23, 59, 55, 509921)]
>>> pprint([datetime.datetime.fromtimestamp(res_t[0]),
            datetime.datetime.fromtimestamp(res_t[-1])])
[datetime.datetime(2015, 1, 12, 0, 0),
 datetime.datetime(2015, 1, 28, 8, 47, 40, 522472)]

I assume I'm doing something wrong to cause it to expand the range
like that. I didn't see any arguments in the help() output which
obviously suggested I could change this particular behavior though.




More information about the SciPy-User mailing list