I have a large dataset where some of the rows are not placed in the right column. For example
data:
#DataFrame
data = {'Status': ['Active', 'Active', 'Active', 'Active','Active', 'Active'],
'Name': ['Tom', ' ', 'krish', ' ', 'Jack', 'Lisa'],
'Email': ['test@gmail.com', ' ', 'test@gmail.com', ' ', 'test@gmail.com', 'test@gmail.com'],
'Name2': [' ', 'John', ' ', 'Tim', ' ', ' '],
'Email2':[' ', 'test@gmail.com', ' ', 'test@gmail.com', ' ', ' ']}
#Print DataFrame
df = pd.DataFrame(data)
df
In this case, the column 'Name' and 'email' has some empty spaces because they were placed in the a new column called 'name2' and 'email2'
I would like to see if I can fill the empty spaces with the actual name and email that were misplaced in different columns.
I was trying to do some research but I did not find any significant information or I do not know if this is possible.
actual dataset:
Status Name Email Name2 Email2
Active Tom t@gmail.com
Active Tim t@gmail.com
Active Tom t@gmail.com
Active Tim t@gmail.com
Expected result
Name2 Name Email2
Active Tom t@gmail.com
Active Tim t@gmail.com
Active Tom t@gmail.com
Active Tom t@gmail.com