File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,10 @@ cdef class DefaultHandler(EventHandler):
103103
104104
105105 df = pd.DataFrame(df_data, columns = self .columns)
106- time_columns = df.columns[df.columns.str.contains(' Time' )].tolist()
107- nanos = time_columns.pop(time_columns.index(' TimeNanos' )) if ' TimeNanos' in time_columns else None
106+ time_columns = (column for column in df.columns if ' Time' in column and ' TimeNanos' not in column)
108107 for column in time_columns:
109108 df.loc[:, column] = df.loc[:, column].astype(' datetime64[ms]' )
110- if nanos and ' Time' in time_columns :
111- df.loc[:, ' Time' ] += df.loc[:, nanos ].astype(' timedelta64[ns]' )
112- df.drop(columns = [nanos ], inplace = True )
109+ if ' TimeNanos ' in df.columns and ' Time' in df.columns :
110+ df.loc[:, ' Time' ] += df.loc[:, ' TimeNanos ' ].astype(' timedelta64[ns]' )
111+ df.drop(columns = [' TimeNanos ' ], inplace = True )
113112 return df
You can’t perform that action at this time.
0 commit comments