import csv

def is_num(number):
	try:
		float(number)
		return True
	except ValueError:
		return False
#_________________________________________

def get_mean(stat):
	converted_stat = 0.0
	if is_num(stat) != False:
		converted_stat = float(stat)
		return converted_stat
	else:
		return 0
#_________________________________________

def calculate_mean(flist):
	for x in range (6, 18):
		flist[x].mean /= flist[x].count
#_________________________________________

def get_mini(flist_x, row_x):
	convert_x = float(row_x)
	if convert_x < flist_x.mini:
		flist_x.mini = convert_x
	elif flist_x.mini == float('inf'):
		flist_x.mini = convert_x
#_________________________________________

def get_maxi(flist_x, row_x):
	convert_x = float(row_x)
	if convert_x > flist_x.maxi:
		flist_x.maxi = convert_x
	elif flist_x.maxi == float('inf'):
		flist_x.maxi = convert_x
#_________________________________________

def check_row(row, select_col):
	if is_num(row[select_col]) == True:
		return True
	else:
		return False
#_________________________________________

import csv

def is_num(number):
	try:
		float(number)
		return True
	except ValueError:
		return False
#_________________________________________

def get_mean(stat):
	converted_stat = 0.0
	if is_num(stat) != False:
		converted_stat = float(stat)
		return converted_stat
	else:
		return 0
#_________________________________________

def calculate_mean(flist):
	for x in range (6, 18):
		flist[x].mean /= flist[x].count
#_________________________________________

def get_mini(flist_x, row_x):
	convert_x = float(row_x)
	if convert_x < flist_x.mini:
		flist_x.mini = convert_x
	elif flist_x.mini == float('inf'):
		flist_x.mini = convert_x
#_________________________________________

def get_maxi(flist_x, row_x):
	convert_x = float(row_x)
	if convert_x > flist_x.maxi:
		flist_x.maxi = convert_x
	elif flist_x.maxi == float('inf'):
		flist_x.maxi = convert_x
#_________________________________________

def check_row(row, select_col):
	if is_num(row[select_col]) == True:
		return True
	else:
		return False
#_________________________________________

#_________________________________________ #_________________________________________ #_________________________________________ #_________________________________________ #_________________________________________ #_________________________________________