title: pandas._libs.hashtable.PyObjectHashTable.get_item KeyError:
body: <p>when I try to change datatype to datetime format I faced above key error
  This is the code that I have been using for this project. I used a shop data to make sales forecasting system but I tried so many levels I couldn't understand what it means by keyError.</p>
  <pre><code>import warnings
  import pandas as pd  
  
  pizzahome=pd.read_excel('E:\machine learninig projects\pizzahome\sales.xlsx')
  
  pizzahome['da'] = pd.to_datetime(pizzahome[&quot;da&quot;])
  </code></pre>
  <p>This is the error I'm facing</p>
  <pre><code>E:\python\venv\Scripts\python.exe &quot;E:/machine learninig projects/machinelearningpractice.py&quot;
  Traceback (most recent call last):
    File &quot;E:\python\venv\lib\site-packages\pandas\core\indexes\base.py&quot;, line 2889, in get_loc
      return self._engine.get_loc(casted_key)
    File &quot;pandas\_libs\index.pyx&quot;, line 70, in pandas._libs.index.IndexEngine.get_loc
    File &quot;pandas\_libs\index.pyx&quot;, line 97, in pandas._libs.index.IndexEngine.get_loc
    File &quot;pandas\_libs\hashtable_class_helper.pxi&quot;, line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File &quot;pandas\_libs\hashtable_class_helper.pxi&quot;, line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
  KeyError: 'da'
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;E:/machine learninig projects/machinelearningpractice.py&quot;, line 18, in &lt;module&gt;
      pizzahome['da'] = pd.to_datetime(pizzahome['da'])
    File &quot;E:\python\venv\lib\site-packages\pandas\core\frame.py&quot;, line 2902, in __getitem__
      indexer = self.columns.get_loc(key)
    File &quot;E:\python\venv\lib\site-packages\pandas\core\indexes\base.py&quot;, line 2891, in get_loc
      raise KeyError(key) from err
  KeyError: 'da'
  
  Process finished with exit code 1
  </code></pre>
  <p>plese anybody help me to find out solution for it</p>