Football Team Performance (Last 5 matches)

Job ID: 36726747

Budget: $10 – $20 USD

Hey experts,

I have attached a sample data here. I need you to provide the following information:
1.) Home Team's Last 5 Match Results (H/D/A); eg, HHDAH
2.) Away Team's Last 5 Match Results (H/D/A); eg AAAHD

From 1 & 2 above, calculate total points for each team by adding:
3.) Home Team's Last 5 Match Points (H=3, D=1, A=0) = 3+3+1+0+3
4.) Away Team's Last 5 Match Points (H=0, D=1, A=3) = 3+3+3+0+1

Provide 1-4 in new columns.

Note: if the current match row has a date today, the last 5 matches began yesterday.
Related categories: Python Data Science Data Analytics Data Analysis Pandas