Код: Выделить всё
time,prn,msg,CNR
248400000,010,1C,44.375
248401000,010,1C,41.9375
248402000,010,1C,41.9375
248402000,010,1C,40.0625
248404000,010,1C,49.0
248405000,010,1C,45.54
Код: Выделить всё
def gps_datetime(time_week, time_ms, leap_seconds=18):
gps_epoch = datetime(1980, 1, 6, tzinfo=pytz.utc)
return gps_epoch + timedelta(weeks=time_week,
milliseconds=time_ms,
seconds=-leap_seconds)
Код: Выделить всё
print(gps_datetime(2328, 248400000))Это дает следующий результат, который является правильным.
Код: Выделить всё
2024-08-20 20:59:42+00:00 Код: Выделить всё
df['Datetime'] = df.apply((lambda x: gps_datetime(2328,df.time)))Код: Выделить всё
TypeError: unsupported type for timedelta milliseconds component: SeriesКод: Выделить всё
df.time = pd.to_timedelta(df.time, unit='ms')У кого-нибудь есть предложения?
Подробнее здесь: https://stackoverflow.com/questions/790 ... om-start-o