首页 >> 数码 >> 用Python自制数据大屏,超简单

用Python自制数据大屏,超简单

2025-01-07 数码

o_bytes = video_file.read()

st.video(video_bytes)

而当我们双击“App”的时候,则收纳要展示出来的是整个主页的收纳要特性了,本案例是通过绑定raceplotly可选来绘制动态可交互的木柱状三幅,如下三幅右图

我们首先只能上传信息集,然后新设好展现出出来的表格的属性,例如表格的原文、木柱状三幅的木柱弧度等等,如下三幅右图

再次我们来看一下字符,因为篇幅整体局限,这里就先展示一之外字符

elif choose=='App':

#Add a file uploader to allow users to upload their csv file

st.markdown(""" .font {

font-size:25px ; font-family: 'Cooper Black'; color: #FF9633;}

""", unsafe_allow_html=True)

st.markdown('Upload your data...

', unsafe_allow_html=True) #use st.markdown() with CSS style to create a nice-formatted header/text

uploaded_file = st.file_uploader('',type=['csv']) #Only accepts csv file format

if uploaded_file is not None:

df=pd.read_csv(uploaded_file) #use AgGrid to create a aggrid table that's more visually appealing than plain pandas datafame

grid_response = AgGrid(

df,editable=False,

height=300,fit_columns_on_grid_load=True,

theme='blue',width=100,

allow_unsafe_jscode=True,

updated = grid_response['data']

df = pd.DataFrame(updated)

st.write('-----')

st.markdown('Set Parameters...

', unsafe_allow_html=True)

column_list = list(df)

column_list = deque(column_list)

column_list.appendleft('-')

with st.form(key='columns_in_form'):

text_style = '

***These input fields are required***

'

st.markdown(text_style, unsafe_allow_html=True)

col1, col2, col3 = st.columns([1, 1, 1])

col4, col5, col6 = st.columns([1, 1, 1])

col7, col8, col9 = st.columns([1, 1, 1])

col10, col11, col12 = st.columns([1, 1, 1])

submitted = st.form_submit_button('Submit')

st.write('-----')

if submitted:

raceplot = barplot(df, item_column=item_column, value_column=value_column, time_column=time_column,

top_entries=num_items)

fig = raceplot.plot(item_label=item_label, value_label=value_label, frame_duration=frame_duration,

date_format=date_format, orientation=orientation)

fig.update_layout(......)

st.plotly_chart(fig, use_container_width=True)

当我们对于该应用的特性有什么不满、有什么建议想连系开发者的话,双击“Contact”屏幕,该网站如下三幅右图

字符如下

elif choose == "Contact":

st.markdown(""" .font {

font-size:35px ; font-family: 'Cooper Black'; color: #FF9633;}

""", unsafe_allow_html=True)

st.markdown('Contact Form

', unsafe_allow_html=True)

with st.form(key='columns_in_form2',clear_on_submit=True):

Name=st.text_input(label='名字')

Email=st.text_input(label='连系方式')

Message=st.text_input(label='您想知道的是')

submitted = st.form_submit_button('提交')

if submitted:

st.write('感谢!')

自此整个网站就都完成了,大家可以依次来作为模板制作团队自己的信息大屏,将信息极其直观地展示出来。

上海看男科去哪里比较好
西宁看男科哪个专科医院好
太原精神病检查多少钱
缓解视疲劳最好的眼药水
肩周炎肩膀痛怎么缓解
康恩贝复方鱼腥草合剂
营养眼睛的眼药水
治晕车最简单方法 飞赛乐
友情链接