Python project for analyzing alarm data from building monitoring systems. Includes alarm analyzer, plotting, tests, and source data files.
45 lines
1.8 KiB
Python
45 lines
1.8 KiB
Python
#!/usr/bin/env python
|
|
# Check the output files to confirm sensor names are included
|
|
|
|
import pandas as pd
|
|
|
|
def check_output():
|
|
try:
|
|
print("Loading paired events CSV...")
|
|
paired_events = pd.read_csv('output/paired_alarm_events.csv')
|
|
print(f'Paired events CSV loaded successfully')
|
|
print(f'Shape: {paired_events.shape}')
|
|
print('Columns:', list(paired_events.columns))
|
|
|
|
# Show a few rows to verify sensor names are included
|
|
print('\nFirst 5 rows with Sensor_Id, Sensor_Name, Sensor_Group:')
|
|
cols_to_show = ['Sensor_Id', 'Sensor_Name', 'Sensor_Group', 'Alarm_Type', 'Duration_Minutes']
|
|
available_cols = [col for col in cols_to_show if col in paired_events.columns]
|
|
if available_cols:
|
|
print(paired_events[available_cols].head())
|
|
else:
|
|
print("Columns not found in paired events file")
|
|
|
|
print('\nSample of unique sensor names:')
|
|
if 'Sensor_Name' in paired_events.columns:
|
|
unique_names = paired_events['Sensor_Name'].unique()
|
|
print(f'Number of unique sensor names: {len(unique_names)}')
|
|
print('Sample sensor names:', unique_names[:10])
|
|
else:
|
|
print("Sensor_Name column not found in paired events")
|
|
|
|
print('\nSample of unique sensor groups:')
|
|
if 'Sensor_Group' in paired_events.columns:
|
|
unique_groups = paired_events['Sensor_Group'].unique()
|
|
print(f'Number of unique sensor groups: {len(unique_groups)}')
|
|
print('Sample sensor groups:', unique_groups[:10])
|
|
else:
|
|
print("Sensor_Group column not found in paired events")
|
|
|
|
except Exception as e:
|
|
print(f'Error reading output file: {e}')
|
|
import traceback
|
|
traceback.print_exc()
|
|
|
|
if __name__ == "__main__":
|
|
check_output() |