Hello I am trying to count the 'OK' instances in a specific cell in a word table. Here is my code:
from docx2python import docx2python
import pandas as pd
doc_result = docx2python('Results3.docx')
counterOK = 0
counterNOK = 0
df = pd.DataFrame(doc_result.body[0], columns= [0,1,2,3])
print(df)
req = df.loc[9][1]
print(req)
if (req == 'OK'):
counterOK+=1
elif (req == 'NOK'):
counterNOK+=1
else :
(print('sad'))
print(counterOK)
print(counterNOK)
Why do I always end up in the else branch?
Here is the Word Table I used.