Sujay_K
Sujay_K

Reputation: 163

Is there a direct function in python to normalise values in a single column of a matrix?

Is there a function in any python library by which I can normalize certain columns of a matrix independently? For instance:

1 2 3
1 2 4
1 2 5

if I want a transformation of the above matrix to

1 1 3
1 1 4
1 1 5

i.e normalize the values in the 2nd column.

Thanks in advance.

Upvotes: 0

Views: 50

Answers (1)

Conrad Addo
Conrad Addo

Reputation: 440

Yes,

You can use np.linalg.norm

https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.norm.html

Upvotes: 1

Related Questions