On Sat, 2 Jan 2016 11:44 pm, Robert wrote: > Hi, > > I read a code snippet, in which object w_A is: > > > w_A > Out[48]: array([ 0.10708809, 0.94933575, 0.8412686 , 0.03280939, > 0.59985308])
w_A looks like a numpy array of five values. http://docs.scipy.org/doc/numpy/reference/arrays.html > Then, I don't know what is '[: ' below: > vs_A = w_A[:, None] * xs The syntax w_A[ ... ] is a "slice" of array w_A. Slicing means to create a new array from part of the original. None inside a numpy slice behaves as an alias for numpy.newaxis. http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html In this case, w_A[:, None] returns a "view" of the original w_A array. -- Steven -- https://mail.python.org/mailman/listinfo/python-list