<jupyter_start><jupyter_text>Poke PandasData from: https://www.kaggle.com/rounakbanik/pokemon/dataQuick Pandas Tutorial: https://pandas.pydata.org/pandas-docs/stable/10min.htmlQuestions posed by author: * Is it possible to build a classifier to identify legendary Pokemon?* How does height and weight of a Pokemon correlate with its various base stats?* What factors influence the Experience Growth and Egg Steps? Are these quantities correlated?* Which type is the strongest overall? Which is the weakest?* Which type is the most likely to be a legendary Pokemon?* Can you build a Pokemon dream team? A team of 6 Pokemon that inflicts the most damage while remaining relatively impervious to any other team of 6 Pokemon.Task: Explore the data using SciPy and try to answer these questions and pose more.<jupyter_code>%%html
<iframe width="560" height="315" src="https://www.youtube.com/embed/JuYeHPFR3f0" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe><jupyter_output><empty_output><jupyter_text>Loading Libraries<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
pd.set_option('display.max_columns', 500)<jupyter_output><empty_output><jupyter_text>Using Pandas to Load CSV Data<jupyter_code>pokeData = pd.read_csv('..\Data\pokemon.csv')
pokeData.head()
## 801 Rows, 41 Columns 
## 801 Pokemon, 41 Stats
pokeData.shape<jupyter_output><empty_output><jupyter_text>Basic descriptive statistics of the columns.<jupyter_code>pokeData.describe()<jupyter_output><empty_output><jupyter_text>Let's explore the standard deviation of the class weaknesses.<jupyter_code># type(stdOfAdvantage) == pandas.core.series.Series
stdOfAdvantage = pokeData.std()[0:18]
stdOfAdvantage.sort_values(inplace=True)
stdOfAdvantage
stdOfAdvantage.plot(kind="bar",figsize=(20,10))
plt.show()<jupyter_output><empty_output><jupyter_text>By sorting and plotting the standard deviation of the class weaknesses, we can see how consistent the biases towards particular types of pokemon are. The normal pokemon have the smallest standard deviation, as most pokemon have neither a weakness nor strength over them.   How to select columns from the dataframe.<jupyter_code>pokeData["name"]<jupyter_output><empty_output><jupyter_text>Question: Does the length of the name influence weight? Are fatter pokemon given larger names?<jupyter_code>nameLen = pokeData["name"].apply(len)
pokeData = pokeData.assign(nameLength=nameLen)
pokeData.head()
pokeData.groupby("nameLength").mean()["weight_kg"].plot(kind="bar",figsize=(10,10))
plt.show()<jupyter_output><empty_output><jupyter_text>It does seem like there is some descrimination. But wait, how many pokemon have 12 letters in their name?<jupyter_code>pokeData.loc[pokeData["nameLength"]==12]<jupyter_output><empty_output><jupyter_text>There's only one Pokemon with 12 letters in their name. Namely, this dude: It turns out there isn't really a bias when you consider the number of pokemon in each name length group.<jupyter_code>pokeData.groupby("nameLength").size().plot(kind="bar",figsize=(10,10))
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09906421426266537, 'fraction_numerical': 0.015166182639561149, 'mean_word_length': 7.56353591160221, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '448743', 'license': 'MIT', 'n_tokens_mistral': 1019, 'n_tokens_neox': 947, 'n_words': 286, 'path': 'Notebooks/Poke Pandas.ipynb', 'repo_name': 'Andrewnetwork/WorkshopScipy', 'size': '3099'}