51 cropyear = valid.year + 1
52 plantdates[site][cropyear].append(valid)
53
54for site in plantdates.keys(): 55 climate_site = sitemeta[site]["climate_site"]
56 table = "alldata_%s" % (climate_site[:2],)
57 for yr in range(2011, 2014):
57 e.append(col)
58 print(extract)
59 mydict = {}
60 for plotid in extract.keys(): 61 mydict[plotid] = df[extract[plotid]].copy()
62 rename = {df.columns[0]: "valid"}
63 for col in mydict[plotid].columns[1:]:
Consider iterating the dictionary directly instead of calling .keys()
.
Using for key in dictionary
would always iterate the dictionary keys.
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds.keys():
print(key)
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds:
print(key)