The Python program I created reads a dataset of NBA player statistics from a CSV file and analyzes performance trends by year and position. Specifically, it filters the data to focus on the year 2024 and calculates the average points and rebounds across all positions. This analysis is relevant to my topic because it helps answer key questions about how player roles and statistical contributions may be shifting in today’s NBA. Focusing on recent player performance provides supporting evidence trying to determine which positions lead in different stat categories. It also shows which positions are more dominant in different areas.
The filtered subset in my Python program includes only NBA player records from the year 2024. This allows me to focus on the most recent season when analyzing player performance across positions. From this subset, I calculated the average number of points and rebounds. These statistics are directly tied to my topic about how different positions contribute to team success and whether certain roles (like guards, forwards, or centers) are becoming more dominant in scoring or rebounding. I expect point guards to average the most points. I expect this trend to happen because point guards have the basketball for the longest amount of time compared to any other position. Another trend I noticed is that guards average very little rebounds compared to other positions. This is because they are the shortest position compared to forwards and centers. They also spent less time in the paint compared to others.
My NBA Position Comparison Program reads NBA stats data from a CSV file and analyzes player performance. The program uses several functions to read, calculate, and display the data. The main() function controls the program by calling the other functions in order. The read_as_dataframe() function loads the CSV file into a DataFrame using pandas. The get_subset() function returns the full DataFrame (no filtering). The compute() function calculates the average for a specific column, like points or rebounds. The output_stats() function prints the full data and both averages. The program uses variables to hold file names, subsets, and averages. Functions and pandas operations are used to keep the program organized and modular.
I expect my program to show the average points and rebounds for guards only. I have filtered in my code for only guards so only guards should be given.