SHELLAPANDIANGANHUNGING commited on
Commit
40154f4
·
verified ·
1 Parent(s): a70f541

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1577,7 +1577,7 @@ def predict_categories(df):
1577
  # 🔥 Filter: Hanya yang bukan 'Positive'
1578
  df = df[df['temuan_kategori'] != 'Positive'].copy() # ✅ Filter non-Positive
1579
 
1580
- if 'temuan_kategori' not in df.columns or df.empty:
1581
  return pd.DataFrame()
1582
 
1583
  start_month = df['created_at'].min().to_period('M')
@@ -1586,7 +1586,7 @@ def predict_categories(df):
1586
  n_months = len(all_months)
1587
 
1588
  results = []
1589
- for cat, group in df.groupby('temuan_kategori'):
1590
  ts_data = (
1591
  group.groupby(group['created_at'].dt.to_period('M'))
1592
  .size()
 
1577
  # 🔥 Filter: Hanya yang bukan 'Positive'
1578
  df = df[df['temuan_kategori'] != 'Positive'].copy() # ✅ Filter non-Positive
1579
 
1580
+ if 'kategori' not in df.columns or df.empty:
1581
  return pd.DataFrame()
1582
 
1583
  start_month = df['created_at'].min().to_period('M')
 
1586
  n_months = len(all_months)
1587
 
1588
  results = []
1589
+ for cat, group in df.groupby('kategori'):
1590
  ts_data = (
1591
  group.groupby(group['created_at'].dt.to_period('M'))
1592
  .size()