import pandas as pd excel_names = ["APPOLO.xlsx", "velachery.xlsx"] excels = [pd.ExcelFile(name) for name in excel_names] frames = [x.parse(x.sheet_names[0], header=None,index_col=None) for x in excels] frames[1:] = [df[1:] for df in frames[1:]] combined = pd.concat(frames) combined.to_excel("c5.xlsx", header=False, index=False self.deathrate=deathrate deathrate =self.deathrate(self.dataDir + 'c3.xlsx') # Accessing the first worksheet in the Excel file worksheet = deathrate.getWorksheets().get(0) worksheet.getCells().insertColumns(1,7) df["deathrate"]=(df["NO OF DEATHS "]/df[" NO OF PATIENTS "])*100