Spaces:
Sleeping
Sleeping
File size: 1,379 Bytes
2a6b09f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | import streamlit as st
# Sidebar for navigation
st.sidebar.title("π§ Navigation")
option = st.sidebar.radio("Choose a module", ["Tips Dataset Explorer", "Tips Dataset Dashboard", "Basic Viewer"])
# Conditional loading based on sidebar selection
if option == "Tips Dataset Explorer":
from pages import project_1
elif option == "Tips Dataset Dashboard":
from pages import project_2
elif option == "Basic Viewer":
import pandas as pd
st.markdown("<h1 style='text-align: center; color: teal;'>π Tips Dataset Viewer</h1>", unsafe_allow_html=True)
file = st.file_uploader("π Upload a CSV file", type=["csv"])
if file is not None:
df = pd.read_csv(file)
st.markdown("### π§Ύ Full DataFrame")
st.dataframe(df)
st.markdown("### π First 5 Rows")
st.write(df.head())
st.markdown("### π Last 5 Rows")
st.write(df.tail())
st.markdown("### π Feature Types")
categorical_cols = df.select_dtypes(include='object').columns.tolist()
numerical_cols = df.select_dtypes(include=['int64', 'float64']).columns.tolist()
st.write("π¨ **Categorical Features:**", categorical_cols)
st.write("π¦ **Numerical Features:**", numerical_cols)
else:
st.info("β¬οΈ Please upload a CSV file to get started.")
|