North Korea's Pokémon are out of control! Cell phones are illegal, so nobody is catching the Pokémon.
Pokémon have been counted in the provinces of Bugjjog, Namjjog, and Dongjjog. Data on each type has been collected in a data set you can download. Here's part of the file:
- "Name","Bugjjog","Namjjog","Dongjjog"
- "Squirtle",25,45,93
- "Wartortle",24,45,74
- "Blastoise",24,58,53
- "Caterpie",29,7-0,89
- "Metapod",30,50,61
There is one record for each type seen, showing the counts seen in each province. So, 25 Squirtles were counted in Bugjjog, and 53 Blastoise in Dongjjog.
Write a Python program to analyze the data set. There might be errors in the data. Exclude records with errors from your calculations. Data validation rules:
- There must be a name.
- All numbers must be integers from 0 up to 100.
For valid data, find:
- The total number of Pokémon in each province.
- The total in all provinces.
- The average of the counts for each province, rounded to one decimal place.
- The name and total count of the most common Pokémon.
Here's some sample output:
- North Korean Pokémon
- ===== ====== =======
- Valid records: 38
- Invalid records: 6
- Total records: 44
- Provinces
- ---------
- Bugjjog Total: 969 Mean per type: 25.5
- Namjjog Total: 1938 Mean per type: 51
- Dongjjog Total: 2775 Mean per type: 73.0
- Most common Pokémon
- ---- ------ -------
- Name: Ekans
- Count: 187
Upload your solution here, not to Moodle. The usual programming standards apply.
(No Pokémon were harmed in the creation of this exercise.)