Spaces:
Runtime error
Runtime error
Download app.py from ilhamap/data_visualization1: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/ilhamap/data_visualization1/resolve/main/app.py
- Command line
-
hf download hf://spaces/ilhamap/data_visualization1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ilhamap/data_visualization1/resolve/main/app.py
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) |