fintechexplained / PortfolioOptimisation

33 stars 23 forks source link

AttributeError: 'DataFrame' object has no attribute 'ix' #3

Open duelistjp opened 3 years ago

duelistjp commented 3 years ago

got through some other issues so far but getting error here. any ideas how to fix? Traceback (most recent call last): File "C:\code\main.py", line 71, in generate_optimum_portfolio() File "C:\code\main.py", line 48, in generate_optimum_portfolio cp.plot_portfolios(portfolio_risk_return_ratio_df) File "C:\code\chart_plotter.py", line 26, in plot_portfolios max_sharpe_ratio = self.mc.get_max_sharpe_ratio(df) File "C:\code\calculator.py", line 35, in get_max_sharpe_ratio return df.ix[df['SharpeRatio'].astype(float).idxmax()] File "C:\Users*REDACTED*\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 5462, in getattr return object.getattribute__(self, name) AttributeError: 'DataFrame' object has no attribute 'ix'

Tak113 commented 3 years ago

same issue here. any workaround solution?

ZAtakan commented 3 years ago

Hello friend,

I'm posting a previous answer, I dont know if it works or not but you should give it a shot.

Weston Hinton @.**> Wed, Oct 7, 2020, 10:00 PM to Comment*, fintechexplained/PortfolioOptimisation, me

I found a solution to your problem. In chart_plotter.py change line 49 to read as follows: self.plot_single_point(x,y,'Equal Allocation', 'black') This should get you past this problem.

— You are receiving this because you commented. VENTO @.***> Fri, Nov 20, 2020, 7:13 PM to fintechexplained/PortfolioOptimisation, me, Comment

self.plot_single_point(x,y,'Equal Allocation', 'black')

Thank you very much. You helped me a lot 👍

— You are receiving this because you commented.

On Mon, Apr 26, 2021 at 8:01 PM Takuya (Tak) Abe @.***> wrote:

same issue here. any workaround solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fintechexplained/PortfolioOptimisation/issues/3#issuecomment-826999607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK76L2VNQ25IFKMI4YCVYBLTKWL6ZANCNFSM4XRFROGQ .

-- Zafer Can Atakan Business Development and Consultancy