Closed spinGreekGod closed 3 years ago
Hey,
So you can see the error given is NameError: name 'display' undefined
.
To show the final dataframe, Empyrial uses the display function. I found this post that can help you : https://stackoverflow.com/questions/49328447/display-in-python
So basically I think it gives an errror because you're not in a jupyter notebook/google colab.
To solve this you will need to:
1) Install IPython (if it's not already done)
pip install IPython
or if you are running pip3:
pip3 install IPython
2) When the installation is completed, add this import at the beginning of your code:
from IPython.display import display
Tell me if works.
I'm going to solve this as soon as possible thanks for raising the problem!
Tried it in a jupyter notebook and it worked! thank you.
Usage
codeportfolio = Engine(
start_date= "2020-06-09", portfolio= ["BABA", "RELIANCE.NS", "KO", "^DJI","^IXIC"], weights = [0.2, 0.2, 0.2, 0.2, 0.2], #equal weighting by default benchmark = ["SPY"] )
empyrial(portfolio)