Q:

How to make numpy 2D array back into python list

[array([868., 905.]), array([827., 905.]), array([785., 905.]), array([743., 905.]), array([701., 905.]), array([659., 905.]), array([617., 905.]), array([575., 905.]), array([533., 905.]), array([491., 905.]), array([449., 905.]), array([407., 905.]), array([365., 905.]), array([323., 905.]), array([281., 905.]), array([239., 905.]), array([197., 905.]), array([155., 905.])]

I need a way to turn this back into a list. I'm trying to run this code with that information:
values= #a is the array in the code above
keys = a
dictionary = dict(zip(keys, values))
#print(dictionary)

a=[]
for i in range(101,173):
    cv=str(i)
    a.append(cv)

print(a)

A:

You can do a simple list comprehension to do this task.
from numpy import array

a = [array([868., 905.]), array([827., 905.]), array([785., 905.]), array([743., 905.]), array([701., 905.]), array([659., 905.]), array([617., 905.]), array([575., 905.]), array([533., 905.]), array([491., 905.]), array([449., 905.]), array([407., 905.]), array([365., 905.]), array([323., 905.]), array([281., 905.]), array([239., 905.]), array([197., 905.]), array([155., 905.])]

l = [list(x) for x in a] # alternaltiely, l = [x.tolist() for x in a]

print(l)

# output
[[868.0, 905.0],
 [827.0, 905.0],
 [785.0, 905.0],
 [743.0, 905.0],
 [701.0, 905.0],
 [659.0, 905.0],
 [617.0, 905.0],
 [575.0, 905.0],
 [533.0, 905.0],
 [491.0, 905.0],
 [449.0, 905.0],
 [407.0, 905.0],
 [365.0, 905.0],
 [323.0, 905.0],
 [281.0, 905.0],
 [239.0, 905.0],
 [197.0, 905.0],
 [155.0, 905.0]]

