import re
import os
os.chdir("./test")
path = os.getcwd()
with os.scandir(path) as list_files:
for f in list_files:
new_file_name = re.sub(r"^(?P<start>[^0-9.]+)(?P<digits>[0-9.]+)\s(?P<ending>[^0-9]+)",
"\\g<start>\\g<ending>", f.name)
os.rename(f, new_file_name)