Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- support_log_grouped = pd.read_csv('/datasets/support_log_grouped.csv')
- def alert_group_importance(row):
- """
- Возвращает приоритет
- """
- alert_group = row['alert_group']
- importance = row['importance']
- if (alert_group == 'средний') & (importance == 1):
- return 'обратить внимание'
- elif (alert_group == 'высокий') & (importance == 1):
- return 'высокий риск'
- elif (alert_group == 'критичный') & (importance == 1):
- return 'блокер'
- return 'в порядке очереди'
- row_values = ['высокий', 1]
- row_columns = ['alert_group', 'importance']
- row = pd.Series(data=row_values, index=row_columns)
- #print(alert_group_importance(row))
- support_log_grouped['importance_status'] = support_log_grouped.apply(alert_group_importance, axis=1)
- #print(support_log_grouped)
- print(support_log_grouped['importance_status'].value_counts())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement