yanivbl commited on
Commit
d83d83e
·
1 Parent(s): a9fa775

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+
4
+ def main():
5
+ st.title("CSV File Upload App")
6
+
7
+ # File uploader widget
8
+ uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
9
+
10
+ if uploaded_file is not None:
11
+ # To read file as string:
12
+ stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
13
+ string_data = stringio.read()
14
+
15
+ # To read file as pandas dataframe:
16
+ # (Adjust the parameters like `sep`, `header` if necessary)
17
+ df = pd.read_csv(uploaded_file)
18
+
19
+ # Display the dataframe
20
+ st.write(df)
21
+
22
+ if __name__ == "__main__":
23
+ main()