Hey,
I have a small problem trying to delete dates that already happened in the past. For each value I want to check if the current date is bigger than the value, if thats the case it should delete it from the values list. (Working in Notebook so I replaced self.Time with self.current_time)

My attempt so far:

self.current_time = datetime(2018, 1, 1, 0, 0)

for x in self.dict:
    print(x)
    for i in reversed(self.dict[x]):
        print(i)
        if self.current_time > i:
            print("yes")
            self.dict.pop(i)

Dictionary:

{'NEE': [datetime.datetime(2016, 2, 22, 0, 0),
  datetime.datetime(2016, 4, 29, 0, 0),
  datetime.datetime(2016, 7, 28, 0, 0),
  datetime.datetime(2016, 11, 1, 0, 0),
  datetime.datetime(2017, 2, 23, 0, 0),
  datetime.datetime(2017, 4, 21, 0, 0),
  datetime.datetime(2017, 7, 26, 0, 0),
  datetime.datetime(2017, 10, 26, 0, 0),
  datetime.datetime(2018, 2, 16, 0, 0),
  datetime.datetime(2018, 4, 24, 0, 0),
  datetime.datetime(2018, 7, 25, 0, 0),
  datetime.datetime(2018, 10, 23, 0, 0)],
 'WFC': [datetime.datetime(2016, 2, 24, 0, 0),
  datetime.datetime(2016, 5, 4, 0, 0),
  datetime.datetime(2016, 8, 3, 0, 0),
  datetime.datetime(2016, 11, 3, 0, 0),
  datetime.datetime(2017, 3, 1, 0, 0),
  datetime.datetime(2017, 5, 5, 0, 0),
  datetime.datetime(2017, 8, 4, 0, 0),
  datetime.datetime(2017, 11, 3, 0, 0),
  datetime.datetime(2018, 3, 1, 0, 0),
  datetime.datetime(2018, 5, 4, 0, 0),
  datetime.datetime(2018, 8, 3, 0, 0),
  datetime.datetime(2018, 11, 6, 0, 0)],
 'WMT': [datetime.datetime(2016, 3, 30, 0, 0),
...
  datetime.datetime(2017, 11, 22, 0, 0),
  datetime.datetime(2018, 3, 9, 0, 0),
  datetime.datetime(2018, 5, 31, 0, 0),
  datetime.datetime(2018, 8, 31, 0, 0),
  datetime.datetime(2018, 11, 28, 0, 0)]}

How it should look like for NEE:

{'NEE': [
  datetime.datetime(2018, 2, 16, 0, 0),
  datetime.datetime(2018, 4, 24, 0, 0),
  datetime.datetime(2018, 7, 25, 0, 0),
  datetime.datetime(2018, 10, 23, 0, 0)]}


I guess it has something to do with the positions when deleting values, how do I solve this problem?

Thanks in advance!