I have a dataframe of products that looks like this
category,number of products
Apple pc,3
Lenovo pc,7
HP pc,4
Apple chargher,6
Lenovo charger,9
I want to group categories if they contain the same string (for example pc or charger) and send them to another dataframe like this
category,number of products
pc,14
charger,15
Can i do this using pandas?


