views:

90

answers:

1

i am working with lists, and there is a function that is returning something that looks like this:

array([0, 5, 3, 3, 0, 1, 2])

how do i cast those values into a list?

what does array mean?

+7  A: 

array most likely refers to a numpy.array

myarray = array([0, 5, 3, 3, 0, 1, 2])
mylist = list(myarray)
awesomo
awesomo lol :D:D:D:D:D +2 for the nickname lol :D
Omu
for small arrays (30 elements or so on this computer) `myarray.tolist()` is faster
gnibbler