I need to swap the list of names which is in the format of FirstName and LastName which in a dataframe one column, using python.
Below is the sample format: ~Adam Smith
The above need to change into ~Smith Adam
Is there any single line function available in python?
Could anyone help on this!!
print( " ".join(reversed("Adam Smith".split())))df.name.str.split().apply(lambda x: ' '.join(x[::-1]))