Issue
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]]
Solution
>>> a - a.min(axis=0)
array([[0, 4],
[2, 2],
[4, 0]])
Where axis=0
refers to columns.
Answered By - Sven Marnach
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.