I would like to create a SplitName() function that 1) converts all letters to lower case, 2) splits the name entry by space (ie. "John Snow" into "John" and "Snow") and 3) creates a data frame in Pandas that takes the split name entities and creates new columns (one as "first name" and another as "last name").
I am able to create new series variable from the data frame and manipulate the name entities into lower case and splitting by space. But I don't know how to create an overall data frame that takes in the original data frame's information as well as the new "lower-cased" and "split" variables information
def SplitName():
data = pd.read_csv("C:\data.csv")
frame2 = DataFrame(data)
frame2.columns = ["Name", "Ethnicity", "Event_Place", "Birth_Place"]
name_lower = frame2["Name"].str.lower() # make names lower case
name_split = name_lower.str.split() # split string element by space
name_split_smallList = name_split[0:10] # small set to easily handle
#print name_split_smallList
'''for lastName in name_split_smallList:
print lastName[0] + " " + lastName[-1]'''
name_lower_list = name_lower.tolist()
frame_all = frame2 + name_lower_list
print frame_all[0:10]