in ssiog/metrics_per_minute_collector.py [0:0]
def process_csv(file, fs):
try:
with fs.open(file, 'r') as f:
df = pd.read_csv(f)
if 'sample_lat' not in df.columns:
logger.warning(f"File {file} does not contain 'sample_lat' column. Skipping file.")
return pd.DataFrame() # Return an empty DataFrame if no 'sample_lat' column
if not df.empty:
# Assuming 'timestamp' and 'sample_lat' columns are present
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='s')
return df
else:
return pd.DataFrame()
except Exception as e:
logger.error(f"Error processing file {file}: {e}")
return pd.DataFrame() # Return an empty DataFrame on error