I have to clean a database
Id FirstName LastName
12 Jannie Pretorious
15 Elsa Van Niekerk
14 Koos SC$ 4 MMV Extraction SHift B
I want to remove the values that aren't LastNames, in this example id 14 : Koos SC$ 4 ...
I can identify a faulty lastname if there is more than two spaces within the cell value.
I want to iterate through the df and replace all values, with more than two spaces, with ''.
I have looked at this question Conditional Replace Pandas, but it didn't help me.
Expected output:
Id FirstName LastName
12 Jannie Pretorious
15 Elsa Van Niekerk
14 Koos