I have two lists:
ind_vars_unique_list = [['R1'], ['Samoan', 'English'], ['Rural', 'Urban']]
ind_vars = ['Round', 'PrefLang', 'Rural']
I want to create a dictionary that looks like:
{'R1': 'Round', 'Samoan':'PrefLang', 'English':'PrefLang', 'Rural':'Rural', 'Urban':'Rural'}
I can get a solution using a dictionary comprehension approach:
{ind_vars_unique_list[i][j]:ind_vars[i] for i in range(len(ind_vars)) for j in range(len(ind_vars_unique_list[i]))}
But I am wondering if there is a cleaner or more pythonic way of doing this, maybe with dict and zip?