user2229953 user2229953 - 2 years ago 201
Python Question

List to array conversion

I have a list in python and I want to convert it to an array to be able to use

ravel()
function.

Answer Source

Use numpy.asarray:

import numpy as np
myarray = np.asarray(mylist)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download