# 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