2020: Week 3
NBA Results to NBA Standings
This week’s challenge is a simple concept that’s tricky to execute: we want to take the current results from the 2019/20 NBA season (as of Jan 6th, 2020 at 11:00AM GMT+0) and produce two league tables: one for the Eastern Conference and one for the Western Conference.We’ve sourced the game results in CSV format from www.basketball-reference.com and the exact league tables we’re recreating are the ones provided by Google.
The link above displays the current standings, however we’re aiming to recreate the ones seen below as they represent the standings at 11:00AM GMT+0 on Jan 6th, 2020.
Eastern Conference Standings |
Western Conference Standings |
Input
There is one input with 5 sheets:- Team List
- October
- November
- December
- January
"Team List" contains the details of the conference and division for each team, whilst the other sheets contain the results of all the games so far. January's sheet has some empty results as those games have not yet been played.
Requirements
For each team we're looking to discover the following information:
- Rank: Rank for each team within their conference.
- W: Wins for each team.
- L: Losses for each team.
- Pct: Win percentage for each team.
- Conf: The wins and losses for each team against teams within the same conference only.
- Home: The wins and losses for home games for each team.
- Away: The wins and losses for away games for each team.
- L10: The wins and losses for the last (most recently played) 10 games for each team.
- Strk: The current winning or losing streak that each team is on.
After producing these pieces of information, split the teams into two separate outputs - one for each conference.
Output
There should be two outputs - one for each conference - that meet the following criteria.
- 15 rows.
- 10 fields:
- Rank
- Team
- W
- L
- Pct
- Conf
- Home
- Away
- L10
- Strk
- The output should match the screenshots shown above.
You can also see our output here. You can also update the input file with the latest NBA results using the links above to produce the up-to-date standings if you want! Don’t forget to fill the participation tracker and share your solutions using #PreppinData on Twitter.
Advice
If you're struggling then focus on figuring out one new field at a time - you can always join them all together at the end!