Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submitted #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 214 additions & 40 deletions your-code/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# your code here"
"# your code here\n",
"import pandas as pd\n",
"import numpy as np"
]
},
{
Expand All @@ -34,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -43,11 +45,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 5.7\n",
"1 75.2\n",
"2 74.4\n",
"3 84.0\n",
"4 66.5\n",
"5 66.3\n",
"6 55.8\n",
"7 75.7\n",
"8 29.1\n",
"9 43.7\n",
"dtype: float64\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"serie1 = pd.Series(lst)\n",
"print(serie1)"
]
},
{
Expand All @@ -61,11 +83,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"74.4"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# your code here"
"# your code here\n",
"serie1[2]"
]
},
{
Expand All @@ -77,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -95,11 +129,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0 1 2 3 4\n",
"0 53.1 95.0 67.5 35.0 78.4\n",
"1 61.3 40.8 30.8 37.8 87.6\n",
"2 20.6 73.2 44.2 14.6 91.8\n",
"3 57.4 0.1 96.1 4.2 69.5\n",
"4 83.6 20.5 85.4 22.8 35.9\n",
"5 49.0 69.0 0.1 31.8 89.1\n",
"6 23.3 40.7 95.0 83.8 26.9\n",
"7 27.6 26.4 53.8 88.8 68.5\n",
"8 96.6 96.4 53.4 72.4 50.1\n",
"9 73.7 39.0 43.2 81.6 34.7\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"new_df = pd.DataFrame(b)\n",
"print(new_df)"
]
},
{
Expand All @@ -111,7 +165,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -120,11 +174,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Score_1 Score_2 Score_3 Score_4 Score_5\n",
"0 53.1 95.0 67.5 35.0 78.4\n",
"1 61.3 40.8 30.8 37.8 87.6\n",
"2 20.6 73.2 44.2 14.6 91.8\n",
"3 57.4 0.1 96.1 4.2 69.5\n",
"4 83.6 20.5 85.4 22.8 35.9\n",
"5 49.0 69.0 0.1 31.8 89.1\n",
"6 23.3 40.7 95.0 83.8 26.9\n",
"7 27.6 26.4 53.8 88.8 68.5\n",
"8 96.6 96.4 53.4 72.4 50.1\n",
"9 73.7 39.0 43.2 81.6 34.7\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"new_df.columns=colnames\n",
"print(new_df)"
]
},
{
Expand All @@ -136,11 +210,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Score_1 Score_2 Score_3 Score_4 Score_5\n",
"0 53.1 95.0 67.5 35.0 78.4\n",
"1 61.3 40.8 30.8 37.8 87.6\n",
"2 20.6 73.2 44.2 14.6 91.8\n",
"3 57.4 0.1 96.1 4.2 69.5\n",
"4 83.6 20.5 85.4 22.8 35.9\n",
"5 49.0 69.0 0.1 31.8 89.1\n",
"6 23.3 40.7 95.0 83.8 26.9\n",
"7 27.6 26.4 53.8 88.8 68.5\n",
"8 96.6 96.4 53.4 72.4 50.1\n",
"9 73.7 39.0 43.2 81.6 34.7\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"new_df_sub = new_df[['Score_1','Score_3','Score_5']]\n",
"print(new_df)"
]
},
{
Expand All @@ -152,11 +246,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"56.95000000000001"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# your code here"
"# your code here\n",
"new_df['Score_3'].mean()"
]
},
{
Expand All @@ -168,11 +274,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"88.8"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# your code here"
"# your code here\n",
"new_df['Score_4'].max()"
]
},
{
Expand All @@ -184,11 +302,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"40.75"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# your code here"
"# your code here\n",
"new_df['Score_2'].median()"
]
},
{
Expand All @@ -200,7 +330,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -221,11 +351,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Description Quantity UnitPrice Revenue\n",
"0 LUNCH BAG APPLE DESIGN 1 1.65 1.65\n",
"1 SET OF 60 VINTAGE LEAF CAKE CASES 24 0.55 13.20\n",
"2 RIBBON REEL STRIPES DESIGN 1 1.65 1.65\n",
"3 WORLD WAR 2 GLIDERS ASSTD DESIGNS 2880 0.18 518.40\n",
"4 PLAYING CARDS JUBILEE UNION JACK 2 1.25 2.50\n",
"5 POPCORN HOLDER 7 0.85 5.95\n",
"6 BOX OF VINTAGE ALPHABET BLOCKS 1 11.95 11.95\n",
"7 PARTY BUNTING 4 4.95 19.80\n",
"8 JAZZ HEARTS ADDRESS BOOK 10 0.19 1.90\n",
"9 SET OF 4 SANTA PLACE SETTINGS 48 1.25 60.00\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"dt_frame_orders = pd.DataFrame(orders)\n",
"print(dt_frame_orders)"
]
},
{
Expand All @@ -237,11 +387,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"total quantity: 2978\n",
"total revenue: 637.0\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"total_quantity = dt_frame_orders['Quantity'].sum()\n",
"print('total quantity: ', total_quantity)\n",
"total_revenue = dt_frame_orders['Revenue'].sum()\n",
"print('total revenue: ', total_revenue)\n"
]
},
{
Expand All @@ -253,11 +416,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"11.77\n"
]
}
],
"source": [
"# your code here"
"# your code here\n",
"maximum = dt_frame_orders['UnitPrice'].max()\n",
"minimum = dt_frame_orders['UnitPrice'].min()\n",
"print(maximum-minimum)"
]
}
],
Expand All @@ -277,7 +451,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.7.6"
}
},
"nbformat": 4,
Expand Down