saherPervaiz commited on
Commit
29c4365
·
verified ·
1 Parent(s): 279a93b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -72,13 +72,17 @@ if uploaded_file is not None:
72
  st.write("Cleaned Dataset:")
73
  st.dataframe(df)
74
 
 
 
 
 
75
  st.download_button(
76
- label="Download Cleaned Dataset",
77
- data=to_excel(df), # The cleaned dataset is 'df'
78
- file_name="cleaned_dataset.xlsx",
79
- mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
80
- )
81
-
82
  target = st.selectbox("Select Target Variable", df.columns)
83
  features = [col for col in df.columns if col != target]
84
  X = df[features]
 
72
  st.write("Cleaned Dataset:")
73
  st.dataframe(df)
74
 
75
+ # Add clean data download option
76
+ st.subheader("Download Cleaned Dataset")
77
+
78
+ # Provide a download button for the cleaned dataset
79
  st.download_button(
80
+ label="Download Cleaned Dataset (CSV)",
81
+ data=df.to_csv(index=False), # Convert the cleaned dataset to CSV
82
+ file_name="cleaned_dataset.csv", # Specify the file name
83
+ mime="text/csv" # Specify the MIME type for CSV
84
+ )
85
+
86
  target = st.selectbox("Select Target Variable", df.columns)
87
  features = [col for col in df.columns if col != target]
88
  X = df[features]