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

dmitrey dmitrey.kroshko at scipy.org
Wed Oct 1 09:34:30 EDT 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 at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>   




More information about the NumPy-Discussion mailing list