python select matrix row code example
Example 1: print column in 2d numpy array
import numpy as np
x=np.arange(25).reshape(5,5)
print(x)
#print(x[:,index_of_column_you_need])
print(x[:,3])
Example 2: select certain element from ndarray python
# arr = [elements]
# new_arr = arr[condition]
# new_arr = [lements satisfying condition]
arr = [3, 6, 5, 9, 4, 12, 1]
new_arr = arr[arr%2 == 0]
new_arr = [6, 4, 12]