i have a CSV file with list of texts(column with rows), and i want to extract the ages of the patients from the each row, i can't do with "is digit" cuz there are also some other digits in the texts. how can i do such thing? Thank You
EXTRA: i want to extract the genders too - Patient sometimes is referred as male/female, sometimes as man/woman and sometimes as gentleman/lady.
Is there a method to write the findall for example if the text is 17-year-old print me the number if it is followed by -year-old
re.findall("[\d].", '-year-old')
Sample of lines from text:
This 23-year-old white female presents with...
...pleasant gentleman who is 42 years old...
...The patient is a 10-1/2-year-old born with...
...A 79-year-old Filipino woman...
Patient, 37,...
How can i have a list of age/gender
i.e.:
Age:
['23','42','79','37'...]
Gender:
['female','male','male','female','male'...]