-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5c87ca
commit e798721
Showing
35 changed files
with
1,803 additions
and
1,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,3 +148,4 @@ cython_debug/ | |
|
||
.ipynb_checkpoints | ||
_build | ||
code/data/S&P Target Date glidepath.xlsx |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pathlib import Path | ||
|
||
import numpy as np # Numerical Python | ||
import pandas as pd | ||
|
||
from estimark.parameters import final_age_data, initial_age | ||
|
||
file_path = ( | ||
Path(__file__).resolve().parent / ".." / "data" / "S&P Target Date glidepath.xlsx" | ||
) | ||
|
||
# Load data | ||
snp = pd.read_excel(file_path) | ||
|
||
# Filter data using loc | ||
snp = snp.loc[ | ||
(snp["Current Age"] >= initial_age) & (snp["Current Age"] <= final_age_data) | ||
] | ||
|
||
# Create age groups and code NaNs as 0 | ||
bins = range(initial_age, final_age_data + 1, 5) | ||
labels = np.arange(1, len(bins)) | ||
snp["age_groups"] = pd.cut(snp["Current Age"], bins=bins, labels=labels) | ||
|
||
# Get targeted moments |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.