Here's my data
my dataframe name is tab
user_id len
barcode
0 1 490
1 2 71
2 3 1
3 5 1
This is my code
tab = tab[tab[('len', 'barcode')]]
tab.columns
MultiIndex(levels=[['len', 'user_id'], ['barcode', '']],
labels=[[1, 0], [1, 0]])
This code on my routine notebook and works more than 10 times, but it not works anymore
df.columns
? – jezrael Oct 2 '17 at 6:13