中国的几个准则数据帧.xs()

2024-04-23 21:57:39 发布

您现在位置:Python中文网/ 问答频道 /正文

假设我有一个包含两个整数的多重索引,我想选择

where (level=0 in [0,1]) and (level=1 in [0,1])

(也就是说,我想要[[0,0], [0,1], [1,0], [1,1]

我该怎么做?你知道吗

.xs([0, 1], level=[0,1])给了我where level=0 in [0] and level=1 in [1],任何我尝试的有意义的东西都会导致键错误。你知道吗


Tags: andin错误整数wherelevel意义xs