I want to build the following DataFrame:
num | col1 | col2
a | 1 | 3
| 2 | 4
| 8 | 2
b | 0 | 9
| 4 | 2
| 3 | 1
I tried the following but did not know how of include the column num
col1 = [1, 2, 8, 0, 4, 3]
col2 = [3, 4, 2, 9, 2, 1]
num = ['a', 'b']
d = pd.DataFrame({'col1': col1, 'col2': col2}, index=num)