Can anyone know that how to delete same single column from multiple xlsx sheet using python?
After that those sheets save it to same path.
Can anyone know that how to delete same single column from multiple xlsx sheet using python?
After that those sheets save it to same path.
First of all you should create a list with the Excel workbooks and save in a variable called "files":
dfs = []
for file in files:
df = pd.read_excel(file, sheet_name = None)
dfs.append(df)
col_to_delete = ['Your columns']
for df in dfs:
#Here you delete one by one
df.drop(labels = col_to_delete, inplace = True)
After that, I don't know if you want to merge all the .xlsx or overwrite, but this is another question, look at documentation for pd.Write() to save the files
Hope it helps