Can anyone help with a snippet of code using numpy and python?
Given an numpy array such as
a = array([[1,11], [3,9], [5,7]]
I want to find the minimun value of each column, so 1 and 7 and then subtract this value from the respective columns,
a = array([[0,4], [2,2], [4,0]]
>>> a - a.min(axis=0) array([[0, 4], [2, 2], [4, 0]])
Where axis=0
refers to columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With