Iam working in a project to convert some invoices in PDFs to .xlsx for comparision reasons, but i ran into some trouble, in the conversion phase the program separated the minus signal from negative numbers, so what iam trying to do is, use regex to iterate through the name columns (Where the minus signal went) and match lines with a regex, if it matches it multiplicates the values column by -1 or concatenate a minus in front of the number, but i tried both ways but neither of them changed the values column.
Here's the Dataframe
date name value
519 25/02/2022 LOREM IPSUM 598,72
520 25/02/2022 LOREM IPSUM 656,56
523 25/02/2022 LOREM IPSUM - 220,32
524 25/02/2022 LOREM IPSUM - 339,76
The result I expect is
date name value
519 25/02/2022 LOREM IPSUM 598,72
520 25/02/2022 LOREM IPSUM 656,56
523 25/02/2022 LOREM IPSUM - -220,32
524 25/02/2022 LOREM IPSUM - -339,76
I tried using
r1 = re.compile(r"- $|-$")
for item in diference["name"]:
if r1.match(item):
diference["value"] = diference["value"]*(-1)
And
r1 = re.compile(r"- $|-$")
for item in diference["name"]:
if r1.match(item):
diference["value"] = "-" + diference["value"]
But as i said neither of them gave me an error nor changed something
.as decimal separator? What is the type of thevaluecolumn?