Question: Given a CSV data file as represented by the sample file pokemonTrain.csv, perform the following operations on it. Fill in the missing values in the

Given a CSV data file as represented by the sample file pokemonTrain.csv, perform the following operations on it. Fill in the missing values in the Attack ("atk"), Defense ("def") and Hit Points ("hp") columns as follows: Set the pokemon level threshold to 40. For a Pokemon having level above the threshold (i.e. > 40), fill in the missing value for atk/def/hp with the average values of atk/def/hp of Pokemons with level > 40. So, for instance, you would substitute the missing "atk" value for Magmar (level 44), with the average "atk" value for Pokemons with level > 40. Round the average to one decimal place. For a Pokemon having level equal to or below the threshold (i.e. <= 40), fill in the missing value for atk/def/hp with the average values of atk/def/hp of Pokemons with level <= 40. Round the average to one decimal place

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!