diff --git a/your-code/challenge-1.ipynb b/your-code/challenge-1.ipynb
index c1bb43d..604dc3b 100755
--- a/your-code/challenge-1.ipynb
+++ b/your-code/challenge-1.ipynb
@@ -19,12 +19,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 64,
"metadata": {},
"outputs": [],
"source": [
"# Import libraries\n",
- "import pandas as pd"
+ "import pandas as pd\n",
+ "import scipy.stats as st"
]
},
{
@@ -38,11 +39,266 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 15,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " # | \n",
+ " Name | \n",
+ " Type 1 | \n",
+ " Type 2 | \n",
+ " Total | \n",
+ " HP | \n",
+ " Attack | \n",
+ " Defense | \n",
+ " Sp. Atk | \n",
+ " Sp. Def | \n",
+ " Speed | \n",
+ " Generation | \n",
+ " Legendary | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 1 | \n",
+ " Bulbasaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 318 | \n",
+ " 45 | \n",
+ " 49 | \n",
+ " 49 | \n",
+ " 65 | \n",
+ " 65 | \n",
+ " 45 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2 | \n",
+ " Ivysaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 405 | \n",
+ " 60 | \n",
+ " 62 | \n",
+ " 63 | \n",
+ " 80 | \n",
+ " 80 | \n",
+ " 60 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 3 | \n",
+ " Venusaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 525 | \n",
+ " 80 | \n",
+ " 82 | \n",
+ " 83 | \n",
+ " 100 | \n",
+ " 100 | \n",
+ " 80 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 3 | \n",
+ " VenusaurMega Venusaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 625 | \n",
+ " 80 | \n",
+ " 100 | \n",
+ " 123 | \n",
+ " 122 | \n",
+ " 120 | \n",
+ " 80 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 4 | \n",
+ " Charmander | \n",
+ " Fire | \n",
+ " NaN | \n",
+ " 309 | \n",
+ " 39 | \n",
+ " 52 | \n",
+ " 43 | \n",
+ " 60 | \n",
+ " 50 | \n",
+ " 65 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " | 795 | \n",
+ " 719 | \n",
+ " Diancie | \n",
+ " Rock | \n",
+ " Fairy | \n",
+ " 600 | \n",
+ " 50 | \n",
+ " 100 | \n",
+ " 150 | \n",
+ " 100 | \n",
+ " 150 | \n",
+ " 50 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 796 | \n",
+ " 719 | \n",
+ " DiancieMega Diancie | \n",
+ " Rock | \n",
+ " Fairy | \n",
+ " 700 | \n",
+ " 50 | \n",
+ " 160 | \n",
+ " 110 | \n",
+ " 160 | \n",
+ " 110 | \n",
+ " 110 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 797 | \n",
+ " 720 | \n",
+ " HoopaHoopa Confined | \n",
+ " Psychic | \n",
+ " Ghost | \n",
+ " 600 | \n",
+ " 80 | \n",
+ " 110 | \n",
+ " 60 | \n",
+ " 150 | \n",
+ " 130 | \n",
+ " 70 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 798 | \n",
+ " 720 | \n",
+ " HoopaHoopa Unbound | \n",
+ " Psychic | \n",
+ " Dark | \n",
+ " 680 | \n",
+ " 80 | \n",
+ " 160 | \n",
+ " 60 | \n",
+ " 170 | \n",
+ " 130 | \n",
+ " 80 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 799 | \n",
+ " 721 | \n",
+ " Volcanion | \n",
+ " Fire | \n",
+ " Water | \n",
+ " 600 | \n",
+ " 80 | \n",
+ " 110 | \n",
+ " 120 | \n",
+ " 130 | \n",
+ " 90 | \n",
+ " 70 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
800 rows × 13 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " # Name Type 1 Type 2 Total HP Attack Defense \\\n",
+ "0 1 Bulbasaur Grass Poison 318 45 49 49 \n",
+ "1 2 Ivysaur Grass Poison 405 60 62 63 \n",
+ "2 3 Venusaur Grass Poison 525 80 82 83 \n",
+ "3 3 VenusaurMega Venusaur Grass Poison 625 80 100 123 \n",
+ "4 4 Charmander Fire NaN 309 39 52 43 \n",
+ ".. ... ... ... ... ... .. ... ... \n",
+ "795 719 Diancie Rock Fairy 600 50 100 150 \n",
+ "796 719 DiancieMega Diancie Rock Fairy 700 50 160 110 \n",
+ "797 720 HoopaHoopa Confined Psychic Ghost 600 80 110 60 \n",
+ "798 720 HoopaHoopa Unbound Psychic Dark 680 80 160 60 \n",
+ "799 721 Volcanion Fire Water 600 80 110 120 \n",
+ "\n",
+ " Sp. Atk Sp. Def Speed Generation Legendary \n",
+ "0 65 65 45 1 False \n",
+ "1 80 80 60 1 False \n",
+ "2 100 100 80 1 False \n",
+ "3 122 120 80 1 False \n",
+ "4 60 50 65 1 False \n",
+ ".. ... ... ... ... ... \n",
+ "795 100 150 50 6 True \n",
+ "796 160 110 110 6 True \n",
+ "797 150 130 70 6 True \n",
+ "798 170 130 80 6 True \n",
+ "799 130 90 70 6 True \n",
+ "\n",
+ "[800 rows x 13 columns]"
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "# Your code here:\n"
+ "# Your code here:\n",
+ "pokemon = pd.read_csv('Pokemon.csv')\n",
+ "pokemon"
]
},
{
@@ -61,6 +317,15 @@
"execution_count": null,
"metadata": {},
"outputs": [],
+ "source": [
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 68,
+ "metadata": {},
+ "outputs": [],
"source": [
"def t_test_features(s1, s2, features=['HP', 'Attack', 'Defense', 'Sp. Atk', 'Sp. Def', 'Speed', 'Total']):\n",
" \"\"\"Test means of a feature set of two samples\n",
@@ -73,13 +338,24 @@
" Returns:\n",
" dict: a dictionary of t-test scores for each feature where the feature name is the key and the p-value is the value\n",
" \"\"\"\n",
+ " import scipy.stats as st\n",
" results = {}\n",
"\n",
" # Your code here\n",
+ " for feature in features:\n",
+ " t, p = st.ttest_ind(s1[feature],s2[feature] )\n",
+ " results[feature] = p\n",
" \n",
" return results"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -101,11 +377,33 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 69,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "{'HP': 3.330647684846191e-15,\n",
+ " 'Attack': 7.827253003205333e-24,\n",
+ " 'Defense': 1.5842226094427255e-12,\n",
+ " 'Sp. Atk': 6.314915770427266e-41,\n",
+ " 'Sp. Def': 1.8439809580409594e-26,\n",
+ " 'Speed': 2.3540754436898437e-21,\n",
+ " 'Total': 3.0952457469652825e-52}"
+ ]
+ },
+ "execution_count": 69,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "# Your code here\n"
+ "# Your code here\n",
+ "legendary = pokemon[pokemon['Legendary']==True]\n",
+ "non_legendary = pokemon[pokemon['Legendary']==False]\n",
+ "\n",
+ "\n",
+ "t_test_features(legendary,non_legendary)"
]
},
{
@@ -121,7 +419,8 @@
"metadata": {},
"outputs": [],
"source": [
- "# Your comment here"
+ "# Your comment here\n",
+ "#they are diferent"
]
},
{
@@ -133,11 +432,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 49,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "{'HP': 0.13791881412813622,\n",
+ " 'Attack': 0.24050968418101457,\n",
+ " 'Defense': 0.5407630349194362,\n",
+ " 'Sp. Atk': 0.14119788176331508,\n",
+ " 'Sp. Def': 0.16781226231606386,\n",
+ " 'Speed': 0.0028356954812578704,\n",
+ " 'Total': 0.5599140649014442}"
+ ]
+ },
+ "execution_count": 49,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "# Your code here\n"
+ "# Your code here\n",
+ "g1 = pokemon[pokemon['Generation']==1]\n",
+ "g2 = pokemon[pokemon['Generation']==2]\n",
+ "\n",
+ "t_test_features(g1,g2)"
]
},
{
@@ -149,11 +469,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 46,
"metadata": {},
"outputs": [],
"source": [
- "# Your comment here"
+ "# Your comment here\n",
+ "#theres is no diference"
]
},
{
@@ -165,11 +486,33 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 59,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "{'HP': 0.11060643144431842,\n",
+ " 'Attack': 0.00015741395666164396,\n",
+ " 'Defense': 3.250594205757004e-08,\n",
+ " 'Sp. Atk': 0.0001454917404035147,\n",
+ " 'Sp. Def': 0.00010893304795534396,\n",
+ " 'Speed': 0.024051410794037463,\n",
+ " 'Total': 1.1749035008828752e-07}"
+ ]
+ },
+ "execution_count": 59,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "# Your code here\n"
+ "# Your code here\n",
+ "st = pokemon[pokemon['Type 2'].isnull()]\n",
+ "tt = pokemon[pokemon['Type 2'].notnull()]\n",
+ "\n",
+ "\n",
+ "t_test_features(st,tt)"
]
},
{
@@ -185,7 +528,8 @@
"metadata": {},
"outputs": [],
"source": [
- "# Your comment here"
+ "# Your comment here\n",
+ "#there is a big diference in Defense"
]
},
{
@@ -199,11 +543,28 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 76,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Atack vs Defense Sig.Dif: Ttest_relResult(statistic=4.325566393330478, pvalue=1.7140303479358558e-05)\n",
+ "Sp Atack vs Sp Defense Sig.Dif: Ttest_relResult(statistic=0.853986188453353, pvalue=0.3933685997548122)\n"
+ ]
+ }
+ ],
"source": [
- "# Your code here\n"
+ "# Your code here\n",
+ "\n",
+ "at = pokemon['Attack']\n",
+ "de = pokemon['Defense']\n",
+ "print(\"Atack vs Defense Sig.Dif:\",st.ttest_rel(at,de))\n",
+ "\n",
+ "sat = pokemon['Sp. Atk']\n",
+ "sde = pokemon['Sp. Def']\n",
+ "print(\"Sp Atack vs Sp Defense Sig.Dif:\",st.ttest_rel(sat,sde))"
]
},
{
@@ -225,7 +586,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -239,7 +600,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.3"
+ "version": "3.9.13"
}
},
"nbformat": 4,
diff --git a/your-code/challenge-2.ipynb b/your-code/challenge-2.ipynb
index 1f0e335..6c0bdcf 100755
--- a/your-code/challenge-2.ipynb
+++ b/your-code/challenge-2.ipynb
@@ -17,21 +17,277 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"# Import libraries\n",
- "import pandas as pd"
+ "import pandas as pd\n",
+ "from scipy import stats"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 9,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " # | \n",
+ " Name | \n",
+ " Type 1 | \n",
+ " Type 2 | \n",
+ " Total | \n",
+ " HP | \n",
+ " Attack | \n",
+ " Defense | \n",
+ " Sp. Atk | \n",
+ " Sp. Def | \n",
+ " Speed | \n",
+ " Generation | \n",
+ " Legendary | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 1 | \n",
+ " Bulbasaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 318 | \n",
+ " 45 | \n",
+ " 49 | \n",
+ " 49 | \n",
+ " 65 | \n",
+ " 65 | \n",
+ " 45 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 2 | \n",
+ " Ivysaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 405 | \n",
+ " 60 | \n",
+ " 62 | \n",
+ " 63 | \n",
+ " 80 | \n",
+ " 80 | \n",
+ " 60 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 3 | \n",
+ " Venusaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 525 | \n",
+ " 80 | \n",
+ " 82 | \n",
+ " 83 | \n",
+ " 100 | \n",
+ " 100 | \n",
+ " 80 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 3 | \n",
+ " VenusaurMega Venusaur | \n",
+ " Grass | \n",
+ " Poison | \n",
+ " 625 | \n",
+ " 80 | \n",
+ " 100 | \n",
+ " 123 | \n",
+ " 122 | \n",
+ " 120 | \n",
+ " 80 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 4 | \n",
+ " Charmander | \n",
+ " Fire | \n",
+ " NaN | \n",
+ " 309 | \n",
+ " 39 | \n",
+ " 52 | \n",
+ " 43 | \n",
+ " 60 | \n",
+ " 50 | \n",
+ " 65 | \n",
+ " 1 | \n",
+ " False | \n",
+ "
\n",
+ " \n",
+ " | ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " | 795 | \n",
+ " 719 | \n",
+ " Diancie | \n",
+ " Rock | \n",
+ " Fairy | \n",
+ " 600 | \n",
+ " 50 | \n",
+ " 100 | \n",
+ " 150 | \n",
+ " 100 | \n",
+ " 150 | \n",
+ " 50 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 796 | \n",
+ " 719 | \n",
+ " DiancieMega Diancie | \n",
+ " Rock | \n",
+ " Fairy | \n",
+ " 700 | \n",
+ " 50 | \n",
+ " 160 | \n",
+ " 110 | \n",
+ " 160 | \n",
+ " 110 | \n",
+ " 110 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 797 | \n",
+ " 720 | \n",
+ " HoopaHoopa Confined | \n",
+ " Psychic | \n",
+ " Ghost | \n",
+ " 600 | \n",
+ " 80 | \n",
+ " 110 | \n",
+ " 60 | \n",
+ " 150 | \n",
+ " 130 | \n",
+ " 70 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 798 | \n",
+ " 720 | \n",
+ " HoopaHoopa Unbound | \n",
+ " Psychic | \n",
+ " Dark | \n",
+ " 680 | \n",
+ " 80 | \n",
+ " 160 | \n",
+ " 60 | \n",
+ " 170 | \n",
+ " 130 | \n",
+ " 80 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ " | 799 | \n",
+ " 721 | \n",
+ " Volcanion | \n",
+ " Fire | \n",
+ " Water | \n",
+ " 600 | \n",
+ " 80 | \n",
+ " 110 | \n",
+ " 120 | \n",
+ " 130 | \n",
+ " 90 | \n",
+ " 70 | \n",
+ " 6 | \n",
+ " True | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
800 rows × 13 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " # Name Type 1 Type 2 Total HP Attack Defense \\\n",
+ "0 1 Bulbasaur Grass Poison 318 45 49 49 \n",
+ "1 2 Ivysaur Grass Poison 405 60 62 63 \n",
+ "2 3 Venusaur Grass Poison 525 80 82 83 \n",
+ "3 3 VenusaurMega Venusaur Grass Poison 625 80 100 123 \n",
+ "4 4 Charmander Fire NaN 309 39 52 43 \n",
+ ".. ... ... ... ... ... .. ... ... \n",
+ "795 719 Diancie Rock Fairy 600 50 100 150 \n",
+ "796 719 DiancieMega Diancie Rock Fairy 700 50 160 110 \n",
+ "797 720 HoopaHoopa Confined Psychic Ghost 600 80 110 60 \n",
+ "798 720 HoopaHoopa Unbound Psychic Dark 680 80 160 60 \n",
+ "799 721 Volcanion Fire Water 600 80 110 120 \n",
+ "\n",
+ " Sp. Atk Sp. Def Speed Generation Legendary \n",
+ "0 65 65 45 1 False \n",
+ "1 80 80 60 1 False \n",
+ "2 100 100 80 1 False \n",
+ "3 122 120 80 1 False \n",
+ "4 60 50 65 1 False \n",
+ ".. ... ... ... ... ... \n",
+ "795 100 150 50 6 True \n",
+ "796 160 110 110 6 True \n",
+ "797 150 130 70 6 True \n",
+ "798 170 130 80 6 True \n",
+ "799 130 90 70 6 True \n",
+ "\n",
+ "[800 rows x 13 columns]"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "# Load the data:\n"
+ "# Load the data:\n",
+ "pokemon = pd.read_csv('Pokemon.csv')\n",
+ "pokemon"
]
},
{
@@ -58,12 +314,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 8,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "19"
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"# Your code here\n",
"\n",
+ "poke = pd.concat([pokemon['Type 1'], pokemon['Type 2']])\n",
+ "unique_types = poke.unique()\n",
"\n",
"len(unique_types) # you should see 19"
]
@@ -85,13 +354,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 39,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "18"
+ ]
+ },
+ "execution_count": 39,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"pokemon_totals = []\n",
"\n",
- "# Your code here\n",
+ "import math\n",
+ "\n",
+ "# Assuming you have a DataFrame called 'pokemon_data' with appropriate column names\n",
+ "\n",
+ "# Initialize an empty list\n",
+ "pokemon_totals = []\n",
+ "\n",
+ "# Loop through unique types and append Total values\n",
+ "for t in unique_types:\n",
+ " if isinstance(t, str): # Skip NaN values\n",
+ " type_total = pokemon.loc[(pokemon['Type 1'] == t) | (pokemon['Type 2'] == t), 'Total'].sum()\n",
+ " pokemon_totals.append(type_total)\n",
+ "\n",
+ "\n",
"\n",
"len(pokemon_totals) # you should see 18"
]
@@ -111,11 +404,30 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 43,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "ename": "ValueError",
+ "evalue": "zero-dimensional arrays cannot be concatenated",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_8140\\2158077923.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mstats\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mf_oneway\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mpokemon_totals\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\scipy\\stats\\_stats_py.py\u001b[0m in \u001b[0;36mf_oneway\u001b[1;34m(axis, *samples)\u001b[0m\n\u001b[0;32m 3861\u001b[0m \u001b[1;31m# if the dimensions of all the arrays, except the axis dimension, are not\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3862\u001b[0m \u001b[1;31m# the same.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3863\u001b[1;33m \u001b[0malldata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconcatenate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msamples\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3864\u001b[0m \u001b[0mbign\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0malldata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3865\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;32m<__array_function__ internals>\u001b[0m in \u001b[0;36mconcatenate\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
+ "\u001b[1;31mValueError\u001b[0m: zero-dimensional arrays cannot be concatenated"
+ ]
+ }
+ ],
"source": [
- "# Your code here\n"
+ "# Your code here\n",
+ "from scipy import stats\n",
+ "\n",
+ "\n",
+ "stats.f_oneway(*pokemon_totals)\n",
+ "\n"
]
},
{
@@ -127,17 +439,24 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
- "# Your comment here"
+ "# Your comment here\n"
]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -151,7 +470,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.3"
+ "version": "3.9.13"
}
},
"nbformat": 4,