ROI 2/2
As you can recognize from the previous chapter, we have some problems with ROI in general; we received -19.644756245106056
%. Unfortunately, we suffer losses. In this case, we must dive deeper and find the reason.
The next step of our research is to check if we have unprofitable days.
Swipe to start coding
- Group data:
- Extract only columns
'day', 'cost', 'money_spent'
from thedf
DataFrame. - Group by the column
'day'
. - Apply
sum()
function to grouped data. - Apply
reset_index()
function.
- Create column
'ROI'
:
- Subtract
df['cost']
fromdf['money_spent']
- Divide the result by
df['cost']
.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Awesome!
Completion rate improved to 2.08
ROI 2/2
Desliza para mostrar el menú
As you can recognize from the previous chapter, we have some problems with ROI in general; we received -19.644756245106056
%. Unfortunately, we suffer losses. In this case, we must dive deeper and find the reason.
The next step of our research is to check if we have unprofitable days.
Swipe to start coding
- Group data:
- Extract only columns
'day', 'cost', 'money_spent'
from thedf
DataFrame. - Group by the column
'day'
. - Apply
sum()
function to grouped data. - Apply
reset_index()
function.
- Create column
'ROI'
:
- Subtract
df['cost']
fromdf['money_spent']
- Divide the result by
df['cost']
.
Solución
¡Gracias por tus comentarios!
Awesome!
Completion rate improved to 2.08single