def featurenormal(X, axis=0):
 mu = np.array(X).mean((not axis))
 X_norm = (X - mu.reshape(X.shape[0], (-1)))
 sigma = np.std(X_norm, axis=(not axis))
 X_norm = (X_norm / sigma.reshape(X.shape[0], (-1)))
 return (X_norm, mu, sigma)

def featurenormal ( X , axis = 0 ) : mu = np . array ( X ) . mean ( ( not axis ) ) X_norm = ( X - mu . reshape ( X . shape [ 0 ] , ( - 1 ) ) ) sigma = np . std ( X_norm , axis = ( not axis ) ) X_norm = ( X_norm / sigma . reshape ( X . shape [ 0 ] , ( - 1 ) ) ) return ( X_norm , mu , sigma )
x is n*m axis==0: columns axis==1: rows .