熊猫元组索引失败?

时间:2019-09-02 13:33:04

标签: python pandas

显然元组作为索引不起作用?还是这里出了什么问题?

import pandas as pd

dd=pd.DataFrame(["a"], index=[(0,1)])
dd.loc[(0, 1)]
# TypeError: cannot do label indexing on <class 'pandas.core.indexes.base.Index'> with these indexers [0] of <class 'int'>

0 个答案:

没有答案