{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.4-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python394jvsc74a57bd081118431cc388d258ed977b65143603a98f8ad6ed776c173758a3af876bc6de9",
"display_name": "Python 3.9.4 64-bit"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd \n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"shark = pd.read_csv('SharkData.csv')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
" SharkSpeciesName NumberSpecimens Specimenid SharkLength \\\n",
"0 Smoothhound 3 1 104.81 \n",
"1 Smoothhound 3 1 104.81 \n",
"2 Smoothhound 3 2 100.00 \n",
"3 Smoothhound 3 2 100.00 \n",
"4 Smoothhound 3 3 62.00 \n",
"5 Smoothhound 3 3 62.00 \n",
"6 Spiny 3 1 92.00 \n",
"7 Spiny 3 1 92.00 \n",
"8 Spiny 3 2 85.00 \n",
"9 Spiny 3 2 85.00 \n",
"10 Spiny 3 4 97.00 \n",
"11 Spiny 3 4 97.00 \n",
"12 Bamboo 3 1 88.40 \n",
"13 Bamboo 3 1 88.40 \n",
"14 Bamboo 3 2 77.80 \n",
"15 Bamboo 3 2 77.80 \n",
"16 Bamboo 3 3 84.50 \n",
"17 Bamboo 3 3 84.50 \n",
"18 Sandbar 3 1 68.40 \n",
"19 Sandbar 3 1 68.40 \n",
"20 Sandbar 3 2 54.10 \n",
"21 Sandbar 3 2 54.10 \n",
"22 Sandbar 3 3 56.00 \n",
"23 Sandbar 3 3 56.00 \n",
"24 Mako 3 1 175.00 \n",
"25 Mako 3 1 175.00 \n",
"26 Mako 3 2 194.00 \n",
"27 Mako 3 2 194.00 \n",
"28 Mako 3 3 185.00 \n",
"29 Mako 3 3 185.00 \n",
"30 Skate 3 1 46.90 \n",
"31 Skate 3 1 46.90 \n",
"32 Skate 3 2 44.37 \n",
"33 Skate 3 2 44.37 \n",
"34 Skate 3 3 45.33 \n",
"35 Skate 3 3 45.33 \n",
"36 Thresher 1 2 225.00 \n",
"37 Thresher 1 2 225.00 \n",
"\n",
" MuscleName MuscleMass MuscleForce MuscleCrossSectionalArea \\\n",
"0 Smoothhound 1 PO 1.286 1.925 0.325 \n",
"1 Smoothhound 1 QM 4.753 36.127 2.199 \n",
"2 Smoothhound 2 PO 1.469 2.685 0.444 \n",
"3 Smoothhound 2 QM 5.978 34.755 2.682 \n",
"4 Smoothhound 3 PO 0.460 1.348 0.241 \n",
"5 Smoothhound 3 QM 1.706 17.295 1.345 \n",
"6 Spiny 1 PO 1.150 5.520 0.984 \n",
"7 Spiny 1 QM 6.681 31.670 3.891 \n",
"8 Spiny 2 PO 0.867 4.108 0.493 \n",
"9 Spiny 2 QM 5.001 23.188 2.587 \n",
"10 Spiny 4 PO 1.119 2.022 0.302 \n",
"11 Spiny 4 QM 7.788 38.920 3.746 \n",
"12 Bamboo 1 PO 3.576 29.477 1.223 \n",
"13 Bamboo 1 QM 6.513 34.499 2.844 \n",
"14 Bamboo 2 PO 3.551 45.326 1.878 \n",
"15 Bamboo 2 QM 7.022 36.430 2.938 \n",
"16 Bamboo 3 PO 0.460 NaN 1.693 \n",
"17 Bamboo 3 QM 7.128 NaN 3.945 \n",
"18 Sandbar 1 PO 1.886 4.232 0.438 \n",
"19 Sandbar 1 QM 3.986 17.845 1.988 \n",
"20 Sandbar 2 PO 0.859 4.270 0.328 \n",
"21 Sandbar 2 QM 1.567 9.029 0.968 \n",
"22 Sandbar 3 PO 0.640 2.618 0.213 \n",
"23 Sandbar 3 QM 1.232 6.197 0.756 \n",
"24 Mako 1 PO 0.710 6.659 0.683 \n",
"25 Mako 1 QM 108.750 165.931 13.450 \n",
"26 Mako 2 PO 5.201 5.385 0.543 \n",
"27 Mako 2 QM 86.197 148.462 14.242 \n",
"28 Mako 3 PO 13.772 12.956 1.468 \n",
"29 Mako 3 QM 188.000 216.035 23.442 \n",
"30 Skate 1 PO 0.346 3.062 0.260 \n",
"31 Skate 1 QM 5.753 57.628 5.420 \n",
"32 Skate 2 PO 0.085 0.978 0.083 \n",
"33 Skate 2 QM 1.660 14.173 1.555 \n",
"34 Skate 3 PO 0.137 1.740 0.153 \n",
"35 Skate 3 QM 3.768 26.207 27.540 \n",
"36 Thresher 2 PO 6.006 18.475 1.500 \n",
"37 Thresher 2 QM 43.494 144.641 10.753 \n",
"\n",
" SharkBiteForce \n",
"0 38.052 \n",
"1 38.052 \n",
"2 37.440 \n",
"3 37.440 \n",
"4 18.643 \n",
"5 18.643 \n",
"6 37.222 \n",
"7 37.222 \n",
"8 27.296 \n",
"9 27.296 \n",
"10 40.942 \n",
"11 40.942 \n",
"12 39.236 \n",
"13 39.236 \n",
"14 39.368 \n",
"15 39.368 \n",
"16 NaN \n",
"17 NaN \n",
"18 22.077 \n",
"19 22.077 \n",
"20 13.300 \n",
"21 13.300 \n",
"22 8.814 \n",
"23 8.814 \n",
"24 172.590 \n",
"25 172.590 \n",
"26 153.847 \n",
"27 153.847 \n",
"28 228.991 \n",
"29 228.991 \n",
"30 60.690 \n",
"31 60.690 \n",
"32 15.151 \n",
"33 15.151 \n",
"34 27.947 \n",
"35 27.947 \n",
"36 163.116 \n",
"37 163.116 "
],
"text/html": "
\n\n
\n\n\n | \nSharkSpeciesName | \nNumberSpecimens | \nSpecimenid | \nSharkLength | \nMuscleName | \nMuscleMass | \nMuscleForce | \nMuscleCrossSectionalArea | \nSharkBiteForce | \n
\n\n\n\n0 | \nSmoothhound | \n3 | \n1 | \n104.81 | \nSmoothhound 1 PO | \n1.286 | \n1.925 | \n0.325 | \n38.052 | \n
\n\n1 | \nSmoothhound | \n3 | \n1 | \n104.81 | \nSmoothhound 1 QM | \n4.753 | \n36.127 | \n2.199 | \n38.052 | \n
\n\n2 | \nSmoothhound | \n3 | \n2 | \n100.00 | \nSmoothhound 2 PO | \n1.469 | \n2.685 | \n0.444 | \n37.440 | \n
\n\n3 | \nSmoothhound | \n3 | \n2 | \n100.00 | \nSmoothhound 2 QM | \n5.978 | \n34.755 | \n2.682 | \n37.440 | \n
\n\n4 | \nSmoothhound | \n3 | \n3 | \n62.00 | \nSmoothhound 3 PO | \n0.460 | \n1.348 | \n0.241 | \n18.643 | \n
\n\n5 | \nSmoothhound | \n3 | \n3 | \n62.00 | \nSmoothhound 3 QM | \n1.706 | \n17.295 | \n1.345 | \n18.643 | \n
\n\n6 | \nSpiny | \n3 | \n1 | \n92.00 | \nSpiny 1 PO | \n1.150 | \n5.520 | \n0.984 | \n37.222 | \n
\n\n7 | \nSpiny | \n3 | \n1 | \n92.00 | \nSpiny 1 QM | \n6.681 | \n31.670 | \n3.891 | \n37.222 | \n
\n\n8 | \nSpiny | \n3 | \n2 | \n85.00 | \nSpiny 2 PO | \n0.867 | \n4.108 | \n0.493 | \n27.296 | \n
\n\n9 | \nSpiny | \n3 | \n2 | \n85.00 | \nSpiny 2 QM | \n5.001 | \n23.188 | \n2.587 | \n27.296 | \n
\n\n10 | \nSpiny | \n3 | \n4 | \n97.00 | \nSpiny 4 PO | \n1.119 | \n2.022 | \n0.302 | \n40.942 | \n
\n\n11 | \nSpiny | \n3 | \n4 | \n97.00 | \nSpiny 4 QM | \n7.788 | \n38.920 | \n3.746 | \n40.942 | \n
\n\n12 | \nBamboo | \n3 | \n1 | \n88.40 | \nBamboo 1 PO | \n3.576 | \n29.477 | \n1.223 | \n39.236 | \n
\n\n13 | \nBamboo | \n3 | \n1 | \n88.40 | \nBamboo 1 QM | \n6.513 | \n34.499 | \n2.844 | \n39.236 | \n
\n\n14 | \nBamboo | \n3 | \n2 | \n77.80 | \nBamboo 2 PO | \n3.551 | \n45.326 | \n1.878 | \n39.368 | \n
\n\n15 | \nBamboo | \n3 | \n2 | \n77.80 | \nBamboo 2 QM | \n7.022 | \n36.430 | \n2.938 | \n39.368 | \n
\n\n16 | \nBamboo | \n3 | \n3 | \n84.50 | \nBamboo 3 PO | \n0.460 | \nNaN | \n1.693 | \nNaN | \n
\n\n17 | \nBamboo | \n3 | \n3 | \n84.50 | \nBamboo 3 QM | \n7.128 | \nNaN | \n3.945 | \nNaN | \n
\n\n18 | \nSandbar | \n3 | \n1 | \n68.40 | \nSandbar 1 PO | \n1.886 | \n4.232 | \n0.438 | \n22.077 | \n
\n\n19 | \nSandbar | \n3 | \n1 | \n68.40 | \nSandbar 1 QM | \n3.986 | \n17.845 | \n1.988 | \n22.077 | \n
\n\n20 | \nSandbar | \n3 | \n2 | \n54.10 | \nSandbar 2 PO | \n0.859 | \n4.270 | \n0.328 | \n13.300 | \n
\n\n21 | \nSandbar | \n3 | \n2 | \n54.10 | \nSandbar 2 QM | \n1.567 | \n9.029 | \n0.968 | \n13.300 | \n
\n\n22 | \nSandbar | \n3 | \n3 | \n56.00 | \nSandbar 3 PO | \n0.640 | \n2.618 | \n0.213 | \n8.814 | \n
\n\n23 | \nSandbar | \n3 | \n3 | \n56.00 | \nSandbar 3 QM | \n1.232 | \n6.197 | \n0.756 | \n8.814 | \n
\n\n24 | \nMako | \n3 | \n1 | \n175.00 | \nMako 1 PO | \n0.710 | \n6.659 | \n0.683 | \n172.590 | \n
\n\n25 | \nMako | \n3 | \n1 | \n175.00 | \nMako 1 QM | \n108.750 | \n165.931 | \n13.450 | \n172.590 | \n
\n\n26 | \nMako | \n3 | \n2 | \n194.00 | \nMako 2 PO | \n5.201 | \n5.385 | \n0.543 | \n153.847 | \n
\n\n27 | \nMako | \n3 | \n2 | \n194.00 | \nMako 2 QM | \n86.197 | \n148.462 | \n14.242 | \n153.847 | \n
\n\n28 | \nMako | \n3 | \n3 | \n185.00 | \nMako 3 PO | \n13.772 | \n12.956 | \n1.468 | \n228.991 | \n
\n\n29 | \nMako | \n3 | \n3 | \n185.00 | \nMako 3 QM | \n188.000 | \n216.035 | \n23.442 | \n228.991 | \n
\n\n30 | \nSkate | \n3 | \n1 | \n46.90 | \nSkate 1 PO | \n0.346 | \n3.062 | \n0.260 | \n60.690 | \n
\n\n31 | \nSkate | \n3 | \n1 | \n46.90 | \nSkate 1 QM | \n5.753 | \n57.628 | \n5.420 | \n60.690 | \n
\n\n32 | \nSkate | \n3 | \n2 | \n44.37 | \nSkate 2 PO | \n0.085 | \n0.978 | \n0.083 | \n15.151 | \n
\n\n33 | \nSkate | \n3 | \n2 | \n44.37 | \nSkate 2 QM | \n1.660 | \n14.173 | \n1.555 | \n15.151 | \n
\n\n34 | \nSkate | \n3 | \n3 | \n45.33 | \nSkate 3 PO | \n0.137 | \n1.740 | \n0.153 | \n27.947 | \n
\n\n35 | \nSkate | \n3 | \n3 | \n45.33 | \nSkate 3 QM | \n3.768 | \n26.207 | \n27.540 | \n27.947 | \n
\n\n36 | \nThresher | \n1 | \n2 | \n225.00 | \nThresher 2 PO | \n6.006 | \n18.475 | \n1.500 | \n163.116 | \n
\n\n37 | \nThresher | \n1 | \n2 | \n225.00 | \nThresher 2 QM | \n43.494 | \n144.641 | \n10.753 | \n163.116 | \n
\n\n
\n
"
},
"metadata": {},
"execution_count": 4
}
],
"source": [
"shark"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"i = shark[\"SharkBiteForce\"].value_counts()\n",
"count = 0"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"subset_df = shark[shark[\"SharkBiteForce\"] > 100]\n",
"column_count = subset_df.count()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"8"
]
},
"metadata": {},
"execution_count": 7
}
],
"source": [
"column_count[\"SharkBiteForce\"]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"[
]"
]
},
"metadata": {},
"execution_count": 8
},
{
"output_type": "display_data",
"data": {
"text/plain": "