0

This loop works just fine, BUT the op_{cols} database rows sometimes have values that are the same in db_{cols} BUT have an extra space on the end.

op_{cols}|
----------
   IM    |
         |

db_{cols}|
----------
    IM   |
         |


My loop catches them as errors but I don't need those rows to be output to a list. Is there a way to reverse slice the rows in op_{cols} or any other way to just ignore the space while the loop is running?

pandasDF = test_df.toPandas()
for index, row in pandasDF.iterrows():
  if (pandasDF[f'op_{cols}'].equals(pandasDF[f'db_{cols}'])):
    continue
  else:
    comparison_issues_1.append(row)
Shawn N
  • 19
  • 3
  • Does this answer your question? [Pandas - Strip white space](https://stackoverflow.com/questions/43332057/pandas-strip-white-space) – Ynjxsjmh May 05 '22 at 17:35

0 Answers0