Hi and thanks for the input. So, I reverted back to where I was to begin this post and took your suggestion to initialize with an empty dictionary as follows(please ignore all the comments):
{'20160101': ('20160101', 'Friday', "New Year's Day", '1', '-1'), '20160118': ('20160118', 'Monday', 'Martin Luther King Jr. Day', '1', '-1'), '20160216': ('20160216', 'Monday', "Washington's Birthday", '1', '-1'), '20160325': ('20160325', 'Friday', 'Good Friday', '2', '-1'), '20160530': ('20160530', 'Monday', 'Memorial Day', '1', '-1'), '20160704': ('20160704', 'Monday', 'Independence Day', '1', '-1'), '20160905': ('20160905', 'Monday', 'Labor Day', '1', '-1'), '20161124': ('20161124', 'Thursday', 'Thanksgiving Day', '1', '-2'), '20161225': ('20161225', 'Sunday', 'Christmas Day', '2', '-1'), '20170102': ('20170102', 'Monday', '1- JAN (Observed Monday, January 2)', '1', '-1'), '20170116': ('20170116', 'Monday', 'Monday, January 16', '1', '-1'), '20170220': ('20170220', 'Monday', 'Monday, February 20', '1', '-1'), '20170414': ('20170414', 'Friday', 'Friday, April 14', '1', '-1'), '20170529': ('20170529', 'Monday', 'Monday, May 29', '2', '-2'), '20170704': ('20170704', 'Tuesday', 'Tuesday, July 4*', '1', '-1'), '20170904': ('20170904', 'Monday', 'Monday, September 4', '1', '-1'), '20171123': ('20171123', 'Thursday', 'Thursday, November 23**', '1', '-1'), '20171225': ('20171225', 'Monday', 'Monday, December 25', '1', '-1'), '20180101': ('20180101', 'Monday', 'New Years Day', '1', '-1'), '20180115': ('20180115', 'Monday', 'Martin Luther King, Jr. Day', '1', '-1'), '20180219': ('20180219', 'Monday', "Washington's Birthday", '1', '-1'), '20180330': ('20180330', 'Friday', 'Good Friday', '1', '-1')....more}
This looks pretty good, but I guess I'd like to know what has actually been created. I have a KEY of that date referenced above, then the other attributes lumped together within () which looks like a LIST as maybe the VALUE of that date KEY??? Is that right?? I don't think it's created a DICT within a DICT or has it? Just trying to learn what's what even though I think I could make these results work, one way or another.
Again thanks.
reader=csv.reader(Holiday_File) Holiday_DICT={} #Holiday_DICT={'Holiday':1/1/1900,'Dayofwk':"Sunday",'Desc':"dummy",'Daystoadd':1,'Daystosubtract':-1} #Holiday_DICT={'Holiday':1/1/1900,(['Dayofwk','Desc','Daystoadd','Daystosubtract'])} x=0 for row in reader: #print(row[0],row[1],row[2],row[3],row[4]) item=row[0] #x=0 #Holiday_DICT[item]=row[0],row[1],row[2],row[3],row[4] #Holiday=row[0] #Dayofwk=row[1] #Desc=row[2] #Daystoadd=row[3] #Daystosubtract=row[4] Holiday_DICT[item]=row[0],row[1],row[2],row[3],row[4] #Holiday_DICT[Holiday]=Holiday #Holiday_DICT[Dayofwk]=Dayofwk #Holiday_DICT[Desc]=Desc #Holiday_DICT[Daystoadd]=Daystoadd #Holiday_DICT[Daystosubtract]=Daystosubtract #x=x+row #print("x: ", x) Holiday_File.close()Here are the results:
{'20160101': ('20160101', 'Friday', "New Year's Day", '1', '-1'), '20160118': ('20160118', 'Monday', 'Martin Luther King Jr. Day', '1', '-1'), '20160216': ('20160216', 'Monday', "Washington's Birthday", '1', '-1'), '20160325': ('20160325', 'Friday', 'Good Friday', '2', '-1'), '20160530': ('20160530', 'Monday', 'Memorial Day', '1', '-1'), '20160704': ('20160704', 'Monday', 'Independence Day', '1', '-1'), '20160905': ('20160905', 'Monday', 'Labor Day', '1', '-1'), '20161124': ('20161124', 'Thursday', 'Thanksgiving Day', '1', '-2'), '20161225': ('20161225', 'Sunday', 'Christmas Day', '2', '-1'), '20170102': ('20170102', 'Monday', '1- JAN (Observed Monday, January 2)', '1', '-1'), '20170116': ('20170116', 'Monday', 'Monday, January 16', '1', '-1'), '20170220': ('20170220', 'Monday', 'Monday, February 20', '1', '-1'), '20170414': ('20170414', 'Friday', 'Friday, April 14', '1', '-1'), '20170529': ('20170529', 'Monday', 'Monday, May 29', '2', '-2'), '20170704': ('20170704', 'Tuesday', 'Tuesday, July 4*', '1', '-1'), '20170904': ('20170904', 'Monday', 'Monday, September 4', '1', '-1'), '20171123': ('20171123', 'Thursday', 'Thursday, November 23**', '1', '-1'), '20171225': ('20171225', 'Monday', 'Monday, December 25', '1', '-1'), '20180101': ('20180101', 'Monday', 'New Years Day', '1', '-1'), '20180115': ('20180115', 'Monday', 'Martin Luther King, Jr. Day', '1', '-1'), '20180219': ('20180219', 'Monday', "Washington's Birthday", '1', '-1'), '20180330': ('20180330', 'Friday', 'Good Friday', '1', '-1')....more}
This looks pretty good, but I guess I'd like to know what has actually been created. I have a KEY of that date referenced above, then the other attributes lumped together within () which looks like a LIST as maybe the VALUE of that date KEY??? Is that right?? I don't think it's created a DICT within a DICT or has it? Just trying to learn what's what even though I think I could make these results work, one way or another.
Again thanks.