This process is a way to transform your category into an integer that can be used as a reference in some kind of algorithm.
It is extremely useful when you want to feed this data into a machine learning algorithm. Because algorithms usually prefer numbers since it is easier to digest and comprehend.
Here is how to do it
More on DataFrames
If you want to know more about DataFrame and Pandas. Checkout the other articles I wrote on the topic, just here :