If I have two lists
l1 = [ \'A\', \'B\' ] l2 = [ 1, 2 ]
what is the most elegant way to get a pandas data frame which looks like:
use product from itertools:
itertools
>>> from itertools import product >>> pd.DataFrame(list(product(l1, l2)), columns=['l1', 'l2']) l1 l2 0 A 1 1 A 2 2 B 1 3 B 2