An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
September 17, 2022 08:28 am GMT
Original Link: https://dev.to/salahelhossiny/how-to-get-a-matric-columns-without-numpy-610
How to get matrix columns without numpy in Python
mat = [ [1, 2,3, 5], [4, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16] ]def convertToArr(el): return list(el)cols = list(map(convertToArr, list(zip(*mat))))print(cols) # [[1, 4, 9, 13], [2, 6, 10, 14], [3, 7, 11, 15], [5, 8, 12, 16]]
Original Link: https://dev.to/salahelhossiny/how-to-get-a-matric-columns-without-numpy-610
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To