array.shape() gives TypeError: 'tuple' object is not callable

C

Charles Fox

Hi gys -- I am looking at Numpy but getting this error when I try to
get array sizes. I'm using Ubuntu Edgy with standard repositories and
scipy. Any ideas? Am I doing something wrong or is it my install of
scipy?

$ python
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from numpy import *
a=array([[1,2],[3,4]])
a
array([[1, 2],
[3, 4]])Traceback (most recent call last):

thanks
charles
 
C

Chris

Hi gys -- I am looking at Numpy but getting this error when I try to
get array sizes. I'm using Ubuntu Edgy with standard repositories and
scipy. Any ideas? Am I doing something wrong or is it my install of
scipy?

$ python
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.>>> from numpy import *
a=array([[1,2],[3,4]])
a

array([[1, 2],
[3, 4]])>>> a.shape()

Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'tuple' object is not callable



thanks

use
a.shape
instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top