Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 498ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
i

interactive-widgets

Recently created Least recently created Recently updated Least recently updated

timmy / Streamlit 資料視覺化與互動選擇

Last active 5 hours ago charts data-visualization interactive-widgets numpy pandas streamlit

此範例展示如何使用 Streamlit 建立互動式數據視覺化,包含多重選擇 (multiselect) 和切換開關 (toggle) 來調整數據顯示,並透過 line_chart 繪製折線圖,讓使用者輕鬆分析數據趨勢。

0 0 0 1
1 import streamlit as st
2 import pandas as pd
3 import numpy as np
4
5 st.write("Streamlit supports a wide range of data visualizations, including [Plotly, Altair, and Bokeh charts](https://docs.streamlit.io/develop/api-reference/charts). 📊 And with over 20 input widgets, you can easily make your data interactive!")
6
7 all_users = ["Alice", "Bob", "Charly"]
8 with st.container(border=True):
9 users = st.multiselect("Users", all_users, default=all_users)
10 rolling_average = st.toggle("Rolling average")