Re: numpy column_stack - why does this work?

2015-11-16 Thread PythonDude
On Friday, 13 November 2015 18:17:59 UTC+1, Ian wrote: > On Fri, Nov 13, 2015 at 8:37 AM, PythonDude wrote: > > 3) I DON'T understand why the code doesn't look like this: > > > > means, stds = np.column_stack([ > > for _ in xrange(n_portfolios): &g

numpy column_stack - why does this work?

2015-11-13 Thread PythonDude
Hi all, Just a quick question about this code-piece (it works, I've tested it): means, stds = np.column_stack([ getMuSigma_from_PF(return_vec) for _ in xrange(n_portfolios) ]) 1) I understand column_stack does this (assembles vectors vertically, side-by-side): >>> a = np.array((1,2,3

Re: don't understand matrix-multiplication should be reversed in python?

2015-11-13 Thread PythonDude
On Thursday, 12 November 2015 22:57:21 UTC+1, Robert Kern wrote: > On 2015-11-12 15:57, PythonDude wrote: > > Hi all, > > > > I've come around a webpage with python-tutorial/description for obtaining > > something and I'll solve this: > > > > R =

Re: don't understand matrix-multiplication should be reversed in python?

2015-11-13 Thread PythonDude
On Thursday, 12 November 2015 17:35:39 UTC+1, Ian wrote: > On Thu, Nov 12, 2015 at 8:57 AM, PythonDude wrote: > > Hi all, > > Anyone could please explain or elaborate on exactly this (quote): "Keep in > > mind that Python has a reversed definition of rows and column

don't understand matrix-multiplication should be reversed in python?

2015-11-12 Thread PythonDude
Hi all, I've come around a webpage with python-tutorial/description for obtaining something and I'll solve this: R = p^T w where R is a vector and p^T is the transpose of another vector. ... p is a Nx1 column vector, so p^T turns into a 1xN row vector which can be multiplied with the Nx1 weig