import pandas as pd import numpy as np import math data = pd.read_csv('c:\housing.csv') room_nums = data['total_rooms'].tolist() room_mean = np.mean(room_nums) room_var = np.var(room_nums) print('%f %f' % (room_mean, room_var)) new_room = [(x-room_mean)/math.sqrt(room_var+0.001) for x in room_nums] print(new_room)