我有一个和这个问题非常相似的数据框架:Pandas: drop a level from a multi-level column index?cols = pd.MultiIndex.from_tuples([("a", "b"), ("a", "c")]) ---+----+---+--1 | 3 | 4 在上面的问题引用
数据帧的一个例子是: Timestamp IP Packets1 2021-07Original error is below:NotImplementedError('Can only union MultiIndex withMultiIndex or Index of tuples, try mi.to_flat_index().union(other