Last active
January 2, 2020 09:34
-
-
Save ShaneLee/56b914f002ec8bf336142f842cae6c53 to your computer and use it in GitHub Desktop.
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
def get_expected_portfolio_return(porfolio): | |
return np.sum(portfolio['weight'] * porfolio['returns']) | |
expected_portfolio_return = get_expected_portfolio_return(portfolio) | |
final_value = expected_portfolio_return * PORTFOLIO_VALUE | |
print('Estimated value of Portfolio in {} : £{:,.2f} \nExpected Portfolio Return: {:,.2f}%').format(datetime.now().year + YEARS, final_value, expected_portfolio_return) | |
print('Estimated Income £{:,.2f}').format(final_value * 0.04) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Shane,
thanks a lot for sharing. I found two small typos:
print('Estimated value of Portfolio in {} : £{:,.2f} \nExpected Portfolio Return: {:,.2f}%'.format(datetime.now().year + YEARS, final_value, expected_portfolio_return))
Line 8 should read:
print('Estimated Income £{:,.2f}'.format(final_value * 0.04))