-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_table.py
35 lines (29 loc) · 902 Bytes
/
view_table.py
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
35
"""View experiment results."""
# %%
from pathlib import Path
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib import ticker
EXPERIMENT_ID = 1
FLOAT_FMT = ",.0f"
experiment_path = Path("/code/experiments/experiments") / f"exp_{EXPERIMENT_ID}"
results1 = pd.read_parquet(experiment_path / "results1.parquet")
results2 = pd.read_parquet(experiment_path / "results2.parquet")
# %%
if results1.shape[0] > 0:
print("material non-WETH positions:")
display(results1.style.hide(axis="index"))
else:
print("no material non-WETH positions")
print("WETH positions:")
display(
results2.style.format(
subset=[col for col in results2.columns if results2.dtypes[col] == "float64" and col not in ["hpr", "apr"]],
formatter="{:" + FLOAT_FMT + "}",
)
.hide(axis="index")
.format(
subset=["hpr", "apr"],
formatter="{:.2%}",
)
)