text_plain_output_1.png
import numpy as np

import pandas as pd

filepath = '../input/'
pokemon = pd.read_csv(filepath + 'complete-pokemon-dataset-updated-090420/pokedex_(Update.04.20).csv').drop('Unnamed: 0', axis=1)
columns_to_drop = ['japanese_name', 'german_name', 'against_normal', 'against_fire', 'against_water', 'against_electric', 'against_grass', 'against_ice', 'against_fight', 'against_poison', 'against_ground', 'against_flying', 'against_psychic', 'against_bug', 'against_rock', 'against_ghost', 'against_dragon', 'against_dark', 'against_steel', 'against_fairy']
pokemon = pokemon.drop(columns_to_drop, axis=1)

pokemon.shape

mega_pokemons = pokemon.index[pokemon['name'].apply(lambda x: 'Mega' in x)].tolist()
dinamax_pokemons = pokemon.index[pokemon['name'].apply(lambda x: 'max' in x)].tolist()
to_delete = np.concatenate((mega_pokemons, dinamax_pokemons))
pokemon = pokemon.drop(to_delete, axis=0)

pokemon.columns

pokemon.isnull().sum()

pokemon.loc[240, :]

def find_min_and_max(column_name):
    max_index = pokemon[column_name].idxmax()
    max_pokemon = pokemon.loc[max_index, 'name']
    min_index = pokemon[column_name].idxmin()
    min_pokemon = pokemon.loc[min_index, 'name']

graph_1 = pokemon.groupby('type_1').count().sort_values(by='name')
index_graph_1 = pokemon.groupby('type_1').count().index
graph_2 = pokemon.groupby('type_2').count().sort_values(by='name')
index_graph_2 = pokemon.groupby('type_2').count().index

index_graph_1