D
dmitrey
howto make Python list from numpy.array?
Thx, D.
Thx, D.
dmitrey said:howto make Python list from numpy.array?
Thx, D.
lst = map(None, arr) // for 1D arrays.
Amaury said:Hello,
John Nagle a écrit :
Which can be expressed more simply as:
lst = list(arr)
dmitrey said:Thanks all.
I tried all the approaches but they don't work in my situation
I have a variable x that can be
x = 1
x = [1, 2, 3]
x = numpy.array([1,2,3])
so all troubles are with 1st caseTraceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
File "<string>", line 1, in <string>
ValueError: rank-0 arrays don't convert to lists.
Here I used Python 2.4.3, numpy 1.02
Thanks all.
I tried all the approaches but they don't work in my situation
I have a variable x that can be
x = 1
x = [1, 2, 3]
x = numpy.array([1,2,3])
so all troubles are with 1st case
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.