turicreate.SArray.date_range¶
-
classmethod
SArray.
date_range
(start_time, end_time, freq)¶ Returns a new SArray that represents a fixed frequency datetime index.
Parameters: - start_time : datetime.datetime
Left bound for generating dates.
- end_time : datetime.datetime
Right bound for generating dates.
- freq : datetime.timedelta
Fixed frequency between two consecutive data points.
Returns: - out : SArray
Examples
>>> import datetime as dt >>> start = dt.datetime(2013, 5, 7, 10, 4, 10) >>> end = dt.datetime(2013, 5, 10, 10, 4, 10) >>> sa = tc.SArray.date_range(start,end,dt.timedelta(1)) >>> print sa dtype: datetime Rows: 4 [datetime.datetime(2013, 5, 7, 10, 4, 10), datetime.datetime(2013, 5, 8, 10, 4, 10), datetime.datetime(2013, 5, 9, 10, 4, 10), datetime.datetime(2013, 5, 10, 10, 4, 10)]