visualization / app.py
ilhamap's picture
Create app.py
7f318c5 verified
raw
history blame contribute delete
523 Bytes
import pandas as pd
from matplotlib import pyplot as plt
import streamlit as st
sheet_id = "1WQ7HlCFNXfQaiITS2102-bX_2P-Z7BunXVBY8zMLa_g"
sheet_name = "Sheet1"
url = f"https://docs.google.com/spreadsheets/d/{sheet_id}/gviz/tq?tqx=out:csv&sheet={sheet_name}"
df = pd.read_csv(url)
x = df['year']
y = df['number']
fig = plt.figure(figsize=(5, 5))
plt.plot(x,y)
plt.title('line plot', fontweight='bold')
st.pyplot(fig)
fig = plt.figure(figsize=(5, 5))
plt.plot(x,y,'.')
plt.title('dotplot', fontweight='bold')
st.pyplot(fig)