| | import streamlit as st |
| | import pandas as pd |
| |
|
| | |
| | st.set_page_config(page_title="AutoML - Classification", layout="wide") |
| |
|
| | st.title("Classification Data") |
| |
|
| | |
| | uploaded_file = st.file_uploader("Upload Data", type=["csv", "json", "xml", "xlsx"]) |
| |
|
| | if uploaded_file is not None: |
| | file_extension = uploaded_file.name.split(".")[-1] |
| | |
| | |
| | if file_extension == "csv": |
| | df = pd.read_csv(uploaded_file) |
| | elif file_extension == "json": |
| | df = pd.read_json(uploaded_file) |
| | elif file_extension == "xml": |
| | df = pd.read_xml(uploaded_file) |
| | elif file_extension == "xlsx": |
| | df = pd.read_excel(uploaded_file) |
| | |
| | st.success("File uploaded successfully!") |
| | |
| | |
| | options = ["Head of Data", "Data Info", "Describe Data"] |
| | selected_option = st.selectbox("Select Basic Info to View", options) |
| | |
| | if selected_option == "Head of Data": |
| | st.write(df.head()) |
| | elif selected_option == "Data Info": |
| | buffer = [] |
| | df.info(buf=buffer) |
| | s = "\n".join(str(x) for x in buffer) |
| | st.text(s) |
| | elif selected_option == "Describe Data": |
| | st.write(df.describe()) |
| |
|
| | |
| | if st.button("Submit"): |
| | st.session_state["uploaded_df"] = df |
| | st.switch_page("pages/1_EDA.py") |
| |
|