Contact: aviboots(AT)netvision.net.il
39,938 questions
51,875 answers
573 users
lst = [['a', 'c', 'd'], ['u', 'v', 'w', 'x'], [1, 2, 3, 4]] first_items = [item[0] for item in lst] print(first_items) ''' run: ['a', 'u', 1] '''
lst = [['a', 'c', 'd'], ['u', 'v', 'w', 'x'], [1, 2, 3, 4]] first_items = list(zip(*lst))[0] print(first_items) ''' run: ['a', 'u', 1] '''
import numpy as np lst = np.array([['a', 'c', 'd'], ['u', 'v', 'w', 'x'], [1, 2, 3, 4]]) print(lst[0][0]) print(lst[1][0]) print(lst[2][0]) ''' run: a u 1 '''