I have a 2D array, and I would like to find the min. value in every column and minus this min value in every column.
For example,
array = [
[1, 2, 4],
[2, 4, 6],
[5, 7, 9]]
The smallest values in columns are 1, 2, 4.
I would like the result to be
array = [
[0, 0, 0],
[1, 2, 2],
[4, 5, 5]]
How can I achieve this?
numpy.array()orpandas.DataFrame()then you could usearray.min()or maybearray.min(axis=???). And maybe evenarray = array - array.min()array-array.min(0)