# Pycharm V2021 # 解释器 Python 3.7 D:\ProgramData\Anaconda3\python.exe # -*- coding:utf-8 # author :RainChang # 2021/10/28,13:42 # 操作说明:http://cw.hubwiz.com/card/c/streamlit-manual/ # 示例来源:https://blog.csdn.net/qq_44747847/article/details/116462041?spm=1001.2101.3001.6650.5&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-5.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-5.no_search_link # 在Terminal 运行Streamlit run filename.py import time import matplotlib.pyplot as plt import numpy as np import pandas as pd import streamlit as st from PIL import Image import altair as alt st.title("This is my first app") st.write("hello") st.write("Here's our first attempt at using data to create a table:") df = pd.DataFrame({ 'first column': [5, 6, 7, 8], 'second column': [50, 60, 70, 80] }) st.write(pd.DataFrame({ 'first column': [1, 2, 3, 4], 'second column': [10, 20, 30, 40] })) # 其中df定义的位置,并不影响最后的输出位置! # df # 绘制图表 # 折线图 chart_data = pd.DataFrame( np.random.randn(20, 3), columns=['a', 'b', 'c']) st.line_chart(chart_data) # 区域图的可视化 # “streamlit”中的“area_chart”方法显示区域图,方法原型和折线图用到的方法一致,所以这里就不做过多的赘述,例如下面的代码 chart_data =
python Streamlit 库示例
最新推荐文章于 2024-07-26 09:50:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)