From b27fbeadc1ee68e49d18269f321acf8f78a4f747 Mon Sep 17 00:00:00 2001 From: Daniel Pelaez-Zapata Date: Thu, 5 Dec 2024 09:27:09 +0100 Subject: [PATCH] pull request merged --- ewdm/sources.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ewdm/sources.py b/ewdm/sources.py index 12d0886..3e27d84 100644 --- a/ewdm/sources.py +++ b/ewdm/sources.py @@ -60,13 +60,13 @@ def read_dataset(self): self.fname, names=columns, header=None, skiprows=1 ) - - # Format the 'msec' column to be three digits + # format the 'msec' column to be three digits data['msec'] = data['msec'].apply(lambda x: f'{int(x):03}') # print(data['msec']) - # Combine the desired date-time columns and convert them to datetime - # Here, we concatenate the time components and ensure the millisecond part is correctly formatted + # combine the desired date-time columns and convert them to datetime + # here, we concatenate the time components and ensure the + # millisecond part is correctly formatted data["time"] = pd.to_datetime( data['year'].astype(str) + '-' + data['month'].astype(str) + '-' + @@ -74,8 +74,8 @@ def read_dataset(self): data['hour'].astype(str) + ':' + data['min'].astype(str) + ':' + data['sec'].astype(str) + '.' + - data['msec'], # Concatenate using three-digit milliseconds - format="%Y-%m-%d %H:%M:%S.%f" # Use .%f to parse the millisecond part + data['msec'], # concatenate using three-digit milliseconds + format="%Y-%m-%d %H:%M:%S.%f" # use .%f to parse the millisec part ) data = data.drop(columns=columns[:7])