Skip to content

Commit d954718

Browse files
committed
Starting example
1 parent bd17623 commit d954718

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

example.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from pyacm import NominalACM
2+
3+
import matplotlib.pyplot as plt
4+
import pandas as pd
5+
import numpy as np
6+
7+
# Read and plot data
8+
yield_curve = pd.read_csv(
9+
"sample_data/di monthly maturities.csv",
10+
index_col=0,
11+
)
12+
yield_curve = yield_curve.iloc[:, :120] # maturities up to 10y
13+
yield_curve = yield_curve.dropna()
14+
yield_curve.index = pd.to_datetime(yield_curve.index)
15+
16+
yield_curve[["12m", "24m", "60m", "120m"]].plot(legend=True, title="Yields for Selected Maturities", grid=True)
17+
plt.tight_layout()
18+
plt.show()

0 commit comments

Comments
 (0)