'Generate a column of uniform timestamps between 2 time stamps
I have a dataset that does not have a time per each record. I however know the start and end time of the data. I also assume that all data points are recorded in equal intervals. Hence I would like to generate a new column 'time' of equally separated times between the start time and end time.
start_time= '2022:01:01:07:30'
end_time='2022:01:01:08:30'
data = {'rec' : ['rec1' for i in range(11)] ,
'readvalue' : [0.5 + 0.5*np.sin(2*np.pi/10*i)
for i in range(11)]}
df = pd.DataFrame(data, columns = [ 'rec', 'readvalue'])
df
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
