I have a Pandas multi-index dataframe (Reg, Type, Part, IsExpired) -
Reg Type Part IsExpired Quantity
APAC Disk A False 10
True 12
EMEA Disk A False 22
EMEA Disk B False 13
True 17
I want to make sure that each (Reg, Type, Part) tuple has True and False for IsExpired. For example. I would like to insert a row for (EMEA, Disk, A, True) -
Reg Type Part IsExpired Quantity
APAC Disk A False 10
True 12
EMEA Disk A False 22
True 0 <-- inserted row
EMEA Disk B False 13
True 17
source
share