ProfessorLeVesseur commited on
Commit
6fca1e5
·
verified ·
1 Parent(s): c020c0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -139,10 +139,10 @@ def main():
139
  if uploaded_file is not None:
140
  try:
141
  # Read the Excel file into a DataFrame
142
- df = pd.read_excel(uploaded_file)
143
-
144
- # Rename duplicate columns
145
- df = df.rename(columns=lambda x: x if not df.columns.duplicated()[list(df.columns).index(x)] else f"{x}_{list(df.columns[:list(df.columns).index(x)]).count(x)+1}")
146
 
147
  # Replace student names with initials
148
  df = replace_student_names_with_initials(df)
 
139
  if uploaded_file is not None:
140
  try:
141
  # Read the Excel file into a DataFrame
142
+ # df = pd.read_excel(uploaded_file)
143
+
144
+ # Read the Excel file into a DataFrame and handle duplicate columns automatically
145
+ df = pd.read_excel(uploaded_file, mangle_dupe_cols=True)
146
 
147
  # Replace student names with initials
148
  df = replace_student_names_with_initials(df)