I have an optimization script which outputs data in a format similar to the fake lists below:
l1 = [1,2,3,4]
l2 = [[5,6,7,8],
[9,10,11,12]]
l3 = [[13,14,15,16],
[17,18,19,20]]
All lists are of the same length always (at least, the lists which contain values), but some are stored within a larger list container (l2 or l3 in this example). I ultimately want each individual list to be a separate column in a pandas dataframe (e.g., 1,2,3,4 is a column, 5,6,7,8 is a column, etc.). However, the number of lists within l2 or l3 will vary.
What is the best way to unpack these lists or otherwise get into a pandas dataframe?
What's throwing me off is doing this in a way which will always work regardless of the number of lists in l2 and l3.