Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PYTHON Who was the best NBA basketball player? The NBA is North America’s profes

ID: 3830707 • Letter: P

Question

PYTHON Who was the best NBA basketball player? The NBA is North America’s professional men’s basketball league. You are going to write a program to find the best players in NBA history. Using the csv file provided with the lab. Calculate the efficiency for each player, using the csv file provided with the lab. NBA player’s performance is evaluated using the following efficiency formula. Efficiency = ( ( pts + reb + asts + stl + blk ) - ( ( fga – fgm ) + ( fta – ftm ) + turnover ) ) / gp

I included a link to the CVS file(drop box is the best i could do lol):

https://www.dropbox.com/s/kdytnd7nhtvb6j7/nba.csv?dl=0

1. Find the top 50 players with the best efficiency results and Display those 50 from best to worst.

2. Find and display the Player who played the most minutes

3. Find and display the player who play the most games

4. Find and display the Player who scored the most points

5. Find and display the Player who got the most penalties.

6. Find and display the Player who made the most free throws.

Thanks!

Explanation / Answer

The data you have uploaded in drop box seem to have some problem. Can you recheck. I have tried to clean the data but not successful. I am not able to convert the float values like points, steals, blocks etc because they somehow have the char values. Below is the error i am getting.

Can you atleast provide the sample 10 lines of same by pasting in your question. That way the script written can be used on the larger data.

186590cb0725:Chegg bonkv$ python nba_perf.py

23.3 4.2 10.5 165.0 0.6 18.3 8.3 6.8 5.5 4.1 80.2

Traceback (most recent call last):

File "nba_perf.py", line 12, in <module>

(pts, reb, asts, stl, blk) = (float(fields[5]), float(fields[6]), float(fields[7]), float(fields[8]), float(fields[9]))

ValueError: could not convert string to float: