title: KeyError: None when making forecasting
body: <p>I have the following code to make DNN forecasting</p>
  <pre><code>forecast = []
  for time in range(len(series) - window_size):
    forecast.append(model.predict(series[time:time + window_size][np.newaxis]))
  
  forecast = forecast[split_time-window_size:]
  results = np.array(forecast)[:, 0, 0]
  
  
  plt.figure(figsize=(10, 6))
  
  plot_series(time_valid, x_valid)
  plot_series(time_valid, results)
  
  </code></pre>
  <hr />
  <pre><code>KeyError                                  Traceback (most recent call last)
  pandas/_libs/index.pyx in pandas._libs.index.DatetimeEngine.get_loc()
  
  pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
  
  pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
  
  KeyError: -9223372036854775808
  
  During handling of the above exception, another exception occurred:
  
  KeyError                                  Traceback (most recent call last)
  /usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
     2897             try:
  -&gt; 2898                 return self._engine.get_loc(casted_key)
     2899             except KeyError as err:
  
  pandas/_libs/index.pyx in pandas._libs.index.DatetimeEngine.get_loc()
  
  pandas/_libs/index.pyx in pandas._libs.index.DatetimeEngine.get_loc()
  
  KeyError: NaT
  
  The above exception was the direct cause of the following exception:
  
  KeyError                                  Traceback (most recent call last)
  5 frames
  KeyError: NaT
  
  The above exception was the direct cause of the following exception:
  
  KeyError                                  Traceback (most recent call last)
  /usr/local/lib/python3.7/dist-packages/pandas/core/indexes/datetimes.py in get_loc(self, key, method, tolerance)
      625             return Index.get_loc(self, key, method, tolerance)
      626         except KeyError as err:
  --&gt; 627             raise KeyError(orig_key) from err
      628 
      629     def _maybe_cast_for_get_loc(self, key) -&gt; Timestamp:
  
  KeyError: None
  </code></pre>
  <p>My time variable is dates</p>
  <pre><code>series=df['Close']
  time=pd.to_datetime(df.index)
  time
  </code></pre>
  <p>Thanks</p>