title: Filtering a dataframe based on numerical values in a column
body: <p>I am trying to filter the rows in a dataframe based on the values of a column. If the numerical value is above 2, then it takes those rows, if it is below 2 it should not take those rows.
  Sample dataframe</p>
  <pre><code>| Number | Machine Name | Number of jobs|
  
  |:-------|:------------:| -------------:|
  
  | One    | Power Drill  | 1             |
  | Two    | Wench        | 3             |
  |Three   | Screwdriver  | 9             |
  
  </code></pre>
  <p>Desired outcome: The code should look at the third column &quot;Number of jobs&quot; and see if the number is greater than 2 then it should take it, else it should ignore it.
  This is my code:</p>
  <pre><code>import pandas as pd
  import openpyxl
  import glob
  import os
  
  source_folder = r'C:\Users\Ahmed_Abdelmuniem\Desktop\YYY'
  
  file_names = glob.glob(os.path.join(source_folder, '*.xlsm'))
  
  target_file = 'XXX.xlsm'
  
  table_2 = pd.read_excel(target_file)
  
  job_list = [3,4,5,6,7,8,9,10]
  new_df = table_2['Number of jobs'].isin(job_list)
  </code></pre>
  <p>I am getting the following error:</p>
  <pre><code>C:\Users\Ahmed_Abdelmuniem\AppData\Local\Programs\Python\Python39\python.exe &quot;C:/Users/Ahmed_Abdelmuniem/PycharmProjects/Rig Visualisation/main.py&quot;
  Traceback (most recent call last):
    File &quot;C:\Users\Ahmed_Abdelmuniem\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\base.py&quot;, line 3080, 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 101, in pandas._libs.index.IndexEngine.get_loc
    File &quot;pandas\_libs\hashtable_class_helper.pxi&quot;, line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File &quot;pandas\_libs\hashtable_class_helper.pxi&quot;, line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
  KeyError: 'Number of jobs'
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;C:\Users\Ahmed_Abdelmuniem\PycharmProjects\Rig Visualisation\main.py&quot;, line 57, in &lt;module&gt;
      new_df = table_2['Number of jobs'].isin(job_list)
    File &quot;C:\Users\Ahmed_Abdelmuniem\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\frame.py&quot;, line 3024, in __getitem__
      indexer = self.columns.get_loc(key)
    File &quot;C:\Users\Ahmed_Abdelmuniem\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\base.py&quot;, line 3082, in get_loc
      raise KeyError(key) from err
  KeyError: 'Number of jobs'
  
  Process finished with exit code 1
  
  </code></pre>
  <p>Edit: Upon further investigation I discovered the following:</p>
  <pre><code>  Unnamed: 0 Unnamed: 1 Unnamed: 2 Unnamed: 3
  0           NaN     Number   Machine Name       Jobs
  1           NaN          1      Power Drill    1
  2           NaN          2      Wench          4
  3           NaN          3      Screwdriver    5
  
  </code></pre>
  <p>It seems that pandas is not reading the column names, but rather it is reading them as unnamed, why is that?</p>