[Numpy-discussion] why type(array(1).tolist()) is int?

dmitrey dmitrey.kroshko@scipy....
Wed Oct 1 08:34:30 CDT 2008


let me also note that list(array((1))) returns

Traceback (innermost last):
 File "<stdin>", line 1, in <module>
TypeError: iteration over a 0-d array

D.

dmitrey wrote:
> hi all,
> why array(1).tolist() returns 1? I expected to get [1] instead.
> D.
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>   



More information about the Numpy-discussion mailing list