rianders commited on
Commit
4d70a4c
·
verified ·
1 Parent(s): 31476c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -1,7 +1,22 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
 
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- x = st.slider('Select a value')
7
- st.write(x, 'squared is', x * x)
 
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
4
+ from io import StringIO
5
 
6
+ # Your CSV string
7
+ csv_string = """question,answer
8
+ What is your name?,My name is John
9
+ How old are you?,I am 25 years old
10
+ Where do you live?,I live in New York
11
+ What is your favorite color?,My favorite color is blue
12
+ What is your favorite food?,I love pizza"""
13
+
14
+ # Convert the string to a StringIO object
15
+ csv_data = StringIO(csv_string)
16
+
17
+ # Read the CSV data into a pandas DataFrame
18
+ df = pd.read_csv(csv_data)
19
+ st.title("Hello Streamlit")
20
+
21
+ st.write(df)
22