I am trying to construct a Dataframe from lists, which have similar-size lists inside.
In the example below I have 3 lists (with similar-size lists inside), which I want to use to construct an specific Dataframe.
Here are the lists:
list_type = [['A1', 'A2'], ['A2'], ['A1', 'A3', 'A4']]
list_xx = [['1', '5'], ['3'], ['2', '7', '3']]
list_date = [['Jan', 'Jan'], ['Feb'], ['Mar', 'Mar', 'Mar']]
And the Dataframe I want to construct is:
date type xx
0 Jan A1 1
1 Jan A2 5
2 Feb A2 3
3 Mar A1 2
4 Mar A3 7
5 Mar A4 3
As you can see, the structure of the Dateframe is based on the inner-lists.
I would really value an efficient way of doing this in Python.