Update app.py
Browse files
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
|
| 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:
|