I am trying to read a series of xls files in a loop and create a master dataframe. While all files have same columns, in some files, a column is a string while in others, it is int. I want to read all of it as string to prevent any problems. Pandas read the first file, but all the others show up as Nan,NaT in my dataframe. What did I do wrong?
for f in glob.glob("C:\Consoildated_DailyReports\Hold*.xlsx"):
df = pd.read_excel(f,sheet_name='Data')
df = df.astype(str)
#df.to_html()
data1 = data1.append(df,ignore_index=True)
data1