Spaces:
Sleeping
Sleeping
Strauss Cunha Carvalho
commited on
Commit
·
b0f862d
1
Parent(s):
5693fc3
dev:sqlite
Browse files- app.py +12 -0
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -1,5 +1,17 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
x = st.slider('Select a value')
|
| 4 |
st.write(x, 'squared is', x * x)
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import sqlite3
|
| 3 |
+
import pandas as pd
|
| 4 |
+
|
| 5 |
|
| 6 |
x = st.slider('Select a value')
|
| 7 |
st.write(x, 'squared is', x * x)
|
| 8 |
|
| 9 |
+
|
| 10 |
+
conn = sqlite3.connect("afa-bd.db")
|
| 11 |
+
sql = """SELECT alu_id, alu_nome, alu_uf, alu_cep, progresso_alfabetizacao, idade FROM tb_students
|
| 12 |
+
WHERE progresso_alfabetizacao >= 6 LIMIT 100"""
|
| 13 |
+
|
| 14 |
+
dfp_std = pd.read_sql(sql, conn)
|
| 15 |
+
st.dataframe(dfp_std)
|
| 16 |
+
#dfp_std.head(4)
|
| 17 |
+
|
requirements.txt
CHANGED
|
@@ -4,3 +4,4 @@ pysqlite3
|
|
| 4 |
sqlalchemy
|
| 5 |
datasets
|
| 6 |
streamlit
|
|
|
|
|
|
| 4 |
sqlalchemy
|
| 5 |
datasets
|
| 6 |
streamlit
|
| 7 |
+
sqlite3
|