Generating a dataframe comprising of keys and values for a variable dict in LP model

PHOTO EMBED

Sun Jul 10 2022 13:38:12 GMT+0000 (Coordinated Universal Time)

Saved by @nilotpalc

# generating the list of keys building the variable dict
warehouselist =[]
for i in open_w:
    warehouselist.append(open_w[i])
# generating the list of associated values building the variable dict
warehouseopenvalues = []
for i in open_w:
    warehouseopenvalues.append(open_w[i].varValue)

#creating a dictionary for output
new_data = pd.DataFrame({"warehouse name":warehouselist,"warehouse open":warehouseopenvalues})
new_data
content_copyCOPY