Is there an easy way to normalize ndarray (all values between 0.0, 1.0)?
For example, I have a matrix such as:
a = [[1., 2., 3.],
[4., 5., 6.],
[7., 8., 9.]]
So far I get the maximum value with
max(max(p[1:]) for p in a)
a / p
Also, I think numpy might have a method for doing this on a single line, this doesn't work if my data looks something like this:
b = [[-1., -2., -3.],
[-4., -5., -6.],
[-7., -8., 0.]]
Which gives an error caused by zero division.
, , , 1. , , 9 1 ( ) 0 ( ) 1 ( , ), , , , numpy .
numpy?
.