On 27.03.2012, at 2:07AM, Stephanie Cooke wrote:
> I am new to numpy. When I try to use the command array.shape, I get
> the following error:
>
> AttributeError: 'list' object has no attribute 'shape'
>
> Is anyone familiar with this type of error?
It means 'array' actually is not one, more precisely, not an object of type
np.ndarray.
How did you create your array? If it originates just from a list of numbers,
you can
create an array from it by 'np.array(list)' (assuming previous 'import numpy as
np').
It's also possible that a function has returned a list of arrays where you
might have
expected a single array - so it really depends on the circumstances.
HTH,
Derek
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion