Wed, 27 Aug 2008 16:48:48 +0200, Claude Gouedard wrote: > Hi , > > I'm just surprised by the behaviour of numpy.asarray on lists. > > Can someone comment this : > ===================== > a=(1) > aa=asarray(a) > print aa.size , aa.shape >>> 1 ( ) > =====================
() are not list delimiters in Python; [] are, see [1,2]: >>> a = (1) >>> type(a) <type 'int'> >>> a = [1] >>> type(a) <type 'list'> .. [1] http://docs.python.org/tut/node5.html#SECTION005140000000000000000 .. [2] http://docs.python.org/tut/node7.html#SECTION007300000000000000000 -- Pauli Virtanen _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
