I have some code for joining excel files, how can I edit my code so that I don't have to type the full file name each time?
Thanks
Code below:
import pandas as pd
excel_names = ["Market_Information_System_Control_daily_trading_day_170701.xlsx",
"Market_Information_System_Control_daily_trading_day_170702.xlsx",
"Market_Information_System_Control_daily_trading_day_170703.xlsx",
"Market_Information_System_Control_daily_trading_day_170704.xlsx",
"Market_Information_System_Control_daily_trading_day_170731.xlsx"]
excels = [pd.ExcelFile(name) for name in excel_names]
frames = [x.parse(x.sheet_names[1], 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("c.xlsx", header=False, index=False)
I just wan't the time to flow, not have heading breaks.
I think it has something to do with this:
frames[1:] = [df[1:] for df in frames[1:]]