title: Why am I receiving a key error using .loc on a known observation
body: <p>I'm getting a key error when trying to pull a row of my data by index.  I'm choosing the index based off looking at the <code>.head()</code> command so I know the value is there.  My index is based off of a policy id.  </p>
  
  <p>I've looked at a few posts like the following but they don't answer the question:
  <a href="https://stackoverflow.com/questions/50979589/keyerror-in-python-pandas-dataframe-using-loc">KeyError in Python Pandas dataframe using .loc</a></p>
  
  <p>Here is a screenshot of the data frame:
  <a href="https://i.stack.imgur.com/3KRCf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3KRCf.png" alt="enter image description here"></a></p>
  
  <p>Then I try:</p>
  
  <p><code>df_test.loc[92026963:]</code></p>
  
  <p>This gives me a key error.  Then I tried:</p>
  
  <pre><code>df_test.loc[92026963]
  </code></pre>
  
  <p>This gave me the same error.  I even tried putting the policy id in quotes.  Full traceback below:</p>
  
  <p>ValueError                                Traceback (most recent call last)
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_slice_bound(self, label, side, kind)
     4804             try:
  -> 4805                 return self._searchsorted_monotonic(label, side)
     4806             except ValueError:</p>
  
  <p>C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in _searchsorted_monotonic(self, label, side)
     4764 
  -> 4765         raise ValueError('index must be monotonic increasing or decreasing')
     4766 </p>
  
  <p>ValueError: index must be monotonic increasing or decreasing</p>
  
  <p>During handling of the above exception, another exception occurred:</p>
  
  <pre><code>KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-45-85aa3a940778&gt; in &lt;module&gt;
  ----&gt; 1 df_test.loc[92026963:]
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py in __getitem__(self, key)
     1498 
     1499             maybe_callable = com.apply_if_callable(key, self.obj)
  -&gt; 1500             return self._getitem_axis(maybe_callable, axis=axis)
     1501 
     1502     def _is_scalar_access(self, key):
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py in _getitem_axis(self, key, axis)
     1865         if isinstance(key, slice):
     1866             self._validate_key(key, axis)
  -&gt; 1867             return self._get_slice_axis(key, axis=axis)
     1868         elif com.is_bool_indexer(key):
     1869             return self._getbool_axis(key, axis=axis)
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py in _get_slice_axis(self, slice_obj, axis)
     1531         labels = obj._get_axis(axis)
     1532         indexer = labels.slice_indexer(slice_obj.start, slice_obj.stop,
  -&gt; 1533                                        slice_obj.step, kind=self.name)
     1534 
     1535         if isinstance(indexer, slice):
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in slice_indexer(self, start, end, step, kind)
     4671         """
     4672         start_slice, end_slice = self.slice_locs(start, end, step=step,
  -&gt; 4673                                                  kind=kind)
     4674 
     4675         # return a slice
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in slice_locs(self, start, end, step, kind)
     4870         start_slice = None
     4871         if start is not None:
  -&gt; 4872             start_slice = self.get_slice_bound(start, 'left', kind)
     4873         if start_slice is None:
     4874             start_slice = 0
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_slice_bound(self, label, side, kind)
     4806             except ValueError:
     4807                 # raise the original KeyError
  -&gt; 4808                 raise err
     4809 
     4810         if isinstance(slc, np.ndarray):
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_slice_bound(self, label, side, kind)
     4800         # we need to look up the label
     4801         try:
  -&gt; 4802             slc = self._get_loc_only_exact_matches(label)
     4803         except KeyError as err:
     4804             try:
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in _get_loc_only_exact_matches(self, key)
     4770         get_slice_bound.
     4771         """
  -&gt; 4772         return self.get_loc(key)
     4773 
     4774     def get_slice_bound(self, label, side, kind):
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
     2657                 return self._engine.get_loc(key)
     2658             except KeyError:
  -&gt; 2659                 return self._engine.get_loc(self._maybe_cast_indexer(key))
     2660         indexer = self.get_indexer([key], method=method, tolerance=tolerance)
     2661         if indexer.ndim &gt; 1 or indexer.size &gt; 1:
  
  pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
  
  pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.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: 92026963
  </code></pre>