Jupyter notebook type:
Df=pd DataFrame (np) random) randint (0100, size=(6, 6)), the index=list (" ABCDEF "), the columns=pd. MultiIndex. From_product ([[' Python ', 'En', 'Math'], [' interim '[' final']]]])
Df
Error: TypeError: unhashable type: 'list'
Checked the list types cannot hash, how do I set the row index to list types? Also, why others V3.6.5 version of PYTHON is not an error?
CodePudding user response:
Df=pd DataFrame (np) random) randint (0100, size=(6, 6)), the index=list (" ABCDEF "), the columns=pd. MultiIndex. From_product ([[' Python ', 'En', 'Math'], [' interim ', 'final']]))
Should be like this, you are in the final added brackets on both sides
CodePudding user response: