SHELLAPANDIANGANHUNGING commited on
Commit
f0f3fbe
·
verified ·
1 Parent(s): 1ae930f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -544,9 +544,8 @@ if 'temuan_kode_distrik' in df_local.columns:
544
  st.markdown("### Insight")
545
  st.markdown(
546
  f"<div class='ai-insight'>"
547
- f"In UM Area, <strong>{top['nama_perusahaan']}</strong> leads with ratio <strong>{top['avg_monthly_ratio']:.2f}</strong>, "
548
- f"and <strong>{low['nama_perusahaan']}</strong> reports least (<strong>{low['avg_monthly_ratio']:.2f}</strong>). "
549
- f"Check if low reporters have sufficient access to reporting tools or training."
550
  f"</div>",
551
  unsafe_allow_html=True
552
  )
@@ -648,7 +647,7 @@ if not avg_ratio_per_location.empty:
648
  f"(<strong>{top_location['avg_monthly_ratio']:.2f}</strong>). "
649
  f"<strong>{low_location['nama_lokasi_full']}</strong> shows the lowest activity level "
650
  f"(<strong>{low_location['avg_monthly_ratio']:.2f}</strong>). "
651
- f"Areas with high activity (green) warrant investigation into the underlying causes of frequent findings. "
652
  f"Areas with low activity (red) should be reviewed to ensure reporting completeness and identify any hidden risks."
653
  f"</div>"
654
  )
@@ -878,7 +877,7 @@ with col_3c:
878
  f"<div class='ai-insight'>"
879
  f"<strong>Insight:</strong> Individual reporting ranges from {min_r:.2f} to {max_r:.2f} findings/month (avg: {mean_r:.2f}). "
880
  f"<strong>{top_reporter}</strong> is the most active contributor. "
881
- f"<strong>Recommendation:</strong> Recognize top reporters; investigate causes of low activity (<0.5/month) via 1:1 review."
882
  f"</div>",
883
  unsafe_allow_html=True
884
  )
@@ -905,7 +904,7 @@ with col_3b:
905
  # Ambil subset sesuai pilihan
906
  if sort_opt == "Top 10":
907
  # 10 tercepat: ascending (kecil → besar), tetap diurut ascending → tercepat di atas
908
- subset = full_sorted.head(10).copy()
909
  else: # "Bottom 10 Slowest"
910
  # 10 terlambat: descending (besar → kecil), agar terlambat di atas
911
  subset = full_sorted.tail(10).sort_values('avg_monthly_leadtime', ascending=False)
@@ -972,7 +971,7 @@ with col_3d:
972
  full_sorted = avg_leadtime_per_indiv.sort_values('avg_monthly_leadtime', ascending=True)
973
 
974
  if sort_opt == "Top 10":
975
- subset = full_sorted.head(10).copy()
976
  else: # "Bottom 10 Slowest"
977
  subset = full_sorted.tail(10).sort_values('avg_monthly_leadtime', ascending=False)
978
 
 
544
  st.markdown("### Insight")
545
  st.markdown(
546
  f"<div class='ai-insight'>"
547
+ f"Across all companies, the finding-per-person ratio is similar. In the UM Area "
548
+
 
549
  f"</div>",
550
  unsafe_allow_html=True
551
  )
 
647
  f"(<strong>{top_location['avg_monthly_ratio']:.2f}</strong>). "
648
  f"<strong>{low_location['nama_lokasi_full']}</strong> shows the lowest activity level "
649
  f"(<strong>{low_location['avg_monthly_ratio']:.2f}</strong>). "
650
+ f"Areas with high activity (green) warrant inspection into the underlying causes of frequent findings. "
651
  f"Areas with low activity (red) should be reviewed to ensure reporting completeness and identify any hidden risks."
652
  f"</div>"
653
  )
 
877
  f"<div class='ai-insight'>"
878
  f"<strong>Insight:</strong> Individual reporting ranges from {min_r:.2f} to {max_r:.2f} findings/month (avg: {mean_r:.2f}). "
879
  f"<strong>{top_reporter}</strong> is the most active contributor. "
880
+ f"<strong>Recommendation:</strong> Recognize top reporters; inspection causes of low activity (<0.5/month) via 1:1 review."
881
  f"</div>",
882
  unsafe_allow_html=True
883
  )
 
904
  # Ambil subset sesuai pilihan
905
  if sort_opt == "Top 10":
906
  # 10 tercepat: ascending (kecil → besar), tetap diurut ascending → tercepat di atas
907
+ subset = full_sorted.head(10).sort_values('avg_monthly_leadtime', ascending=True)
908
  else: # "Bottom 10 Slowest"
909
  # 10 terlambat: descending (besar → kecil), agar terlambat di atas
910
  subset = full_sorted.tail(10).sort_values('avg_monthly_leadtime', ascending=False)
 
971
  full_sorted = avg_leadtime_per_indiv.sort_values('avg_monthly_leadtime', ascending=True)
972
 
973
  if sort_opt == "Top 10":
974
+ subset = full_sorted.head(10).subset = full_sorted.head(10).sort_values('avg_monthly_leadtime', ascending=True)
975
  else: # "Bottom 10 Slowest"
976
  subset = full_sorted.tail(10).sort_values('avg_monthly_leadtime', ascending=False)
977