I have code that compares 2 csv files and generates an output from them. I have around 50 csv files to compare. In the end i will have 25 csv as output. Is there a loop function which i can just run one code and generate 25 output?
All the filenames and their comparison names are in one excel sheet which can help.
FileA FileB outputname=FileAB
FileC FileD outputname=FileCD
FileE FileF outputname=FileEF
My code starts like this :
import pandas as pd
import numpy as np
file1 = 'oldfile.csv'
file2 = 'newfile.csv'
df1 = pd.read_csv(file1)
df2 = pd.read_csv(file2)
and at the end i save the csv file:
df.to_csv(file_name, index=False)