How to print numpy 2D array in Python

1 Answer

0 votes
import numpy as np
 
arr2d = np.array([[4, 8, 2, 5], [6, 9, 7, 3]])
 
for row in arr2d:
    for val in row:
        print(val) 

 
 
'''
run:
 
4
8
2
5
6
9
7
3

'''

 



answered Aug 9, 2022 by avibootz
...