Skip to content

Instantly share code, notes, and snippets.

@HumanRupert
Created January 24, 2021 07:06
Show Gist options
  • Save HumanRupert/531610d72ba2d6990b1702a0bd20ed10 to your computer and use it in GitHub Desktop.
Save HumanRupert/531610d72ba2d6990b1702a0bd20ed10 to your computer and use it in GitHub Desktop.
ff3fm_factors
factors = pd.read_csv("./data/factors.csv", index_col="Date")
# convert Date index to datetime object
factors.index= pd.to_datetime(factors.index, format="%Y%m%d")
# get monthly avg
factors = factors.resample('BM').mean()
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