I have two pandas dataframes:
from pandas import DataFrame df1 = DataFrame({\'col1\':[1,2],\'col2\':[3,4]}) df2 = DataFrame({\'col3\':[5,6]})
I find using pandas MultiIndex to be the best tool for the job. If you have a list of lists lists_list, call pd.MultiIndex.from_product(lists_list) and iterate over the result (or use it in DataFrame index).
lists_list
pd.MultiIndex.from_product(lists_list)