Spaces:
Sleeping
Sleeping
Update pages/2_π_QuickML.py
Browse files- pages/2_π_QuickML.py +8 -9
pages/2_π_QuickML.py
CHANGED
|
@@ -64,23 +64,22 @@ st.markdown("QuickML is a tool that helps you to build a Machine Learning model
|
|
| 64 |
st.divider()
|
| 65 |
|
| 66 |
|
| 67 |
-
st.header("Upload Your CSV File"
|
| 68 |
uploaded_file = st.file_uploader("Upload the Dataset", type=["csv", "xlsx", "xls"])
|
| 69 |
st.divider()
|
| 70 |
|
| 71 |
if uploaded_file:
|
| 72 |
-
# Read the CSV File
|
| 73 |
if st.session_state.df is None:
|
| 74 |
-
|
| 75 |
if uploaded_file.name.endswith('.csv'):
|
| 76 |
-
|
| 77 |
-
elif uploaded_file.name.endswith('.xlsx') or
|
| 78 |
-
|
| 79 |
else:
|
| 80 |
-
|
| 81 |
else:
|
| 82 |
-
df = st.session_state.df
|
| 83 |
-
|
| 84 |
new_line()
|
| 85 |
|
| 86 |
|
|
|
|
| 64 |
st.divider()
|
| 65 |
|
| 66 |
|
| 67 |
+
st.header("Upload Your CSV File")
|
| 68 |
uploaded_file = st.file_uploader("Upload the Dataset", type=["csv", "xlsx", "xls"])
|
| 69 |
st.divider()
|
| 70 |
|
| 71 |
if uploaded_file:
|
|
|
|
| 72 |
if st.session_state.df is None:
|
| 73 |
+
# Read CSV or Excel file
|
| 74 |
if uploaded_file.name.endswith('.csv'):
|
| 75 |
+
st.session_state.df = pd.read_csv(uploaded_file)
|
| 76 |
+
elif uploaded_file.name.endswith('.xlsx') or uploaded_file.name.endswith('.xls'):
|
| 77 |
+
st.session_state.df = pd.read_excel(uploaded_file)
|
| 78 |
else:
|
| 79 |
+
st.error("Unsupported file format. Only CSV and Excel files are supported.")
|
| 80 |
else:
|
| 81 |
+
df = st.session_state.df
|
| 82 |
+
st.dataframe(df)
|
| 83 |
new_line()
|
| 84 |
|
| 85 |
|