title: Openpyxl: Adding A List Number To a "Delete List" List If Current Sheet Value Does Not Match A Value
body: <p>I'm reading through an excel spreadsheet trying to delete rows who's first column values don't match "36.0 ∞C" or "0.0 ∞C".  Right now I'm trying to just create a list of rows to delete so after I create a list of all the temperature values in the temperature column ("temperatureList") I can delete the rows that are in the "deleteCellList" list.  Here's my code:</p>
  
  <pre><code>temperatureList = []
  deleteCellList = []
  tempRowNumber = 1
  
  while currentRowValue:
      currentRowValue = sheet[(f"B{tempRowNumber}")].value
      print(type(currentRowValue))
      print("Current Row Value")
      print(currentRowValue)
      if currentRowValue != "0.0 ∞C":
          deleteCellList.append(tempRowNumber)
      elif currentRowValue != "18.0 ∞C":
          deleteCellList.append(tempRowNumber)
      else:
          temperatureList.append(currentRowValue)
      tempRowNumber += 1
  
  print("DCL")
  print(deleteCellList)
  </code></pre>
  
  <p>The problem I find I'm running into is that this algorithm is adding all of the cells where there should be maybe 5-6 values here, as shown by the following output:</p>
  
  <p>How it's not supposed to look:
  DCL
  [1,2,3,4.....]</p>
  
  <p>I'm trying to make it look like this:</p>
  
  <p>DCL
  [45, 78, 203, 408]</p>
  
  <p>I've tried printing each cell value, which returns something like "36.0 ∞C" so I don't think there are any rogue spaces that should be screwing it up.  That being said, I've tried everything I know up to this point, any intuitions out there on what the potential problem/solution could be here?  </p>