In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
%load_ext autoreload
%autoreload 2
In [2]:
num_samples, num_features = 10, 5
In [3]:
np.random.seed(10)
data = np.random.rand(num_samples, num_features)
In [4]:
print(data)
In [5]:
np.mean(data, axis=0)
Out[5]:
In [6]:
centered_data = data - np.mean(data, axis=0)
In [7]:
std_data = centered_data / np.std(centered_data, axis=0)
In [8]:
print(std_data, "\n\n", np.mean(std_data, axis=0), "\n\n", np.std(std_data, axis=0))
In [ ]: