Thursday, October 31, 2019

generate or replace a variable -- with a string type

Hi guys

I have a string variable in the dataset. It contains a long list of heart diseases. I would like to categorise it into a few ones, using keywords (e.g. one of the heart diseases contains the word "muscular").

Can I create/replace a variable using those keywords? So it could be something like this

replace x if y == "muscular"
Thanks!

No comments:

Post a Comment