def normalize_data(train_data, test_data):
	"""Normalize features with different scales and ranges.

	Subtract the mean of the feature and divide by the standard deviation.
	Test data is *not* used when calculating the mean and std.

	Args:
		train_data: (numpy.darray) Training data.
		test_data: (numpy.darray) Testing data.

	Returns:
		A tuple of training and test data.
	"""
	mean = train_data.mean(axis=0)
	std = train_data.std(axis=0)
	train_data = (train_data - mean) / std
	test_data = (test_data - mean) / std
	return train_data, test_data