Spaces:
Sleeping
Sleeping
GMARTINEZMILLA
commited on
Commit
·
1bd8569
1
Parent(s):
07a6071
feat: Added about section underneath table in col 3
Browse files
app.py
CHANGED
@@ -254,8 +254,8 @@ if page == "📃 Resumen":
|
|
254 |
st.dataframe(ventas_top_100[['codigo_cliente', 'total_sales']],
|
255 |
column_order=("codigo_cliente", "total_sales"),
|
256 |
hide_index=True,
|
257 |
-
width=
|
258 |
-
height=
|
259 |
column_config={
|
260 |
"codigo_cliente": st.column_config.TextColumn(
|
261 |
"Código de Cliente",
|
@@ -267,6 +267,23 @@ if page == "📃 Resumen":
|
|
267 |
max_value=ventas_top_100['total_sales'].max()
|
268 |
)}
|
269 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
# Customer Analysis Page
|
271 |
elif page == "🕵️ Análisis de Cliente":
|
272 |
st.markdown("""
|
|
|
254 |
st.dataframe(ventas_top_100[['codigo_cliente', 'total_sales']],
|
255 |
column_order=("codigo_cliente", "total_sales"),
|
256 |
hide_index=True,
|
257 |
+
width=350, # Ajustar el ancho de la tabla
|
258 |
+
height=400, # Ajustar la altura de la tabla
|
259 |
column_config={
|
260 |
"codigo_cliente": st.column_config.TextColumn(
|
261 |
"Código de Cliente",
|
|
|
267 |
max_value=ventas_top_100['total_sales'].max()
|
268 |
)}
|
269 |
)
|
270 |
+
# Calculate sales insights
|
271 |
+
sales_min = ventas_top_100['total_sales'].min()
|
272 |
+
sales_max = ventas_top_100['total_sales'].max()
|
273 |
+
sales_median = ventas_top_100['total_sales'].median()
|
274 |
+
sales_90th = ventas_top_100['total_sales'].quantile(0.9)
|
275 |
+
sales_10th = ventas_top_100['total_sales'].quantile(0.1)
|
276 |
+
|
277 |
+
# About Section with relevant data insights
|
278 |
+
with st.expander('About', expanded=True):
|
279 |
+
st.write(f'''
|
280 |
+
- **Data source**: Internal sales data (Top 100 clients).
|
281 |
+
- **Sales Range**: €{sales_min:,.0f} - €{sales_max:,.0f}.
|
282 |
+
- **Median Sales**: €{sales_median:,.0f}.
|
283 |
+
- **90th Percentile**: €{sales_90th:,.0f}.
|
284 |
+
- **10th Percentile**: €{sales_10th:,.0f}.
|
285 |
+
- This table displays the top 100 clients based on total sales from 2021 to 2023.
|
286 |
+
''')
|
287 |
# Customer Analysis Page
|
288 |
elif page == "🕵️ Análisis de Cliente":
|
289 |
st.markdown("""
|