Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Hi, I need to develop a query and plot a graph for two questions based on a database. I have attached files for questions, a reference sheet for tables and graphs, and the CSV file.

1 answer below »
Hi, I need to develop a query and plot a graph for two questions based on a database. I have attached files for questions, a reference sheet for tables and graphs, and the CSV file.
Answered 2 days After Apr 10, 2021

Solution

Sandeep Kumar answered on Apr 11 2021
131 Votes
{
"metadata": {
"language_info": {
"codemi
or_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