import statistics


def _skew(values):
	""" This function calculates the skew value of the list
	of values which represents the difference between the mean
	and median which also corresponds to the skewness.
	Using the following formula ,
	(1/((n-1)*(n-2)))*(sum over i { ((values[i]-mean(values))/(std_dev))**3) }
	n -> number of values
	std_dev -> standard deviation of all values
	For documentation of this function refer to SKEW function
	available in Google Sheets

    Args:
        values : Type-list of numbers could be floating points
    Returns:
        floating point number represeting the skew value of values
	"""

	std_dev = statistics.pstdev(values)
	mean = statistics.mean(values)

	size = len(values)

	# If there is no deviation we assume to not have any skewness
	if std_dev == 0:
		return 0

	# If there are <=2 entries we assume to not have any skewness
	if size <= 2:
		return 0

	# Summation of skewness of each element
	skew_value = 0
	for x in values:
		skew_of_x = (x - mean) / std_dev
		skew_of_x = (skew_of_x)**3
		skew_value += skew_of_x

	#Normalizing skewness with the size of data
	skew_value = (skew_value * size) / ((size - 1) * (size - 2))

	return skew_value