debut merge
This commit is contained in:
53
frontend/exploration.py
Normal file
53
frontend/exploration.py
Normal file
@@ -0,0 +1,53 @@
|
||||
import pandas as pd
|
||||
import streamlit as st
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
from pandas.api.types import is_numeric_dtype
|
||||
|
||||
st.set_page_config(
|
||||
page_title="Project Miner",
|
||||
layout="wide"
|
||||
)
|
||||
|
||||
st.title("Home")
|
||||
|
||||
### Exploration
|
||||
uploaded_file = st.file_uploader("Upload your CSV file", type=["csv"])
|
||||
|
||||
if uploaded_file is not None:
|
||||
st.session_state.data = pd.read_csv(uploaded_file)
|
||||
st.success("File loaded successfully!")
|
||||
|
||||
if "data" not in st.session_state:
|
||||
st.session_state.data = None
|
||||
|
||||
|
||||
if st.session_state.data is not None:
|
||||
data = st.session_state.data
|
||||
st.write(data.head(10))
|
||||
st.write(data.tail(10))
|
||||
|
||||
st.header("Data Preview")
|
||||
|
||||
st.subheader("First 5 Rows")
|
||||
st.write(data.head())
|
||||
|
||||
st.subheader("Last 5 Rows")
|
||||
st.write(data.tail())
|
||||
|
||||
st.header("Data Summary")
|
||||
|
||||
st.subheader("Basic Information")
|
||||
col1, col2 = st.columns(2)
|
||||
col1.metric("Number of Rows", data.shape[0])
|
||||
col2.metric("Number of Columns", data.shape[1])
|
||||
|
||||
st.write(f"Column Names: {list(data.columns)}")
|
||||
|
||||
st.subheader("Missing Values by Column")
|
||||
missing_values = data.isnull().sum()
|
||||
st.write(missing_values)
|
||||
|
||||
st.subheader("Statistical Summary")
|
||||
st.write(data.describe())
|
||||
|
Reference in New Issue
Block a user