Conteúdo do Curso
Introduction to Python for Data Analysis
Introduction to Python for Data Analysis
Costly Customers
Sometimes we don't receive as much as we spend. The same with some customers in our DataFrame. We do spend more money to 'buy' this customer, but we don't receive the the same amount of money.
Let's find the percentage of these customers!
We want to find costly customers, not payments. To do that, we need to add additional
customer_id.nunique()
that will find only unique customers with their costly (or not) payments.
To find the percentage, use the next formula:
Tarefa
- Count the number of the costly customers:
- Set the condition if the value in the
'cost'
column is greater than the value in the'money_spent'
column - Use unique customers to find the metric
- Print the number of the costly customers.
- Find the percentage of costly customers using the formula.
- Print the result of countings in the
0.00
format.
Obrigado pelo seu feedback!
Costly Customers
Sometimes we don't receive as much as we spend. The same with some customers in our DataFrame. We do spend more money to 'buy' this customer, but we don't receive the the same amount of money.
Let's find the percentage of these customers!
We want to find costly customers, not payments. To do that, we need to add additional
customer_id.nunique()
that will find only unique customers with their costly (or not) payments.
To find the percentage, use the next formula:
Tarefa
- Count the number of the costly customers:
- Set the condition if the value in the
'cost'
column is greater than the value in the'money_spent'
column - Use unique customers to find the metric
- Print the number of the costly customers.
- Find the percentage of costly customers using the formula.
- Print the result of countings in the
0.00
format.
Obrigado pelo seu feedback!
Costly Customers
Sometimes we don't receive as much as we spend. The same with some customers in our DataFrame. We do spend more money to 'buy' this customer, but we don't receive the the same amount of money.
Let's find the percentage of these customers!
We want to find costly customers, not payments. To do that, we need to add additional
customer_id.nunique()
that will find only unique customers with their costly (or not) payments.
To find the percentage, use the next formula:
Tarefa
- Count the number of the costly customers:
- Set the condition if the value in the
'cost'
column is greater than the value in the'money_spent'
column - Use unique customers to find the metric
- Print the number of the costly customers.
- Find the percentage of costly customers using the formula.
- Print the result of countings in the
0.00
format.
Obrigado pelo seu feedback!
Sometimes we don't receive as much as we spend. The same with some customers in our DataFrame. We do spend more money to 'buy' this customer, but we don't receive the the same amount of money.
Let's find the percentage of these customers!
We want to find costly customers, not payments. To do that, we need to add additional
customer_id.nunique()
that will find only unique customers with their costly (or not) payments.
To find the percentage, use the next formula:
Tarefa
- Count the number of the costly customers:
- Set the condition if the value in the
'cost'
column is greater than the value in the'money_spent'
column - Use unique customers to find the metric
- Print the number of the costly customers.
- Find the percentage of costly customers using the formula.
- Print the result of countings in the
0.00
format.