Wadhwani Institute for Artificial Intelligence models may receive numeric feature matrices whose columns use very different scales. Implement column-wise feature scaling from scratch without NumPy, pandas, or other numerical libraries.
Given a non-empty rectangular matrix X and a method, return a new matrix with one independently scaled value for every input value.
method == "minmax", transform each column using (x - min) / (max - min), so its minimum becomes 0 and maximum becomes 1.method == "standard", transform each column using (x - mean) / standard_deviation, where the mean and standard deviation are computed across all rows. Use population standard deviation, dividing by the number of rows.0.0 for that entire column under either method.X.Input is X, a list of r rows, each containing c numeric values, and method, either "minmax" or "standard". Return a list of r rows containing floating-point values with the same shape as X.
def scale_features(X, method):