Chọn cột trong ma trận

Print Friendly, PDF & Email

Select columns in matrix

from operator import itemgetter
nested_list = [[1, 2, 3], [10, 20, 30], [100, 200, 300]]
map(itemgetter(1), nested_list)

Result: [2, 20, 200]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code

This site uses Akismet to reduce spam. Learn how your comment data is processed.