Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 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]
|