If a column exists between 2 dataframes, I want to drop it. I check if it exists and then try to drop it, but then it says that can't be found.
for column in positionsdf.columns:
if column in entrydf.columns:
entrydf = entrydf.drop(column)
error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-20-d9893719abf8> in <module>
1 for column in positionsdf.columns:
2 if column in entrydf.columns:
----> 3 entrydf = entrydf.drop(column)
...
...
...
KeyError: "['caseworker'] not found in axis"