Pokemon With Error - Ipynb - Colaboratory
Pokemon With Error - Ipynb - Colaboratory
ipynb - Colaboratory
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
pokemon = pd.read_csv("/content/pokemon.csv")
#Create crosstab of data to plot using div to sum within each row of the table
crosstab_norm = crosstab_01.div(crosstab_01.sum(1), axis = 0)
#Using the percentage data, create a subset for each element of the overlay
#is_legendary overlay generation
pkm_y = pokemon[pokemon.is_legendary == 1]['generation']
pkm_n = pokemon[pokemon.is_legendary == 0]['generation']
#Use the cut function in Pandas to create the bins under 20, 20 to 60 and over 100
#Based on attack
pokemon['VAR'] = pd.cut(x = pokemon['attack'], bins = [0, 20, 60, 100,], labels=["Under 20", "20 to 60", "Over 100"], right = False)
#Using datetime
from datetime import datetime
import pytz
tz = pytz.timezone('Asia/Manila')
manila_now = datetime.now(tz)
#Print timestamp
print("Timestamp:", manila_now)
https://colab.research.google.com/drive/10u73ZWDSYVlL46PcHkAovl4z5zKClFM1#printMode=true 1/3
9/15/23, 2:00 PM Pokemon with error.ipynb - Colaboratory
generation 7
is_legendary
0 78.75
1 21.25 1
Timestamp: 2023-09-15 14:00:08.714969+08:00
https://colab.research.google.com/drive/10u73ZWDSYVlL46PcHkAovl4z5zKClFM1#printMode=true 2/3
9/15/23, 2:00 PM Pokemon with error.ipynb - Colaboratory
https://colab.research.google.com/drive/10u73ZWDSYVlL46PcHkAovl4z5zKClFM1#printMode=true 3/3