zzmez commited on
Commit
76099c9
·
1 Parent(s): a0ef3c0

fix: fixed filtering prioritization

Browse files
Files changed (1) hide show
  1. utils/gradio_utils.py +5 -2
utils/gradio_utils.py CHANGED
@@ -243,11 +243,14 @@ def compute_offer(csv_file, days_lookback, min_sent):
243
  'Click Open', 'Leads', 'CLike', 'Complains', 'Traps', 'Send']
244
  # comcast_df = raw_df[raw_df['Nume'].str.contains('|'.join(cmp_list))] #1
245
  # comcast_df = comcast_df[comcast_df['Domeniu'] == 'Comcast'] #2
 
 
 
 
246
  comcast_df = comcast_df[comcast_df['Send'] > int(min_sent)]
247
  comcast_df = comcast_df[cols]
248
  comcast_df['Click Open'] = comcast_df['Click Open'].str.replace('%', '').astype(float)
249
- exclude_list = comcast_df[comcast_df['Data'] > (pd.Timestamp('now') - pd.Timedelta(days=days_lookback))]['Oferta'].unique()
250
- comcast_df = comcast_df[~comcast_df['Oferta'].isin(exclude_list)]
251
  # comcast_df = comcast_df[comcast_df['Lista Custom'].str.contains('open')]
252
  comcast_df = comcast_df[comcast_df['Nume'].str.startswith("Aeon News") & comcast_df['Nume'].str.contains(r'\b[A-Z]{3}\b.*\b\d{4}\*?\s*(\(\d{4}\))?\b')]
253
 
 
243
  'Click Open', 'Leads', 'CLike', 'Complains', 'Traps', 'Send']
244
  # comcast_df = raw_df[raw_df['Nume'].str.contains('|'.join(cmp_list))] #1
245
  # comcast_df = comcast_df[comcast_df['Domeniu'] == 'Comcast'] #2
246
+ exclude_list = comcast_df[(comcast_df['Data'] > (pd.Timestamp('now') - pd.Timedelta(days=days_lookback))) \
247
+ & (comcast_df['Domeniu'] == 'Comcast')]['Oferta'].unique()
248
+ comcast_df = comcast_df[~comcast_df['Oferta'].isin(exclude_list)]
249
+
250
  comcast_df = comcast_df[comcast_df['Send'] > int(min_sent)]
251
  comcast_df = comcast_df[cols]
252
  comcast_df['Click Open'] = comcast_df['Click Open'].str.replace('%', '').astype(float)
253
+
 
254
  # comcast_df = comcast_df[comcast_df['Lista Custom'].str.contains('open')]
255
  comcast_df = comcast_df[comcast_df['Nume'].str.startswith("Aeon News") & comcast_df['Nume'].str.contains(r'\b[A-Z]{3}\b.*\b\d{4}\*?\s*(\(\d{4}\))?\b')]
256