I'm trying to modify the string values in a dataframe column. So far I have tried this:
def years(x):
x = x.split(' ')[0]
x = x[-2:]
return x
df['Date'].apply(years)
When I run this and then take a look at the dataframe the actual df['Date'] column is unmodified.
For reference, I'm trying to change the column values from a string that looks like this, '12/21/15 20:30', into a string (or integer) that just includes the year, so in this case, '15'.