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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -140,12 +140,15 @@ def main():
140
  try:
141
  # Read the Excel file into a DataFrame
142
  df = pd.read_excel(uploaded_file)
 
 
 
143
 
144
  # Replace student names with initials
145
  df = replace_student_names_with_initials(df)
146
 
147
  st.subheader("Uploaded Data")
148
- st.write(df.head(4)) # Display only the first four rows
149
 
150
  # Ensure expected column is available
151
  if INTERVENTION_COLUMN not in df.columns:
 
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)
149
 
150
  st.subheader("Uploaded Data")
151
+ st.write(df)
152
 
153
  # Ensure expected column is available
154
  if INTERVENTION_COLUMN not in df.columns: