I have to retreat a dataframe's column where all observations contain the same type of value, a string
as follows :
'Total: 1'
'Total: 1'
'Total: 2'
etc.
Then I try to run the apply method like this to the column evolLevel
which contains those strings :
df['evolLevel'].apply(lambda x: x[-1])
However it returns me the following error although this is still a string
variable :
'float' object is not subscriptable
I've also tried to specify axis=1
but it doesn't change anything.