Spaces:
Sleeping
Sleeping
Download app.py from ilhamap/data_visualization: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/ilhamap/data_visualization/resolve/main/app.py
- Command line
-
hf download hf://spaces/ilhamap/data_visualization/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ilhamap/data_visualization/resolve/main/app.py
523 Bytes
| import pandas as pd | |
| from matplotlib import pyplot as plt | |
| import streamlit as st | |
| sheet_id = "1QvUSKqFzRjhk9hXXNcksiGOpbit_2r-QaejXq7_Z2FY" | |
| 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) |