from pulp import *
unit = ["one", "two"]
time = range(2)
status=LpVariable.dicts("status",[(f,g) for f in unit for g in time],0,1,LpBinary)
Leads to
>>> status
{('two', 1): status_('two',_1),
('two', 2): status_('two',_2),
('one', 2): status_('one',_2),
('one', 0): status_('one',_0),
('one', 1): status_('one',_1),
('two', 0): status_('two',_0)}
So, there is no record with the key "one".
source
share