Ok got it. I suggest you use a CategoryEncoder. See: How to encode categorical data using CategoryEncoder
CategoryEncoder