Challenge: Analyze Profit Trends
Task
Swipe to start coding
Given a CSV file containing columns for Month, Revenue, and Expenses, your goal is to analyze monthly profit trends for a fictional company.
- Calculate the monthly profit by subtracting the
Expensescolumn from theRevenuecolumn for each row. - Compute a 3-month moving average of the monthly profit, with at least one period required for calculation.
- Plot both the monthly profit and its 3-month moving average on a line chart, labeling each line appropriately.
- The x-axis should represent the
Monthcolumn, and the y-axis should represent profit.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 5
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in simpler terms?
What are the next steps I should take?
Can you provide an example?
Awesome!
Completion rate improved to 7.14
Challenge: Analyze Profit Trends
Swipe to show menu
Task
Swipe to start coding
Given a CSV file containing columns for Month, Revenue, and Expenses, your goal is to analyze monthly profit trends for a fictional company.
- Calculate the monthly profit by subtracting the
Expensescolumn from theRevenuecolumn for each row. - Compute a 3-month moving average of the monthly profit, with at least one period required for calculation.
- Plot both the monthly profit and its 3-month moving average on a line chart, labeling each line appropriately.
- The x-axis should represent the
Monthcolumn, and the y-axis should represent profit.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 5
single