title: Suddently I get this error "cannot set a Timestamp with a non-timestamp"
body: <p>Still feeling as a newbie. :-)</p>
  
  <p>For some time I have collected stock data from Yahoo both on a Linux Mint 18.2 32-bit and a new Linux Mint 18.2 64-bit.</p>
  
  <p>Suddenly today I get an error on my 64-bit system when plotting the data.
  The 32-bit system is working</p>
  
  <p>I get two errors: The first is: </p>
  
  <pre><code>The file pandas/_libs/index.pyx could not be opened.
  Reason: [Errno 2] Ingen sådan fil eller filkatalog: 'pandas/_libs/index.pyx'
  </code></pre>
  
  <p>It is correct that the file is not in _libs but it do not help to get it from Github and on the 32-bit system it is also missing.</p>
  
  <p>The 32-bit system has pandas 0.20.3 and the 64-bit system has pandas 0.21.0.</p>
  
  <p>I think is was updated when I installed the fix_yahoo_finance on the 64-bit system. My 32-bit system has an old version.
  The second error is: </p>
  
  <pre><code>Exception "unhandled ValueError"
  cannot set a Timestamp with a non-timestamp
  File: pandas/_libs/index.pyx, Line: 509
  </code></pre>
  
  <p>My code is:</p>
  
  <pre><code>import pandas as pd
  import csv
  import glob
  import matplotlib.pyplot as plt
  import pylab
  import numpy as np
  from matplotlib.widgets import CheckButtons
  import datetime
  
  
  startplot = datetime.datetime(2017,1,1)
  end = datetime.date.today()
  
  print(startplot)
  
  
  ferms = glob.glob("DOWJones_stock/*.csv")
  
  for ferm in ferms:
      data = pd.read_csv(ferm,  header=0)
      data['Date'] = pd.to_datetime(data['Date'])
      data["20d"] = np.round(data["Close"].rolling(window = 20, center = False).mean(), 2)
      data["70d"] = np.round(data["Close"].rolling(window = 70, center = False).mean(), 2)
      data['plot'] = (data['Date'] &gt; startplot) &amp; (data['Date'] &lt;= end) 
      plotdata=data[data['plot']]
      plotdata
      # print(data)
      # data.head()
      pylab.rcParams['figure.figsize'] = (25, 14)
      plt.rcParams['figure.dpi'] = 80
      plt.rcParams['legend.fontsize'] = 'medium'
      plt.rcParams['figure.titlesize'] = 'large'
      plt.rcParams['figure.autolayout'] = 'true'
      plt.rcParams['xtick.minor.visible'] = 'true'
      plt.rcParams['grid.linestyle'] = '-'
      plt.rcParams['grid.color'] = 'k'
      plt.xlabel('Date')
      plt.ylabel('Close')
      plt.title(ferm)
      plt.plot(plotdata.loc[:,'Date'], plotdata.loc[:,'Close'], 'k', label='Close')
      plt.plot(plotdata.loc[:,'Date'], plotdata.loc[:,'20d'], 'g', label='20d')
      plt.plot(plotdata.loc[:,'Date'], plotdata.loc[:,'70d'], 'r', label='70d')
      legend = plt.legend(loc='upper center', shadow=True)
      plt.grid(True)
      rax = plt.axes([0.9, 0.91, 0.1, 0.1], frameon=False)
      check = CheckButtons(rax, ('Køb', 'Følg'), (False, False))
      def func(label):
          if label == 'Køb':
              with open('Køb.csv','a') as csv_file:
                  writer = csv.writer(csv_file, delimiter=" ")
                  writer.writerow(ferm)
          elif label == 'Følg':
              with open('Følg.csv','a') as csv_file:
                  writer = csv.writer(csv_file, delimiter=" ")
                  writer.writerow(ferm)
      check.on_clicked(func)
      plt.show()
  </code></pre>
  
  <p>One .csv in the DOWJones_stock directory has following data:</p>
  
  <pre><code>Date,Open,High,Low,Close,Adj Close,Volume
  2015-12-31,52.799999,53.290001000000004,52.66,52.82,50.067657000000004,8292900
  2016-01-04,52.009997999999996,52.610001000000004,51.610001000000004,52.48,49.745384,17174600
  2016-01-05,52.790001000000004,53.470001,52.669998,53.150002,50.380466,11075500
  2016-01-06,52.509997999999996,52.950001,52.209998999999996,52.419998,49.688507,12465900
  2016-01-07,51.52,52.32,51.439999,51.959998999999996,49.252476,12720000
  </code></pre>
  
  <p>I have made some tests and it seems the line:</p>
  
  <pre><code>data['Date'] = pd.to_datetime(data['Date'])
  </code></pre>
  
  <p>is the main problem.
  But why only on my 64-bit system.
  The startplot date is plotted as 2017-01-01 00:00:00 but it is the same in both systems.</p>
  
  <p>I do not like to update pandas on my 32-bit system if the problem is pandas version 0.21.0</p>
  
  <p>Hope one of you more hard core guy's can help.</p>
  
  <p>Regards Henning</p>