Hello I am new to python and regex.
I have a large CSV file which has a field like, %age composition
that contains values such as:
'34% passed 23% failed 46% deferred'
How would you split this string so that you get a dictionary object:
{'passed': 34, 'failed': 23, 'deferred': 46}
for each row?
I tried this:
for line in csv_lines:
for match in re.findall('[\d\s%%]*\s', line)
but this only took the %age value