Solved by Eta_C in post #2 
              
              
                Do you mean 
import numpy as np

def data_norm(x):
    mu = x.mean(axis=1, keepdims=True)
    sigma = x.std(axis=1, keepdims=True)
    return (x-mu)/sigma