I have a DataFrame df with three columns columns: ['Name', 'WD', 'File']. The file associated with each name in 'Name' is given as its working directory in column 'WD' and the file name in column 'File'.
I want to join the 'WD' column and 'File' column using os.path.join() method such that the 'File' column shows the full path.
I tried the following script and it works okay but I was wondering if there is a better way without using the for loop:
for i in df.index:
df['File'][i]=os.path.join(df['WD'][i],df['File'][i])