List With Gigantic Array

Asked

Viewed 28 times

-2

The software like output a list with only one giant array:

[array([0.000000e+00, 1.687500e-01, 5.062500e-01, ..., 3.616745e+03,
   3.617745e+03, 3.618245e+03])]

My goal was to get a list, with each item of that array, separately. For this, I tried doing with the following code:

lst = [item.tolist() for item in lst]

However, my result only removes the "array" as the list continues with only one item.

list = [[0, 0.16, 0.501...]]

my goal was to list:

list = [0, 0.16, 0.501...]

1 answer

0


If there’s only one list inside another and you want to get the list from within, you can use:

list = lst[0]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.