Advertisement
Dodma

Untitled

Apr 22nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. def add_costs(tariff, mb_used, messages, call_duration):
  2. """
  3. Показывает, был ли перерасход, по значению столбцов tariff, mb_used, messages, call_duration, используя правила:
  4. - '0' при значении tariff = smart, mb_used <= 15, messages <= 50, call_duration <= 500 либо при значении tariff = ultra, mb_used <= 30, messages <= 1000, call_duration <= 3000
  5. - '1' во всех остальных случаях
  6. """
  7. if (tariff == 'smart' and mb_used <= 15 and messages <= 50 and call_duration <= 500) or (tariff == 'ultra' and mb_used <= 30 and messages <= 1000 and call_duration <= 3000):
  8. return 0
  9. return 1
  10. data_grouped['add_costs'] = data_grouped['tariff', 'mb_used', 'messages', 'call_duration'].apply(add_costs, axis=1)
  11. data_grouped
  12.  
  13. File "<tokenize>", line 7
  14. if (tariff == 'smart' and mb_used <= 15 and messages <= 50 and call_duration <= 500) or (tariff == 'ultra' and mb_used <= 30 and messages <= 1000 and call_duration <= 3000):
  15. ^
  16. IndentationError: unindent does not match any outer indentation level
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement