def standardize(table, option):
if option == '<STR_LIT>':<EOL><INDENT>mean = np.mean(table)<EOL>std = np.std(table)<EOL><DEDENT>t = []<EOL>for row in table:<EOL><INDENT>t_row = []<EOL>if option != '<STR_LIT>':<EOL><INDENT>mean = np.mean(row)<EOL>std = np.std(row)<EOL><DEDENT>for i in row:<EOL><INDENT>if std == <NUM_LIT:0>:<EOL><INDENT>t_row.append(<NUM_LIT:0>)<EOL><DEDENT>else:<EOL><INDENT>t_row.append((i - mean)/std)<EOL><DEDENT><DEDENT>t.append(t_row)<EOL><DEDENT>return t<EOL>
standardize
Z = (X - mean) / (standard deviation)