Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert list of lists to numpy array matrix python

x=[[1,2],[1,2,3],[1]]
y=numpy.array([numpy.array(xi) for xi in x])
type(y)
# <type 'numpy.ndarray'>
type(y[0])
# <type 'numpy.ndarray'>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #list #lists #numpy #array #matrix #python
ADD COMMENT
Topic
Name
1+8 =