Datasets:
Download scripts/quick_start.py from ivanpodd/S-OH: direct link, hf CLI and curl.
- Browser
- Download file 622 Bytes
-
https://huggingface.co/datasets/ivanpodd/S-OH/resolve/refs%2Fpr%2F5/scripts/quick_start.py
- Command line
-
hf download hf://datasets/ivanpodd/S-OH@refs/pr/5/scripts/quick_start.py
-
curl -L -o quick_start.py https://huggingface.co/datasets/ivanpodd/S-OH/resolve/refs%2Fpr%2F5/scripts/quick_start.py
622 Bytes
| import json | |
| import pandas as pd | |
| # 1. Load metadata | |
| metadata = pd.read_csv('../metadata.csv') | |
| # 2. Load patient data via manifest | |
| with open('../data/manifest.json', 'r') as f: | |
| manifest = json.load(f) | |
| # 3. Load a specific patient | |
| patient_id = 1 | |
| entry = next(e for e in manifest['files'] if e['patient_id'] == patient_id) | |
| with open(f"../data/{entry['file']}", 'r') as f: | |
| patient_data = json.load(f) | |
| # 4. Extract eNose signals | |
| for sensor in patient_data['sensors']: | |
| if sensor['id'] == 'enose': | |
| for channel in sensor['channels']: | |
| print(f"{channel['id']}: {len(channel['samples'])} samples") | |