I have a dataset of over 10 million rows. Due to the limitations of excel, these data are split over 10 excel spreadsheets. Hence, in python, I'll have to read in all 10 of them individually (df1, df2, df3...df10) before concatinating them together.
I want to check that all 10 dataframes have the same number of columns before actually concatinating them. I could do a print(df1.shape) ten times. But is there a more elegant way to do this via a for loop? I also want to use the same for loop to make sure that all 10 dfs have the same column names. I tried the following and it didn't work (error: str object has no attribute shape):
for i in range(1,11):
x = "df"+str(i)
print(x.shape)