Hello, can please help me, im trying to recreate portfolio optimization on my comp working in pycharm. but i getting this error message every time. I even copied and past each file from yours exercise but same error.
here are the files:
https://pastebin.com/7JwVGhKS - script
https://pastebin.com/x58nHRsG - rf
Traceback (most recent call last):
File “/PycharmProjects/Mean-variance-optimization/script1.py", line 29, in
weights, returns, risks = optimal_portfolio(returns_quarterly[1:])
File "/PycharmProjects/Mean-variance-optimization/rf.py", line 43, in optimal_portfolio
returns = np.transpose(returns.as_matrix())
File "***********/PycharmProjects/Mean-variance-optimization/venv/lib/python3.8/site-packages/pandas/core/generic.py”, line 5274, in getattr
return object.getattribute(self, name)
AttributeError: ‘DataFrame’ object has no attribute ‘as_matrix’