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

Alan G Isaac aisaac at american.edu
Wed Oct 1 09:46:47 EDT 2008


On 10/1/2008 9:04 AM dmitrey apparently wrote:
> why array(1).tolist() returns 1? I expected to get [1] instead.

I guess I would expect it not to work at all.
Given that it does work, this seems the best result.
What list shape matches the shape of a 0-d array?

What is the use case that makes this seem wrong?

Alan Isaac




More information about the NumPy-Discussion mailing list