Spaces:
Sleeping
Sleeping
Create app.py
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950import streamlit as stimport pandas as pdimport plotly.graph_objs as go
# عنوان برنامهst.set_page_config(page_title='اداره زراعت و کنترل محصول', layout='wide')
st.title('اداره زراعت و کنترل محصول')
# آپلود فایلuploaded_file = st.file_uploader("لطفا فایل Excel خود را آپلود کنید", type=["xlsx", "xls"])
if uploaded_file is not None: # خواندن دادهها از فایل اکسل df = pd.read_excel(uploaded_file, sheet_name=0) st.write("دادههای بارگذاری شده:") st.dataframe(df) # نمودار سه بعدی st.subheader("نمودار سه بعدی رشد مزارع") fig = go.Figure(data=[go.Scatter3d( x=df['Week'], y=df['Height'], z=df['Growth'], mode='markers', marker=dict( size=8, color=df['Height'], # set color to an array/list of desired values colorscale='Viridis', # choose a colorscale opacity=0.8 ) )]) fig.update_layout(scene=dict( xaxis_title='Week', yaxis_title='Height', zaxis_title='Growth' )) st.plotly_chart(fig) # تحلیل دادهها st.subheader("گزارش تحلیلی") average_height = df['Height'].mean() average_growth = df['Growth'].mean() st.markdown(f"* **میانگین ارتفاع:** {average_height:.2f} سانتیمتر") st.markdown(f"* **میانگین رشد:** {average_growth:.2f} سانتیمتر")app.pyAdded+50