ProfessorLeVesseur commited on
Commit
91d4500
1 Parent(s): a7df111

Update data_processor.py

Browse files
Files changed (1) hide show
  1. data_processor.py +4 -1
data_processor.py CHANGED
@@ -198,7 +198,10 @@ class DataProcessor:
198
 
199
  def safe_convert_to_time(self, series, format_str='%I:%M %p'):
200
  try:
201
- return pd.to_datetime(series, format=format_str, errors='coerce')
 
 
 
202
  except Exception as e:
203
  print(f"Error converting series to time: {e}")
204
  return series
 
198
 
199
  def safe_convert_to_time(self, series, format_str='%I:%M %p'):
200
  try:
201
+ converted = pd.to_datetime(series, format='%H:%M:%S', errors='coerce')
202
+ if format_str:
203
+ return converted.dt.strftime(format_str)
204
+ return converted
205
  except Exception as e:
206
  print(f"Error converting series to time: {e}")
207
  return series