-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_data_handler.py
More file actions
34 lines (27 loc) · 1018 Bytes
/
test_data_handler.py
File metadata and controls
34 lines (27 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from src.data_handler import DataHandler
# Initialize handler
dh = DataHandler()
# Load data
print("\n=== LOADING DATA ===")
success = dh.load_csv('data/sample_survey.csv')
if success:
# Get summary
print("\n=== DATA SUMMARY ===")
summary = dh.get_data_summary()
for section, data in summary.items():
print(f"\n{section}:")
for key, value in data.items():
print(f" {key}: {value}")
# Get validation report
print("\n=== VALIDATION REPORT ===")
report = dh.get_data_validation_report()
print(f"Issues: {report['Data Quality Issues']}")
print(f"Recommendations: {report['Recommendations']}")
# Filter data
print("\n=== FILTERING DATA ===")
filtered = dh.filter_data(min_age=25, max_age=35, owns_crypto=True)
print(f"Found {len(filtered)} respondents aged 25-35 who own crypto")
# Export
print("\n=== EXPORTING DATA ===")
dh.export_cleaned_data('exports/data/cleaned_data.csv')
print("\n=== TEST COMPLETE ===")