Last active
September 30, 2017 16:14
-
-
Save PyDataBlog/429eb0ce34c99679c6680f67eb58d9e0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import numpy as np | |
| #store the variables in arrays | |
| prob = np.array([0.25, 0.5, 0.25]) | |
| rate_1 = np.array([0.05, 0.075, 0.10]) | |
| rate_2 = np.array([0.2, 0.15, 0.1]) | |
| # expected return of each investment | |
| expected_return1 = np.sum(prob * rate_1) | |
| expected_return2 = np.sum(prob * rate_2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment