Hi I have 2 data frames with multiple columns but just showing relevant columns only:
df1:
Column A
CharlesBarkley
Michael Jordan
df2:
Column A / Column B
charles barkley / Yes
MichaelJordan / No
I want to achieve the following:
-
I want to first compare df1's Column A to df2's Column A ignoring the space and case-sensitive and making everything lower-case with no space (so it can be michaeljordan).
-
If Column B says No, I want to create a new column and output only the rows that the name matches AND having 'No' for Column B on df2, with the word 'Not Registered' in Python print as follows:
Column A / Result
michaeljordan / Not Registered
How would I be able to achieve this with the Python code?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire