Course Content
Introduction to Python for Data Analysis
Introduction to Python for Data Analysis
2. Introduction to Python 2/2
3. Explore Dataset
Data StudyOperations with the FileHow to Explore the DataSorting DataMax, min, mean, medianChallengeGroup DataDive Deeper into Grouping DataGroup Data 2.0Introduction to NumPyPivot TablesRecall Loops.loc FunctionDeal with Several ConditionsChallengeVisualization: First StepsDive Deeper into Visualization
Is Our Project Profitable? ROI 1/2
Is our project profitable? To figure this out, you can calculate one simple metric titled ROI; the formula is:
- Earnings, the sum of the column
'money_spent'
. - Losses, the sum of the column
'cost'
.
Task
Swipe to start coding
- Calculate the sum of the column
df['cost']
, and assign it to the variablecost_sum
. - Calculate the sum of the column
df['money_spent']
, and assign it to the variablespent_sum
. - Calculate
ROI
:
- Subtract
cost_sum
from thespent_sum
. - Divide the subtraction by the
cost_sum
.
- Output the
ROI
.
The result was already multiplied by 100 to get it in percentage.
Solution
Everything was clear?
Thanks for your feedback!
Section 4. Chapter 9
Is Our Project Profitable? ROI 1/2
Is our project profitable? To figure this out, you can calculate one simple metric titled ROI; the formula is:
- Earnings, the sum of the column
'money_spent'
. - Losses, the sum of the column
'cost'
.
Task
Swipe to start coding
- Calculate the sum of the column
df['cost']
, and assign it to the variablecost_sum
. - Calculate the sum of the column
df['money_spent']
, and assign it to the variablespent_sum
. - Calculate
ROI
:
- Subtract
cost_sum
from thespent_sum
. - Divide the subtraction by the
cost_sum
.
- Output the
ROI
.
The result was already multiplied by 100 to get it in percentage.
Solution
Everything was clear?
Thanks for your feedback!
Section 4. Chapter 9