BUG: Stack creates duplicate column · Issue #39481 · pandas-dev/pandas (original) (raw)
import numpy as np
import pandas as pd
df = pd.DataFrame(
np.zeros([1, 5]),
columns=pd.MultiIndex.from_tuples(
[
(0, None, None),
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
],
)
)
INSTALLED VERSIONS
------------------
commit : b5958ee1999e9aead1938c0bba2b674378807b3d
python : 3.6.6.final.0
pandas : 1.1.5
numpy : 1.17.4