Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pandas as pd | |
| import ydata_profiling | |
| from streamlit_pandas_profiling import st_profile_report | |
| # Judul Aplikasi | |
| st.set_page_config(page_title='Data Profiling', layout='wide') | |
| st.title('π Data Profiling Dashboard') | |
| # Upload File | |
| uploaded_file = st.file_uploader("Upload dataset (CSV)", type=['csv']) | |
| def load_data(file): | |
| return pd.read_csv(file) | |
| if uploaded_file is not None: | |
| df = load_data(uploaded_file) | |
| st.success("Dataset berhasil diunggah!") | |
| # Profiling Data | |
| st.subheader("π Profiling Data") | |
| profile = df.profile_report() | |
| st_profile_report(profile) | |
| else: | |
| st.info("Silakan unggah file CSV untuk mulai menganalisis data.") | |
| # Tambahkan file requirements.txt untuk deploy di Hugging Face | |
| with open("requirements.txt", "w") as f: | |
| f.write("streamlit\npandas\nydata-profiling\nstreamlit-pandas-profiling") | |