import pandas as pd if False: s = pd.Series([1,2,3,4,5]) def add_one(x): return x + 1 print s.apply(add_one) names = pd.Series([ 'Andre Agassi', 'Barry Bonds', 'Christopher Columbus', 'Daniel Defoe', 'Emilio Estevez', 'Fred Flintstone', 'Greta Garbo', 'Humbert Humbert', 'Ivan Ilych', 'James Joyce', 'Keira Knightley', 'Lois Lane', 'Mike Myers', 'Nick Nolte', 'Ozzy Osbourne', 'Pablo Picasso', 'Quirinus Quirrell', 'Rachael Ray', 'Susan Sarandon', 'Tina Turner', 'Ugueth Urbina', 'Vince Vaughn', 'Woodrow Wilson', 'Yoji Yamada', 'Zinedine Zidane' ]) def reverse_names(names): split_name = name.split(" ") first_name = split_name[0] last_name = split_name[1] return last_name + ', ' + first_name