Spaces:
Sleeping
Sleeping
| 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.") | |