I am a developer and a learner. Currently mentoring students and helping them to grasp the fundamental of programming, specifically Python.
Mentoring, Freelance - Data Mining, Technical Writing
Nice post. For More Data Preprocessing , we can also use the pandas cut method to convert numerical data into categorical. For your example, I guess it is better to use apply() and pass a function (since you have multiple conditions). Whenever we are using inplace=True , we do not need to store again in a new df , we can see the changes that already happened to the old df itself.