GMARTINEZMILLA commited on
Commit
65cad3a
1 Parent(s): f8ba271

bugfix: Manufacturers Alerts

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -591,24 +591,24 @@ elif page == "Customer Analysis":
591
  else:
592
  st.success("All manufacturers have met or exceeded predicted sales.")
593
 
594
- # Gráfico adicional: Comparar las ventas predichas y reales para los principales fabricantes
595
- st.markdown("### Predicted vs Actual Sales for Top Manufacturers")
596
- top_manufacturers = results.groupby('marca_id_encoded').agg({'ventas_reales': 'sum', 'ventas_predichas': 'sum'}).sort_values(by='ventas_reales', ascending=False).head(10)
597
-
598
- fig_comparison = go.Figure()
599
- fig_comparison.add_trace(go.Bar(x=top_manufacturers.index, y=top_manufacturers['ventas_reales'], name="Actual Sales", marker_color='blue'))
600
- fig_comparison.add_trace(go.Bar(x=top_manufacturers.index, y=top_manufacturers['ventas_predichas'], name="Predicted Sales", marker_color='orange'))
601
-
602
- fig_comparison.update_layout(
603
- title="Actual vs Predicted Sales by Top Manufacturers",
604
- xaxis_title="Manufacturer",
605
- yaxis_title="Sales (€)",
606
- barmode='group',
607
- height=400,
608
- hovermode="x unified"
609
- )
610
-
611
- st.plotly_chart(fig_comparison, use_container_width=True)
612
 
613
  # Gráfico de ventas anuales
614
  ventas_clientes['codigo_cliente'] = ventas_clientes['codigo_cliente'].astype(str).str.strip()
 
591
  else:
592
  st.success("All manufacturers have met or exceeded predicted sales.")
593
 
594
+ # # Gráfico adicional: Comparar las ventas predichas y reales para los principales fabricantes
595
+ # st.markdown("### Predicted vs Actual Sales for Top Manufacturers")
596
+ # top_manufacturers = results.groupby('marca_id_encoded').agg({'ventas_reales': 'sum', 'ventas_predichas': 'sum'}).sort_values(by='ventas_reales', ascending=False).head(10)
597
+
598
+ # fig_comparison = go.Figure()
599
+ # fig_comparison.add_trace(go.Bar(x=top_manufacturers.index, y=top_manufacturers['ventas_reales'], name="Actual Sales", marker_color='blue'))
600
+ # fig_comparison.add_trace(go.Bar(x=top_manufacturers.index, y=top_manufacturers['ventas_predichas'], name="Predicted Sales", marker_color='orange'))
601
+
602
+ # fig_comparison.update_layout(
603
+ # title="Actual vs Predicted Sales by Top Manufacturers",
604
+ # xaxis_title="Manufacturer",
605
+ # yaxis_title="Sales (€)",
606
+ # barmode='group',
607
+ # height=400,
608
+ # hovermode="x unified"
609
+ # )
610
+
611
+ # st.plotly_chart(fig_comparison, use_container_width=True)
612
 
613
  # Gráfico de ventas anuales
614
  ventas_clientes['codigo_cliente'] = ventas_clientes['codigo_cliente'].astype(str).str.strip()