Update app.py
Browse files
app.py
CHANGED
|
@@ -70,6 +70,17 @@ if uploaded_files:
|
|
| 70 |
# For subsequent files, set the header using the stored headers
|
| 71 |
df = pd.read_excel(uploaded_file, names=headers, header=0)
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
# Add a column for the file name
|
| 74 |
df['file_name'] = file_name
|
| 75 |
df_list.append(df)
|
|
|
|
| 70 |
# For subsequent files, set the header using the stored headers
|
| 71 |
df = pd.read_excel(uploaded_file, names=headers, header=0)
|
| 72 |
|
| 73 |
+
elif uploaded_file.type == "application/vnd.ms-excel":
|
| 74 |
+
# This is an .xls file
|
| 75 |
+
if i == 0:
|
| 76 |
+
# For the first file, include the header
|
| 77 |
+
df = pd.read_excel(uploaded_file, engine='xlrd')
|
| 78 |
+
# Store the columns from the first file
|
| 79 |
+
headers = df.columns
|
| 80 |
+
else:
|
| 81 |
+
# For subsequent files, set the header using the stored headers
|
| 82 |
+
df = pd.read_excel(uploaded_file, names=headers, header=0, engine='xlrd')
|
| 83 |
+
|
| 84 |
# Add a column for the file name
|
| 85 |
df['file_name'] = file_name
|
| 86 |
df_list.append(df)
|