Get last “column” after .str.split() operation on column in pandas DataFrame

I have a column in a pandas DataFrame that I would like to split on a single space. The splitting is simple enough with DataFrame.str.split(' '), but I can’t make a new column from the last entry. When I .str.split() the column I get a list of arrays and I don’t know how to manipulate this to get a new column for my DataFrame.

casting raw strings python

Given a variable which holds a string is there a quick way to cast that into another raw string variable? The following code should illustrate what I’m after: line1 = "hurr..n..durr" line2 = r"hurr..n..durr" print(line1 == line2) # outputs False print(("%r"%line1)[1:-1] == line2) # outputs True The closest I have found so far is the … Read more