Skip to content

Instantly share code, notes, and snippets.

@ShaneLee
Created December 27, 2019 15:28
Show Gist options
  • Save ShaneLee/19190f89703aa70110cc0f433118a584 to your computer and use it in GitHub Desktop.
Save ShaneLee/19190f89703aa70110cc0f433118a584 to your computer and use it in GitHub Desktop.
def get_portfolio():
with open('portfolio.json', 'r') as portfolio_file:
portfolio_json = portfolio_file.read()
return json.loads(portfolio_json)['portfolio']
portfolio_data = get_portfolio()
portfolio = pd.DataFrame(portfolio_data).assign(returns = [get_data(stock) for stock in portfolio_data])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment