I have a 2D Numpy array in which I want to normalize each column to zero mean and a variance of one. Since I'm mainly used for C ++, the method I'm doing is to use loops to iterate over the elements in a column and perform the necessary operations, and then repeat this for all columns. I wanted to know about the pythonic way of doing this.
Let be class_input_datamy 2D array. I can get the column value as:
column_mean = numpy.sum(class_input_data, axis = 0)/class_input_data.shape[0]
Then I subtract the average from all the columns:
class_input_data = class_input_data - column_mean
Currently, the data must be null. However, the meaning:
numpy.sum(class_input_data, axis = 0)
0, , - . By 0, , .