[Numpy-discussion] Converting a list

Nadav Horesh nadavh at visionsense.com
Tue Jul 11 00:33:41 CDT 2006

Do you mean:
>> map(shape, data)

-----Original Message-----
From:	numpy-discussion-bounces at lists.sourceforge.net on behalf of Nils Wagner
Sent:	Mon 10-Jul-06 12:26
To:	numpy-discussion at lists.sourceforge.net
Subject:	[Numpy-discussion] Converting a list

Hi all,

I have a list consisting of arrays of different size

data =  [array([-1.        +0.j, -1.33333333+0.j, -1.66666667+0.j]),
array([-2.+0.j        , -2.-0.66666667j, -2.-1.33333333j]),
array([-2.        -2.j, -1.33333333-2.j, -0.66666667-2.j]), array([
0.-2.j        ,  0.-1.66666667j,  0.-1.33333333j]), array([ 
6.12323400e-17-1.j        ,  -2.58819045e-01-0.96592583j,
        -5.00000000e-01-0.8660254j ,  -7.07106781e-01-0.70710678j,
        -8.66025404e-01-0.5j       ,  -9.65925826e-01-0.25881905j])]

type(data) =  <type 'list'>

shape(data) results in

shape(data) =
Traceback (most recent call last):
  File "sinai.py", line 107, in ?
    p = polygon(P)
  File "sinai.py", line 67, in polygon
    print 'shape(data) = ',shape(data)
  File "/usr/lib64/python2.4/site-packages/numpy/core/fromnumeric.py",
line 258, in shape
    result = asarray(a).shape
  File "/usr/lib64/python2.4/site-packages/numpy/core/numeric.py", line
119, in asarray
    return array(a, dtype, copy=False, order=order)
TypeError: a float is required

Is this a bug ?


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net

More information about the Numpy-discussion mailing list