Advertisement
Avrelii

Untitled

Feb 20th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import pandas as pd
  2. support_log_grouped=pd.read_csv('/datasets/support_log_grouped_eng.csv')
  3.  
  4. def alert_group_importance(row):
  5. alert_group = row['alert_group']
  6. importance = row['importance']
  7.  
  8. if alert_group == 'medium':
  9. if importance == 1:
  10. return 'attention'
  11.  
  12. if alert_group == 'high':
  13. if importance == 1:
  14. return 'high risk'
  15.  
  16. if alert_group == 'critical':
  17. if importance == 1:
  18. return 'block'
  19.  
  20. return 'queued'
  21.  
  22.  
  23. row_values = ['high', 1]
  24. row_columns = ['alert_group', 'importance']
  25. row = pd.Series(data=row_values, index=row_columns)
  26. print(alert_group_importance(row))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement