Python generate dates series

I just felt that it might be worthwhile to note that pandas also has this functionality. Depending on what case you are dealing with exactly, pandas might be a worthy tool to invest time in.

import pandas as pd 
times = pd.date_range('2012-10-01', periods=289, freq='5min')

This returns a pandas timeseries-index. Which can be converted to numpy arrays.

np.array(times)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)