I am trying to categorize messy data with a dataframe with four columns:
"company_name", which is the messy data I want to categorize "categories", which is the list of categories I want to put the messy data in "search", which are the keywords I want to search in the messy data "company_type", which will have the correct company type for each row
"company_name" "categories" "search" "company_type"
John landscaping Landscaping lawn NA
constructing pros Landscaping landscape NA
Brother Lawn care Cleaning clean NA
Top cleaning Painting paint NA
Emmas paints Construction construct NA
I want my final result to look like this:
"company_name" "categories" "search" "company_type"
John landscaping Landscaping lawn Landscaping
constructing pros Landscaping landscape Construction
Brother Lawn care Cleaning clean Landscaping
Top cleaning Painting paint Cleaning
Emmas paints Construction construct Painting
Does anyone know how I should proceed?
Thank you!