fintechexplained / PortfolioOptimisation

33 stars 23 forks source link

Thanks a lot for sharing.. I'm facing below issue if you can please help .. #2

Open thakkar11 opened 4 years ago

thakkar11 commented 4 years ago
  1. Use Monte Carlo Simulation Completed Generating 0Portfolios Completed Generating 1Portfolios Completed Generating 2Portfolios Completed Generating 3Portfolios Completed Generating 4Portfolios Completed Generating 5Portfolios Completed Generating 6Portfolios Completed Generating 7Portfolios Completed Generating 8Portfolios Completed Generating 9Portfolios Traceback (most recent call last): File "main.py", line 73, in generate_optimum_portfolio() File "main.py", line 49, in generate_optimum_portfolio cp.plot_portfolios(portfolio_risk_return_ratio_df) File "/Users/xyz/Documents/abc/PythonFinancialmodelling/Investment_calculator/PortfolioOptimisation-master/code/chart_plotter.py", line 48, in plot_portfolios self.plot_single_point(x,y,'Portfolio: '+name, 'black') File "/Users/xyz/Documents/abc/PythonFinancialmodelling/Investment_calculator/PortfolioOptimisation-master/code/chart_plotter.py", line 21, in plot_single_point ha='center') # horizontal alignment can be left, right or center File "/Users/xyz/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2405, in annotate return gca().annotate(s, xy, *args, *kwargs) File "/Users/xyz/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 735, in annotate a = mtext.Annotation(s, xy, args, kwargs) File "/Users/xyz/anaconda3/lib/python3.7/site-packages/matplotlib/text.py", line 2192, in init Text.init(self, x, y, s, kwargs) File "/Users/xyz/anaconda3/lib/python3.7/site-packages/matplotlib/text.py", line 163, in init self.set_text(text) File "/Users/xyz/anaconda3/lib/python3.7/site-packages/matplotlib/text.py", line 1191, in set_text if s != self._text: File "/Users/xyz/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 1478, in nonzero .format(self.class.name)) ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
rotsen91 commented 4 years ago

I am facing this same issue, did you ever find a solution?

ZAtakan commented 4 years ago

unfortunately not brother

On Fri, Jun 19, 2020 at 9:51 PM Nestor Morales notifications@github.com wrote:

I am facing this same issue, did you ever find a 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/2#issuecomment-646815091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK76L2QJHKU67UZD7FZBDMLRXOXUHANCNFSM4KSDWZPQ .

-- Zafer Can Atakan

Business Development ExecutiveEUROPLAST ESTETIK

www.zaferatakan.com.tr www.europlastestetik.com http://www.europlastestetik.com

wbhinton commented 3 years ago

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.

VENTO-off commented 3 years ago

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

Thank you very much. You helped me a lot 👍