Last active
January 22, 2021 08:43
-
-
Save HumanRupert/136abb5df1735c677d9d81bf1edfb345 to your computer and use it in GitHub Desktop.
Visualize factors for Fama-French Three Factor Modal
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
from datetime import datetime | |
import pandas as pd | |
import numpy as np | |
from matplotlib import pyplot as plt | |
factors = pd.read_csv("./factors.csv", index_col="Date") | |
# convert Date index to datetime object | |
factors.index= pd.to_datetime(factors.index, format="%Y%m%d") | |
# calculate cumulative sum of factors | |
factors_cum = factors.cumsum() | |
factors_cum.plot.line() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment