This article is a section of the article ML Feature Engineering: from Pandas to SQL (BigQuery).
Label Encoding
With Python, the simplest way to achieve label encoding, it is either to use Pandas category codes, or to use scikit-learn LabelEncoder class.