Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_costs(tariff, mb_used, messages, call_duration):
- """
- Показывает, был ли перерасход, по значению столбцов tariff, mb_used, messages, call_duration, используя правила:
- - '0' при значении tariff = smart, mb_used <= 15, messages <= 50, call_duration <= 500 либо при значении tariff = ultra, mb_used <= 30, messages <= 1000, call_duration <= 3000
- - '1' во всех остальных случаях
- """
- 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):
- return 0
- return 1
- data_grouped['add_costs'] = data_grouped['tariff', 'mb_used', 'messages', 'call_duration'].apply(add_costs, axis=1)
- data_grouped
- File "<tokenize>", line 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):
- ^
- IndentationError: unindent does not match any outer indentation level
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement