Pandas documentation has given following code, which works fine:
frame = pd.DataFrame(np.arange(12).reshape((4, 3)),
index=[['a', 'a', 'b', 'b'], [1, 2, 1, 2]],
columns=[['Ohio', 'Ohio', 'Colorado'],
['Green', 'Red', 'Green']])
I tried following code, based on above concept, but it does not work:
hi5 = pd.DataFrame([[1,2,3],[4,5,6],[7,8,9],[10,11,12]],
index = [['a','a','a','b'],[1,2,3,1]],
columns=[['Ohio', 'Ohio', 'Colorado'],
['Green', 'Red', 'Green']])
It is giving Following error for above code:
AssertionError: 2 columns passed, passed data had 3 columns