467,877 Members | 1,221 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

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

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
charles

Dec 10 '07 #1
  • viewed: 15838
Share:
1 Reply
On Dec 10, 5:22 pm, Charles Fox <charles....@gmail.comwrote:
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.
Dec 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Faheem Mitha | last post: by
1 post views Thread by Atul Kshirsagar | last post: by
5 posts views Thread by Randall Parker | last post: by
1 post views Thread by Gary Wessle | last post: by
2 posts views Thread by AWasilenko | last post: by
33 posts views Thread by christophertidy | last post: by
reply views Thread by jack112 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.