“Python Transpose List of Lists” Respostas de código

Lista de transposição de Python

list_of_lists = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

numpy_array = np.array(list_of_lists)
transpose = numpy_array.T

transpose_list = transpose.tolist()
Exuberant Eland

Python Transpose List of Lists

import numpy as np
a = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
np.array(a).T.tolist()
Xerothermic Xenomorph

Lista de Python Transpost

# Use numpy. T to transpose a list of lists, from kite.com

list_of_lists = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

numpy_array = np.array(list_of_lists)
transpose = numpy_array.T
transpose `numpy_array`

transpose_list = transpose.tolist()
Exuberant Eland

Respostas semelhantes a “Python Transpose List of Lists”

Perguntas semelhantes a “Python Transpose List of Lists”

Procure respostas de código populares por idioma

Procurar outros idiomas de código