通过from_tuple或from_arrays
① 直接从元组列表创建多重索引
tuples = [('A','a'),('A','b'),('B','a'),('B','b')]
mul_index...list构成的list
arr=np.random.randint(1,5,20).reshape(-1,2)
必须把array转化为list才能用pd.MultiIndex.from_tuples 函数创建层次化索引...指定df中的列创建(set_index方法)
传入两个以上的列名时,必须以list的形式传入(tuple不行)。...df_using_mul.loc['C_1']
如何获取次级索引为指定值的行??...4的列,分解开来看--列的筛选。