Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import pandas as pd
  2. support_log_grouped = pd.read_csv('/datasets/support_log_grouped.csv')
  3.  
  4. def alert_group_importance(row):
  5. alert_group = row['alert_group']
  6. importance = row['importance']
  7.  
  8. if alert_group == 'средний':
  9. if importance == 1:
  10. return 'обратить внимание'
  11.  
  12. if alert_group == 'высокий':
  13. if importance == 1:
  14. return 'высокий риск'
  15.  
  16. return 'в порядке очереди'
  17. support_log_grouped['importance_status'] = support_log_grouped.apply
  18. (alert_group_importance, axis=1)
  19. print(support_log_grouped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement