I want to perform an operation on a specific column of a pandas.dataframe.
From this:
# admit gre gpa rank
# 0 0 1123 3.61 3
# 1 1 4454 3.67 3
# 2 1 8000 4.00 1
# 3 1 6405 3.19 4
# 4 0 5205 2.93 4
I want to change the gre column this way: Select just the last two numbers.. (ex: df['gre':0] = 1123 => 23). I have a very big set of data so, I am looking for a simple way to do so without running through the pandas data frame, I tried the python for loop:
for i in df.index:
df.loc[i, 'gre'] = str(df.loc[i, 'gre'])[2:3]
This work but it take time.. A lot of it.. Thanks