import logging


def get_var_info(var_list, lu_df):
	""" get variable types and labels from lookup data frame

	:param var_list: list of string variable names
	:param lu_df: column lookup dataframe ready from output of prep_acs.py

	:returns: dict with variable info ... keys=type,label
	"""

	vars = {v: {} for v in var_list}

	var_list = list(vars.keys())
	for v in var_list:
		if v not in lu_df['code'].values:
			logging.warning('{0} not a valid code'.format(v))
			del vars[v]
		else:
			# get var type and denominator
			temp = {'denom': '', 'denom_label': ''}
			temp['type'] = lu_df.loc[lu_df['code'] == v, 'type'].values[0]
			temp['label'] = lu_df.loc[lu_df['code'] == v, 'label'].values[0]

			vars[v] = temp

	return vars