ilhamap commited on
Commit
3ff9764
·
verified ·
1 Parent(s): f663b09

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ from matplotlib import pyplot as plt
3
+ import streamlit as st
4
+ sheet_id = "1QvUSKqFzRjhk9hXXNcksiGOpbit_2r-QaejXq7_Z2FY"
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.subplot(121)
13
+ plt.plot(x,y)
14
+ plt.title('line plot', fontweight='bold')
15
+ plt.subplot(122)
16
+ plt.plot(x,y,'.')
17
+ plt.title('dot plot', fontweight='bold')
18
+ st.pyplot(fig)