Question: NOT ALLOWED TO USE PANDA!!!!!! Has to do it manually. The data passed in is a list already, no need to read it again. Thx

NOT ALLOWED TO USE PANDA!!!!!!

Has to do it manually. The data passed in is a list already, no need to read it again. Thx

NOT ALLOWED TO USE PANDA!!!!!! Has to do it manually. The data

passed in is a list already, no need to read it again.

id, name, level, personality, type, weakness, atk, def, hp, stage 59, Arcanine, 35, impish, fire, water,50,55,90,2 59, Arcanine, 35, gentle, fire, water, 45, 60, 80,2 121, Starmie, 67, sassy, water, electric, 174,56, 113,2 131, Lapras, 72, lax, water, electric, 107, 113,29,1 Write a function called mean_attack_per_type that calculates the average attack for every type of Pokemon in the dataset. This function should return a dictionary that has keys that are the Pokemon types and values that are the average attack for that Pokemon type. The order of the keys in the returned dictionary does not matter. In terms of efficiency, your solution should NOT iterate over the whole dataset once for each type of pokemon since that would be overly inefficient. For example, assuming we have parsed pokemon_test.csy and stored it in a variable called data : 1 mean_attack_per_type data # {'water': 140.5, 'fire': 47.5}

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 Databases Questions!