Is there a way to find the median of each column in a ndarray. I tried the dumbest method using dual loop over each row to get the element column-wise and perform statstics.median on that and store it in a list.
But, as the dimensionality of the matrix grows, the time complexity will shoot up as well. Does Python have a better way to solve this?
arr = np.array([[1, 2, 3],[2,3,4],[3,4,5]])
print(arr)
array([[1, 2, 3],
[2, 3, 4],
[3, 4, 5]])
Expected output:
2,3,4