Download test_parse.py from calibrationcomp/calibration_benchmark: direct link, hf CLI and curl.
- Browser
- Download file 690 Bytes
-
https://huggingface.co/spaces/calibrationcomp/calibration_benchmark/resolve/refs%2Fpr%2F14/test_parse.py
- Command line
-
hf download hf://spaces/calibrationcomp/calibration_benchmark@refs/pr/14/test_parse.py
-
curl -L -o test_parse.py https://huggingface.co/spaces/calibrationcomp/calibration_benchmark/resolve/refs%2Fpr%2F14/test_parse.py
690 Bytes
| import pandas as pd | |
| import xarray as xr | |
| from pathlib import Path | |
| file_path = Path("data/bayesian/l63_hm.nc") | |
| with xr.open_dataset(file_path) as dataset: | |
| metric = dataset["metric"] | |
| metric = metric.where(metric != -1) | |
| metric_mean = metric.mean(dim="random_seed", skipna=True) | |
| df = metric_mean.to_dataframe(name="metric").reset_index() | |
| print(df.head()) | |
| file_path_abc = Path("data/bayesian/l63_abc.nc") | |
| with xr.open_dataset(file_path_abc) as dataset: | |
| metric = dataset["metric"] | |
| metric = metric.where(metric != -1) | |
| metric_mean = metric.mean(dim="random_seed", skipna=True) | |
| df = metric_mean.to_dataframe(name="metric").reset_index() | |
| print(df.head()) | |