I have a CVS data from a log file:
UTC_TIME,FOCUS,IRIS,ZOOM,PAN,TILT,ROLL,LONGITUDE,LATITUDE,ALTITUDE,RED_RECORD
23:2:24.1, 10.9, 32.0, 180.0, 16.7, -29.5, -0.0, 151.206135, -33.729484, 1614.3, 0
23:2:24.2, 10.9, 32.0, 180.0, 16.7, -29.5, -0.0, 151.206135, -33.729484, 1614.3, 0
23:2:24.3, 10.9, 32.0, 180.0, 16.7, -29.5, -0.0, 151.206135, -33.729484, 1614.3, 0
This is my code so far:
vfx_df = pd.read_csv(data, header=0, low_memory=False)
I have to split the "nano" seconds off because they are in fps not nanoseconds.
vfx_df['UTC_TIME'] = vfx_df['UTC_TIME'].str.split('.', n = 1, expand=True)
vfx_df['UTC_TIME'] = pd.to_datetime(vfx_df['UTC_TIME'], format='%H:%M:%S')
vfx_df.set_index('UTC_TIME', inplace=True, drop=True)
vfx_df = vfx_df.tz_localize('UTC')
vfx_df = vfx_df.tz_convert('Australia/Sydney')
I am left with these results: 1900-01-02 09:32:20+10:05 how do I change the year,day,month to the date it was actually filmed on. consider also the course of filming can be over 6 hours so a UTC timestamp in the log can go to the next day in local time?
I have tried setting the origin on import and :
vfx_df['UTC_TIME'] = pd.to_datetime(vfx_df['UTC_TIME'], format='%H:%M:%S' unit='D' origin=(pd.Timestamp('2020-03-03')))
I have looked into TimeDeltas and offsets I just can't seem to get it... I just feel like I'm doing something wrong and would just love to see a more Pythonic way of doing this.
Thanks