import pandas as pd
pokemon_stats = pd.read_csv("pokemon-stats/pokemon-stats.csv")
pokemon_names = pd.read_csv("pokemon-names/pokemon-names.csv")
pokemon = pokemon_stats.merge(pokemon_names, left_on="name", right_on="name_en", how="left")
pokemon.head()
| id | name | type_1 | type_2 | total | hp | attack | defense | special_attack | special_defense | speed | generation | legendary | name_en | name_de | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | Bulbasaur | Grass | Poison | 318 | 45 | 49 | 49 | 65 | 65 | 45 | 1 | False | Bulbasaur | Bisasam |
| 1 | 2 | Ivysaur | Grass | Poison | 405 | 60 | 62 | 63 | 80 | 80 | 60 | 1 | False | Ivysaur | Bisaknosp |
| 2 | 3 | Venusaur | Grass | Poison | 525 | 80 | 82 | 83 | 100 | 100 | 80 | 1 | False | Venusaur | Bisaflor |
| 3 | 3 | VenusaurMega Venusaur | Grass | Poison | 625 | 80 | 100 | 123 | 122 | 120 | 80 | 1 | False | NaN | NaN |
| 4 | 4 | Charmander | Fire | NaN | 309 | 39 | 52 | 43 | 60 | 50 | 65 | 1 | False | Charmander | Glumanda |
# Let's list the 10 weakest pokemon in generation 1
(pokemon
.query("generation == 1")
.sort_values("attack")
.head(10)
)
| id | name | type_1 | type_2 | total | hp | attack | defense | special_attack | special_defense | speed | generation | legendary | name_en | name_de | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 121 | 113 | Chansey | Normal | NaN | 450 | 250 | 5 | 5 | 35 | 105 | 50 | 1 | False | Chansey | Chaneira |
| 139 | 129 | Magikarp | Water | NaN | 200 | 20 | 10 | 55 | 15 | 20 | 80 | 1 | False | Magikarp | Karpador |
| 68 | 63 | Abra | Psychic | NaN | 310 | 25 | 20 | 15 | 105 | 55 | 90 | 1 | False | Abra | Abra |
| 14 | 11 | Metapod | Bug | NaN | 205 | 50 | 20 | 55 | 25 | 25 | 30 | 1 | False | Metapod | Safcon |
| 17 | 14 | Kakuna | Bug | Poison | 205 | 45 | 25 | 50 | 25 | 25 | 35 | 1 | False | Kakuna | Kokuna |
| 108 | 100 | Voltorb | Electric | NaN | 330 | 40 | 30 | 50 | 55 | 55 | 100 | 1 | False | Voltorb | Voltobal |
| 13 | 10 | Caterpie | Bug | NaN | 195 | 45 | 30 | 35 | 20 | 20 | 45 | 1 | False | Caterpie | Raupy |
| 69 | 64 | Kadabra | Psychic | NaN | 400 | 40 | 35 | 30 | 120 | 70 | 105 | 1 | False | Kadabra | Kadabra |
| 88 | 81 | Magnemite | Electric | Steel | 325 | 25 | 35 | 70 | 95 | 55 | 45 | 1 | False | Magnemite | Magnetilo |
| 16 | 13 | Weedle | Bug | Poison | 195 | 40 | 35 | 30 | 20 | 20 | 50 | 1 | False | Weedle | Hornliu |
# Which gen 1 Psychic pokemons share names in English and German?
pokemon.query("generation == 1 and type_1 == 'Psychic' and name_en == name_de")
| id | name | type_1 | type_2 | total | hp | attack | defense | special_attack | special_defense | speed | generation | legendary | name_en | name_de | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 68 | 63 | Abra | Psychic | NaN | 310 | 25 | 20 | 15 | 105 | 55 | 90 | 1 | False | Abra | Abra |
| 69 | 64 | Kadabra | Psychic | NaN | 400 | 40 | 35 | 30 | 120 | 70 | 105 | 1 | False | Kadabra | Kadabra |
| 105 | 97 | Hypno | Psychic | NaN | 483 | 85 | 73 | 70 | 73 | 115 | 67 | 1 | False | Hypno | Hypno |
| 165 | 151 | Mew | Psychic | NaN | 600 | 100 | 100 | 100 | 100 | 100 | 100 | 1 | False | Mew | Mew |
# The distributions of pokemon attack stats by generation
pokemon["attack"].hist(
by=pokemon["generation"],
bins=range(0, 300, 20),
figsize=(12, 10)
);