Imagine you have these paths of files you want to get the filename without extension from:
relfilepath
0 20210322636.pdf
12 factuur-f23622.pdf
14 ingram micro.pdf
19 upfront.nl domein - Copy.pdf
21 upfront.nl domein.pdf
Name: relfilepath, dtype: object
I came up with the following however this gives me the problem that for the first item it becomes a number outputting '20210322636.0'.
from pathlib import Path
for i, row in dffinalselection.iterrows():
dffinalselection['xmlfilename'][i] = Path(dffinalselection['relfilepath'][i]).stem
dffinalselection['xmlfilename'] = dffinalselection['xmlfilename'].astype(str)
This is wrong since it should be '20210322636'
Please help!