Run
import numpy as np arr_2d = np.array([[10, 5, 8], [4, 12, 6]]) median = np.median(arr_2d, axis=1) print(median)
Output