Spaces:
Sleeping
Sleeping
Update pages/Simple-EDA.py
Browse files- pages/Simple-EDA.py +1 -37
pages/Simple-EDA.py
CHANGED
|
@@ -2,43 +2,7 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
# Define a persistent file path for the dataset
|
| 6 |
-
DATA_FILE_PATH = "persistent_dataset.csv"
|
| 7 |
|
| 8 |
# Page Title
|
| 9 |
-
st.markdown("<h1 style='text-align:center; color
|
| 10 |
|
| 11 |
-
# Check if a dataset already exists on disk
|
| 12 |
-
if os.path.exists(DATA_FILE_PATH):
|
| 13 |
-
# If dataset exists, load it
|
| 14 |
-
df = pd.read_csv(DATA_FILE_PATH)
|
| 15 |
-
|
| 16 |
-
# Display dataset
|
| 17 |
-
st.subheader("Current Dataset (Previously Uploaded):")
|
| 18 |
-
st.write(df.head()) # Display the first 5 rows of the dataset
|
| 19 |
-
|
| 20 |
-
st.subheader("Dataset Description:")
|
| 21 |
-
st.write(df.describe())
|
| 22 |
-
|
| 23 |
-
st.subheader("Dataset Shape (Rows, Columns):")
|
| 24 |
-
st.write(df.shape)
|
| 25 |
-
else:
|
| 26 |
-
st.info("No dataset found. Please upload a CSV file.")
|
| 27 |
-
|
| 28 |
-
# File uploader widget to upload a new dataset
|
| 29 |
-
uploaded_file = st.file_uploader("Choose a CSV file", type=["csv"])
|
| 30 |
-
|
| 31 |
-
if uploaded_file is not None:
|
| 32 |
-
# Read the uploaded CSV file into a pandas DataFrame
|
| 33 |
-
df = pd.read_csv(uploaded_file)
|
| 34 |
-
|
| 35 |
-
# Save the dataset permanently to disk
|
| 36 |
-
df.to_csv(DATA_FILE_PATH, index=False)
|
| 37 |
-
|
| 38 |
-
# Display the uploaded dataset
|
| 39 |
-
st.subheader("Uploaded Dataset Preview:")
|
| 40 |
-
st.write(df.head()) # Display the first 5 rows
|
| 41 |
-
|
| 42 |
-
# Display success message
|
| 43 |
-
st.success(f"Dataset uploaded and saved permanently as {DATA_FILE_PATH}!")
|
| 44 |
-
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import os
|
| 4 |
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Page Title
|
| 7 |
+
st.markdown("<h1 style='text-align:center; color:;'>Simple EDA</h1>", unsafe_allow_html=True)
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|