Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
from matplotlib import pyplot as plt
|
3 |
+
import streamlit as st
|
4 |
+
sheet_id = "1WQ7HlCFNXfQaiITS2102-bX_2P-Z7BunXVBY8zMLa_g"
|
5 |
+
sheet_name = "Sheet1"
|
6 |
+
url = f"https://docs.google.com/spreadsheets/d/{sheet_id}/gviz/tq?tqx=out:csv&sheet={sheet_name}"
|
7 |
+
df = pd.read_csv(url)
|
8 |
+
x = df['year']
|
9 |
+
y = df['number']
|
10 |
+
|
11 |
+
fig = plt.figure(figsize=(5, 5))
|
12 |
+
plt.plot(x,y)
|
13 |
+
plt.title('line plot', fontweight='bold')
|
14 |
+
st.pyplot(fig)
|
15 |
+
|
16 |
+
fig = plt.figure(figsize=(5, 5))
|
17 |
+
plt.plot(x,y,'.')
|
18 |
+
plt.title('dotplot', fontweight='bold')
|
19 |
+
st.pyplot(fig)
|