Challenge: Plot Monthly Transaction Volumes
Taak
Swipe to start coding
Given a DataFrame of transactions with dates, your goal is to group transactions by month, calculate the monthly totals for deposits and withdrawals, and plot both on the same chart using matplotlib.
- Convert the
datecolumn to datetime and extract the month in "YYYY-MM" format. - Group the data by month and transaction type, summing the
amountfor each group. - Create a line or bar chart that displays both deposit and withdrawal totals for each month on the same plot.
- The chart must have labeled axes, a title, and a legend distinguishing deposits and withdrawals.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 5
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Suggested prompts:
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Geweldig!
Completion tarief verbeterd naar 4.76
Challenge: Plot Monthly Transaction Volumes
Veeg om het menu te tonen
Taak
Swipe to start coding
Given a DataFrame of transactions with dates, your goal is to group transactions by month, calculate the monthly totals for deposits and withdrawals, and plot both on the same chart using matplotlib.
- Convert the
datecolumn to datetime and extract the month in "YYYY-MM" format. - Group the data by month and transaction type, summing the
amountfor each group. - Create a line or bar chart that displays both deposit and withdrawal totals for each month on the same plot.
- The chart must have labeled axes, a title, and a legend distinguishing deposits and withdrawals.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 5
single