File size: 690 Bytes
baf1286 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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())
|