Given a df
4
0
3
3
3
and reference ndata_time='2019-01-15 7:00:00',
I would to create a new column but with an interval of 5sec
4 2019-01-15 7:00.00
0 2019-01-15 7:00.05
3 2019-01-15 7:00.10
3 2019-01-15 7:00.15
3 2019-01-15 7:00.20
However, I am having difficulties of setting the interval_range() function in Pandas.
Appreciate if someone can shed some light.
import pandas as pd
np.random.seed(0)
ndata_time='2019-01-15 7:00:00'
lapse=5 # unit in second
df=pd.DataFrame(np.random.randint(5,size=(5)),columns=['data'])