“Python Numpy Array zur Liste” Code-Antworten

nDarray zu listen

a = np.array([1, 2])
a.tolist()
Funny Frog

Python Numpy Array zur Liste

# Basic syntax:
numpy_array.tolist()

# Example usage:
your_array = np.array([[1, 2, 3], [4, 5, 6]])
your_array
--> array([[1, 2, 3],
           [4, 5, 6]])

your_array.tolist()
--> [[1, 2, 3], [4, 5, 6]]
Charles-Alexandre Roy

Python Numpy Matrix zur Auflistung

import numpy as np
x = np.matrix([[1,2,3],
               [7,1,3],
               [9,4,3]])
y = x.tolist()

y --> [[1, 2, 3], [7, 1, 3], [9, 4, 3]]
Obedient Opossum

Konvertieren Sie die Liste der Listen in 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'>
Anxious Alligator

Ähnliche Antworten wie “Python Numpy Array zur Liste”

Fragen ähnlich wie “Python Numpy Array zur Liste”

Weitere verwandte Antworten zu “Python Numpy Array zur Liste” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen