My code snippet will standardize the data (also knows as z-scores), so that it will have a zero mean and unit variance. I’m not sure I understand your use case completely. Would you like to pass any distribution to the normalization method and get a normal distribution as the output?