I am trying to replace the last digit of fixed length digit sequence with 0 in pandas dataframe column.
Using r'\10' tries to reference 10th capture group, even though I would like to take first capture group and add '0' to it.
Inserting space like r'\1 0' makes the program run, but the end result has the extra space present.
df['column'] = '12345'
df['column'].replace({r'(\d{4})\d': r'\1 0'}, regex=True)
df['column']
-> '1234 0'
How should I modify my code to get output of something like 12340
?