I have a dataset in a dataframe form which the first column is a text and the second one it's an author. Authors are the labels for a classification task. I want to convert this column into numbers.
I tried to use the following code from How to convert string labels to numeric values
train['author'].apply(train['author'].index)
but it's not working. The output is
Int64Index object is not callable
Could you please help me?