-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_dashboard.py
More file actions
93 lines (75 loc) · 2.55 KB
/
Copy pathrun_dashboard.py
File metadata and controls
93 lines (75 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import streamlit as st
import pandas as pd
import numpy as np
import json
from app.survey.surveydata import SurveyData
import pymysql
survey_data = SurveyData()
##### Deprecated: DBInterface Use" ####
#with open("dbConfig.json") as json_data_file:
# DBParameters = json.load(json_data_file)
# dict1 = DBParameters['sofai_evalDB']
# hostName = dict1['hostname']
# userName = dict1['username']
# PWD = dict1['password']
#db = pymysql.connect(host=hostName, user=userName, password=PWD)
#cursor = db.cursor()
#cursor.execute('''show tables''')
#data = cursor.fetchall()
DATE_COLUMN = 'date/time'
DATA_URL = ('https://s3-us-west-2.amazonaws.com/'
'streamlit-demo-data/uber-raw-data-sep14.csv.gz')
st.title("Sound of AI Survey Feedback Visualization")
df = pd.read_csv("./data.csv")
#@st.cache
#def load_data(nrows):
# data = pd.read_csv(DATA_URL, nrows=nrows)
# def lowercase(x): return str(x).lower()
# data.rename(lowercase, axis='columns', inplace=True)
# data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])
# return data
#data = load_data(10000)
#print(df["Q0001"])
#print(df["Q0002"])
row3_space1, row3_1, row3_space2, row3_2, row3_space3 = st.beta_columns(
(.1, 1, .1, 1, .1))
with row3_1:
st.subheader("Survey Question 1")
st.bar_chart(df["Q0001"])
with row3_2:
st.subheader("Survey Question 2")
st.bar_chart(df["Q0002"])
#st.bar_chart(df["q3"])
#st.bar_chart(df["q7"])
#st.bar_chart(df["q9"])
#st.bar_chart(df["q10"])
#row3_space1, row3_1, row3_space2, row3_2, row3_space3 = st.beta_columns(
# (.1, 1, .1, 1, .1))
#with row3_1:
# st.subheader(survey_data.question1['question'])
# hist_values = np.histogram(
# data[DATE_COLUMN].dt.hour, bins=24, range=(0, 24))[0]
# st.bar_chart(hist_values)
#
#with row3_2:
# st.subheader(survey_data.question2['question'])
# hist_values = np.histogram(
# data[DATE_COLUMN].dt.hour, bins=24, range=(0, 24))[0]
# st.bar_chart(hist_values)
#row3_space1, row4_1, row4_space2, row4_2, row3_space3 = st.beta_columns(
# (.1, 1, .1, 1, .1))
#with row4_1:
# st.subheader(survey_data.question3['question'])
# hist_values = np.histogram(
# data[DATE_COLUMN].dt.hour, bins=24, range=(0, 24))[0]
# st.bar_chart(hist_values)
#with row4_2:
# st.subheader(survey_data.question4['question'])
# hist_values = np.histogram(
# data[DATE_COLUMN].dt.hour, bins=24, range=(0, 24))[0]
# st.bar_chart(hist_values)
st.text("")
st.markdown("[Insert Survey String Responses]")
for i in len(df["Q0002"]):
st.text(df["Q0017"][i])
st.text(" \n")