I have a df like this:
names = ["Internal medicine, Gastroenterology", "Internal medicine, Family and general medicine, Endocrinology", "Pediatrics, Medical genetics, Laboratory medicine", "Internal medicine"]
df = pd.DataFrame(names, columns=['names'])
I would like to know how often each medical term occurs. e.g. here
- Internal medicine: 3
- Gastroenterology: 1
- etc
It works with Counter for words but how do I get it working for phrases such as "Internal medicine"? The ", " separates the phrases.