I have a dataset which contains multiple columns which has values in string format.Now i need to convert these text column to numeric values using labelEncoder. In below e,g y is target of my tain dataset and and A0 to A13 are different features . There are 50 more features but i have provided a subset here. Now how do i apply labelencoder on for dataset from A0 to A8 together and create a new encoded dataframe for creating the model ? I know we can do something like below, but this would say encode only one column. I want to encoder to be applied for all column from A0 to A8 and then feed the data to the model. How can i do that ?
from sklearn.preprocessing import LabelEncoder
gender_encoder = LabelEncoder()
y = gender_encoder.fit_transform(y)
Sample data below
y A0 A1 A2 A3 A4 A5 A6 A8 A10 A12 A13
0 130.81 k v at a d u j o 0 0 1
1 88.53 k t av e d y l o 0 0 0
2 76.26 az w n c d A j A 0 0 0
3 80.62 az t n f d A l e 0 0 0
4 78.02 az v n f d h d n 0 0 0