def variance(x, mean):
	"""
	This function calculates the variance of the values in x
	It is equivalent to writing x.var()
	Args:
		x (np array): array
		mean (float): mean of x array
	Returns:
		float: variance (as x.var())
	"""
	
	#The generator creates a list of np arrays, so we select the first one
	return [(i-mean)**2 for i in x][0].sum()