[SciPy-User] ERROR : while finding size

Joshua Holbrook josh.holbrook@gmail....
Thu Mar 3 03:12:45 CST 2011


Ooh, I got this.

If you're looking at something like a list or a tuple:

    > [in]:  a = [1, 2, 3]
    > [in]:  len(a)
    > [out]: 3

However, if you have a numpy array, you'll want to do this instead:

    > [in]: a = array([1, 2, 3])
    > [in]: a.shape
    > [out]: (3, )

That will give you a tuple with all your dimensions.

If you are already familiar with matlab, I would recommend this guy
for your basic numpy/scipy questions:

    http://www.scipy.org/NumPy_for_Matlab_Users

Cheers,

--Josh


On Wed, Mar 2, 2011 at 11:46 PM, ESKalaiyarasan
<eskalaiyarasan@gmail.com> wrote:
> hi,
>    I am Kalaiyarasan.I am doing my graduate degree in anna university
> chennai.I am using python pylab for my project.
>
> in matlab we can get input from user using x=input() command similarly in
> python we use x=raw_input() command
>
>
> but i want to how to know size of data, in matlab we use size(x) command
> return size (example 3 X 2). what is command for python?
>
>
> please help me.
>
>
>
> -Kalaiyarasan
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>


More information about the SciPy-User mailing list