I used a regular expression to print out only the necessary items in the CSV file.
However, I do not know how to add the output value to the data frame.
My goal is to put the value x in the existing Data frame column.
import re
path=pd.read_csv('tomy.csv')
s= (path.LN)
for line in s:
x = re.findall('(?i)total\s*\(\d+/\d+\)', line)
if x != 0:
print(x)
output value
'total (10/20)'
'total (15/21)'
...
'total (4/11)'