aiscientist commited on
Commit
aa94456
·
verified ·
1 Parent(s): 7161663

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import pandas as pd
3
  from ydata_profiling import ProfileReport
4
  import streamlit as st
@@ -12,15 +11,20 @@ def main():
12
  option = st.sidebar.selectbox("Choose an option", ["Data Profiling", "Personal Assistant"])
13
 
14
  if option == "Data Profiling":
15
- data_profiling()
 
 
 
 
 
16
  elif option == "Personal Assistant":
17
  personal_assistant()
18
 
19
- def data_profiling():
20
  st.title("Data Profiling App")
21
 
22
  # Load the data
23
- df = pd.read_csv('data.csv')
24
 
25
  # Display the dataframe
26
  st.dataframe(df)
@@ -65,3 +69,4 @@ def personal_assistant():
65
 
66
  if __name__ == "__main__":
67
  main()
 
 
 
1
  import pandas as pd
2
  from ydata_profiling import ProfileReport
3
  import streamlit as st
 
11
  option = st.sidebar.selectbox("Choose an option", ["Data Profiling", "Personal Assistant"])
12
 
13
  if option == "Data Profiling":
14
+ uploaded_file = st.file_uploader("Upload CSV file", type=["csv"])
15
+ if uploaded_file is None:
16
+ st.warning("Please upload a CSV file.")
17
+ st.stop() # Stop execution if no file uploaded
18
+ else:
19
+ data_profiling(uploaded_file)
20
  elif option == "Personal Assistant":
21
  personal_assistant()
22
 
23
+ def data_profiling(uploaded_file):
24
  st.title("Data Profiling App")
25
 
26
  # Load the data
27
+ df = pd.read_csv(uploaded_file)
28
 
29
  # Display the dataframe
30
  st.dataframe(df)
 
69
 
70
  if __name__ == "__main__":
71
  main()
72
+