omartinsky / quantandfinancial Goto Github PK
View Code? Open in Web Editor NEWThis repository contains supporting examples which are referenced from posts published on www.quantandfinancial.com
This repository contains supporting examples which are referenced from posts published on www.quantandfinancial.com
ValueError Traceback (most recent call last)
in
2
3 display_assets(names, R, C, color='blue')
----> 4 display_frontier(res1, color='blue')
5 xlabel('variance
6 display(pandas.DataFrame({'Weight': res1.W}, index=names).T)
in display_frontier(result, label, color)
22 text(result.tan_var ** .5, result.tan_mean, 'tangent', verticalalignment='center', color=color)
23 scatter(result.tan_var ** .5, result.tan_mean, marker='o', color=color), grid(True)
---> 24 plot(result.front_var ** .5, result.front_mean, label=label, color=color), grid(True) # draw efficient frontier
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\pyplot.py in plot(scalex, scaley, data, *args, **kwargs)
2787 return gca().plot(
2788 *args, scalex=scalex, scaley=scaley, **({"data": data} if data
-> 2789 is not None else {}), **kwargs)
2790
2791
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes_axes.py in plot(self, scalex, scaley, data, *args, **kwargs)
1664 """
1665 kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
-> 1666 lines = [*self._get_lines(*args, data=data, **kwargs)]
1667 for line in lines:
1668 self.add_line(line)
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes_base.py in call(self, *args, **kwargs)
223 this += args[0],
224 args = args[1:]
--> 225 yield from self._plot_args(this, kwargs)
226
227 def get_next_color(self):
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes_base.py in _plot_args(self, tup, kwargs)
384
385 if len(tup) == 2:
--> 386 x = _check_1d(tup[0])
387 y = _check_1d(tup[-1])
388 else:
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook_init_.py in _check_1d(x)
1400 else:
1401 try:
-> 1402 x[:, None]
1403 return x
1404 except (IndexError, TypeError):
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\arrays\numpy_.py in getitem(self, item)
224 result = self._ndarray[item]
225 if not lib.is_scalar(item):
--> 226 result = type(self)(result)
227 return result
228
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\arrays\numpy_.py in init(self, values, copy)
132
133 if values.ndim != 1:
--> 134 raise ValueError("PandasArray must be 1-dimensional.")
135
136 if copy:
ValueError: PandasArray must be 1-dimensional.
I was wondering why the weighting’s of the portfolio didn’t change after running optimization with the user views. The output seems to be the same as the BL implied weighting’s.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.