Iterate and change values of python numpy matrix columns

Published: 10/10/2019
Iterate and change values of python numpy matrix columns
Source: STACKOVERFLOW.COM

I have a numpy matrix containing numbers. 1,0,1,1 0,1,1,1 0,0,1,0 1,1,1,1 I would like to perform a Z-Score Normalization over each column; z_Score[y] = (y-mean(column))/sqrt(var) y being each element in the column, mean being the mean function, sqrt the squared root function and var the variance. My Approach was the following: x_trainT = x_train.T #transpose the matrix to iterate over columns for

Read more
Related news
Comment
FACEBOOK