Skip to content

Instantly share code, notes, and snippets.

@databyjp
Created March 29, 2021 04:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
temp_syms = [s for s in list(sp500_df[sp500_df.Sector == sect].Symbol.values) if s in df.symbol.unique()]
temp_syms = random.sample(temp_syms, n_symbols)
pf1_df = df[df.symbol.isin(temp_syms)]
pf1_avg = get_avg_prices(pf1_df)
pf1_var = pf1_avg.var()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment