I have a pandas DataFrame having the following structure:
where time attribute/column represents some point in time from which measurements were taken for a particular animal, denoted by animal_id attribute. The measurements were x and y co-ordinates represented by attributes x and y respectively.
I want to convert time from int to datetime format. But when I do the following:
data['time'] = pd.to_datetime(data['time'])
The output of:
data['time'][:10]
is:
0 1970-01-01 00:00:00.000000001
1 1970-01-01 00:00:00.000000001
2 1970-01-01 00:00:00.000000001
3 1970-01-01 00:00:00.000000001
4 1970-01-01 00:00:00.000000001
5 1970-01-01 00:00:00.000000002
6 1970-01-01 00:00:00.000000002
7 1970-01-01 00:00:00.000000002
8 1970-01-01 00:00:00.000000002
9 1970-01-01 00:00:00.000000002
Name: time, dtype: datetime64[ns]
How do I specify two things in this:
- Starting date instead of 1970-01-01 to say 2019-05-10
- Specify differences between two consecutive times from the output in above to say differences between minutes
Thanks!
