Skip to content

Commit 25905ae

Browse files
committed
Update matplotlib_exercise
-Improved Clarity
1 parent b34caa0 commit 25905ae

File tree

2 files changed

+199
-5
lines changed

2 files changed

+199
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"ExecuteTime": {
8+
"end_time": "2020-04-23T18:18:27.178894Z",
9+
"start_time": "2020-04-23T18:18:27.172402Z"
10+
}
11+
},
12+
"outputs": [],
13+
"source": [
14+
"# import pandas\n",
15+
"import pandas as pd\n",
16+
"\n",
17+
"# import matplotlib\n",
18+
"import matplotlib.pyplot as plt"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"metadata": {
25+
"ExecuteTime": {
26+
"end_time": "2020-04-23T18:18:27.475135Z",
27+
"start_time": "2020-04-23T18:18:27.390985Z"
28+
}
29+
},
30+
"outputs": [],
31+
"source": [
32+
"df=pd.read_csv('https://pynative.com/wp-content/uploads/2019/01/company_sales_data.csv')"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {
39+
"ExecuteTime": {
40+
"end_time": "2020-04-23T18:18:27.606163Z",
41+
"start_time": "2020-04-23T18:18:27.594265Z"
42+
}
43+
},
44+
"outputs": [],
45+
"source": [
46+
"df.head()"
47+
]
48+
},
49+
{
50+
"cell_type": "markdown",
51+
"metadata": {
52+
"ExecuteTime": {
53+
"end_time": "2020-02-10T14:31:17.354810Z",
54+
"start_time": "2020-02-10T14:31:17.350708Z"
55+
}
56+
},
57+
"source": [
58+
"### Task 1: Read the `total_profit` of all months and display it using a line plot."
59+
]
60+
},
61+
{
62+
"cell_type": "code",
63+
"execution_count": null,
64+
"metadata": {
65+
"ExecuteTime": {
66+
"end_time": "2020-02-10T14:31:58.448841Z",
67+
"start_time": "2020-02-10T14:31:58.296625Z"
68+
}
69+
},
70+
"outputs": [],
71+
"source": []
72+
},
73+
{
74+
"cell_type": "markdown",
75+
"metadata": {
76+
"ExecuteTime": {
77+
"end_time": "2020-02-10T14:32:21.369689Z",
78+
"start_time": "2020-02-10T14:32:21.365982Z"
79+
}
80+
},
81+
"source": [
82+
"### Task 2: Read all the different product sales data and display it using a multiline plot."
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": null,
88+
"metadata": {
89+
"ExecuteTime": {
90+
"end_time": "2020-02-10T14:32:43.465628Z",
91+
"start_time": "2020-02-10T14:32:43.236946Z"
92+
}
93+
},
94+
"outputs": [],
95+
"source": []
96+
},
97+
{
98+
"cell_type": "markdown",
99+
"metadata": {},
100+
"source": [
101+
"### Task 3: Read the `total_profit` of each month and display it using a histogram to find out which profit ranges are the most common."
102+
]
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": null,
107+
"metadata": {
108+
"ExecuteTime": {
109+
"end_time": "2020-02-10T14:33:25.912982Z",
110+
"start_time": "2020-02-10T14:33:25.730585Z"
111+
}
112+
},
113+
"outputs": [],
114+
"source": []
115+
},
116+
{
117+
"cell_type": "code",
118+
"execution_count": null,
119+
"metadata": {},
120+
"outputs": [],
121+
"source": []
122+
},
123+
{
124+
"cell_type": "code",
125+
"execution_count": null,
126+
"metadata": {},
127+
"outputs": [],
128+
"source": []
129+
}
130+
],
131+
"metadata": {
132+
"kernelspec": {
133+
"display_name": "Python 3",
134+
"language": "python",
135+
"name": "python3"
136+
},
137+
"language_info": {
138+
"codemirror_mode": {
139+
"name": "ipython",
140+
"version": 3
141+
},
142+
"file_extension": ".py",
143+
"mimetype": "text/x-python",
144+
"name": "python",
145+
"nbconvert_exporter": "python",
146+
"pygments_lexer": "ipython3",
147+
"version": "3.7.9"
148+
},
149+
"toc": {
150+
"base_numbering": 1,
151+
"nav_menu": {},
152+
"number_sections": true,
153+
"sideBar": true,
154+
"skip_h1_title": false,
155+
"title_cell": "Table of Contents",
156+
"title_sidebar": "Contents",
157+
"toc_cell": false,
158+
"toc_position": {},
159+
"toc_section_display": true,
160+
"toc_window_display": false
161+
},
162+
"varInspector": {
163+
"cols": {
164+
"lenName": 16,
165+
"lenType": 16,
166+
"lenVar": 40
167+
},
168+
"kernels_config": {
169+
"python": {
170+
"delete_cmd_postfix": "",
171+
"delete_cmd_prefix": "del ",
172+
"library": "var_list.py",
173+
"varRefreshCmd": "print(var_dic_list())"
174+
},
175+
"r": {
176+
"delete_cmd_postfix": ") ",
177+
"delete_cmd_prefix": "rm(",
178+
"library": "var_list.r",
179+
"varRefreshCmd": "cat(var_dic_list()) "
180+
}
181+
},
182+
"types_to_exclude": [
183+
"module",
184+
"function",
185+
"builtin_function_or_method",
186+
"instance",
187+
"_Feature"
188+
],
189+
"window_display": false
190+
}
191+
},
192+
"nbformat": 4,
193+
"nbformat_minor": 4
194+
}

matplotlib_exercise.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
}
5656
},
5757
"source": [
58-
"# Objective: Read Total profit of all months and show it using a line plot"
58+
"### Task 1: Read the `total_profit` of all months and display it using a line plot."
5959
]
6060
},
6161
{
@@ -79,7 +79,7 @@
7979
}
8080
},
8181
"source": [
82-
"# Objective: Read all product sales data and show it using a multiline plot"
82+
"### Task 2: Read all the different product sales data and display it using a multiline plot."
8383
]
8484
},
8585
{
@@ -98,7 +98,7 @@
9898
"cell_type": "markdown",
9999
"metadata": {},
100100
"source": [
101-
"# Objective: Read the total profit of each month and show it using the histogram to see most common profit ranges"
101+
"### Task 3: Read the `total_profit` of each month and display it using a histogram to find out which profit ranges are the most common."
102102
]
103103
},
104104
{
@@ -144,7 +144,7 @@
144144
"name": "python",
145145
"nbconvert_exporter": "python",
146146
"pygments_lexer": "ipython3",
147-
"version": "3.7.4"
147+
"version": "3.7.9"
148148
},
149149
"toc": {
150150
"base_numbering": 1,
@@ -190,5 +190,5 @@
190190
}
191191
},
192192
"nbformat": 4,
193-
"nbformat_minor": 2
193+
"nbformat_minor": 4
194194
}

0 commit comments

Comments
 (0)