"
225 | ],
226 | "text/plain": [
227 | " year month day dep_time dep_delay arr_time arr_delay carrier tailnum \\\n",
228 | "0 2013 1 1 517.0 2.0 830.0 11.0 UA N14228 \n",
229 | "1 2013 1 1 533.0 4.0 850.0 20.0 UA N24211 \n",
230 | "2 2013 1 1 542.0 2.0 923.0 33.0 AA N619AA \n",
231 | "3 2013 1 1 544.0 -1.0 1004.0 -18.0 B6 N804JB \n",
232 | "4 2013 1 1 554.0 -6.0 812.0 -25.0 DL N668DN \n",
233 | "\n",
234 | " flight origin dest air_time distance hour minute \n",
235 | "0 1545 EWR IAH 227.0 1400 5.0 17.0 \n",
236 | "1 1714 LGA IAH 227.0 1416 5.0 33.0 \n",
237 | "2 1141 JFK MIA 160.0 1089 5.0 42.0 \n",
238 | "3 725 JFK BQN 183.0 1576 5.0 44.0 \n",
239 | "4 461 LGA ATL 116.0 762 5.0 54.0 "
240 | ]
241 | },
242 | "metadata": {},
243 | "output_type": "display_data"
244 | }
245 | ],
246 | "source": [
247 | "# lets check the head of the dataset\n",
248 | "data.head()"
249 | ]
250 | },
251 | {
252 | "cell_type": "code",
253 | "execution_count": 4,
254 | "metadata": {},
255 | "outputs": [
256 | {
257 | "data": {
258 | "application/vnd.jupyter.widget-view+json": {
259 | "model_id": "19a20b1c8a914257a1ebe1baaf364e4c",
260 | "version_major": 2,
261 | "version_minor": 0
262 | },
263 | "text/plain": [
264 | "interactive(children=(Dropdown(description='column1', options=('year', 'month', 'day', 'dep_time', 'dep_delay'…"
265 | ]
266 | },
267 | "metadata": {},
268 | "output_type": "display_data"
269 | }
270 | ],
271 | "source": [
272 | "@interact\n",
273 | "def correlations(column1 = list(data.select_dtypes('number').columns),\n",
274 | " column2 = list(data.select_dtypes('number').columns[1:])):\n",
275 | " print(f\"Correlations: \", {data[column1].corr(data[column2])})\n"
276 | ]
277 | },
278 | {
279 | "cell_type": "code",
280 | "execution_count": 5,
281 | "metadata": {
282 | "scrolled": true
283 | },
284 | "outputs": [
285 | {
286 | "data": {
287 | "application/vnd.jupyter.widget-view+json": {
288 | "model_id": "78df7a62d92d4b77b0515e43b35c9572",
289 | "version_major": 2,
290 | "version_minor": 0
291 | },
292 | "text/plain": [
293 | "interactive(children=(Text(value='dep_delay', description='column'), FloatSlider(value=60.0, description='x', …"
294 | ]
295 | },
296 | "metadata": {},
297 | "output_type": "display_data"
298 | }
299 | ],
300 | "source": [
301 | "\n",
302 | "pd.set_option('max_rows', 30000)\n",
303 | "\n",
304 | "@interact\n",
305 | "def show_articles_more_than(column='dep_delay', x=60.0):\n",
306 | " return data.loc[data[column] > x]"
307 | ]
308 | },
309 | {
310 | "cell_type": "code",
311 | "execution_count": 12,
312 | "metadata": {},
313 | "outputs": [],
314 | "source": [
315 | "month = widgets.IntSlider(\n",
316 | " value=1.0,\n",
317 | " min=1.0,\n",
318 | " max=12.0,\n",
319 | " step=1.0,\n",
320 | " description='Month:',\n",
321 | " continuous_update=False\n",
322 | ")\n",
323 | "\n",
324 | "use_date = widgets.Checkbox(\n",
325 | " description='Date: ',\n",
326 | " value=True,\n",
327 | ")\n",
328 | "\n",
329 | "container = widgets.HBox(children=[use_date, month])\n",
330 | "\n",
331 | "textbox = widgets.Dropdown(\n",
332 | " description='Airline: ',\n",
333 | " value='DL',\n",
334 | " options=data['carrier'].unique().tolist()\n",
335 | ")\n",
336 | "\n",
337 | "origin = widgets.Dropdown(\n",
338 | " options=list(data['origin'].unique()),\n",
339 | " value='LGA',\n",
340 | " description='Origin Airport:',\n",
341 | ")\n",
342 | "\n",
343 | "\n",
344 | "# Assign an empty figure widget with two traces\n",
345 | "trace1 = go.Histogram(x=data['arr_delay'], opacity=0.75, name='Arrival Delays')\n",
346 | "trace2 = go.Histogram(x=data['dep_delay'], opacity=0.75, name='Departure Delays')\n",
347 | "g = go.FigureWidget(data=[trace1, trace2],\n",
348 | " layout=go.Layout(\n",
349 | " title=dict(\n",
350 | " text='NYC FlightDatabase'\n",
351 | " ),\n",
352 | " barmode='overlay'\n",
353 | " ))"
354 | ]
355 | },
356 | {
357 | "cell_type": "code",
358 | "execution_count": 13,
359 | "metadata": {},
360 | "outputs": [],
361 | "source": [
362 | "def validate():\n",
363 | " if origin.value in data['origin'].unique() and textbox.value in data['carrier'].unique():\n",
364 | " return True\n",
365 | " else:\n",
366 | " return False\n",
367 | "\n",
368 | "\n",
369 | "def response(change):\n",
370 | " if validate():\n",
371 | " if use_date.value:\n",
372 | " filter_list = [i and j and k for i, j, k in\n",
373 | " zip(data['month'] == month.value, data['carrier'] == textbox.value,\n",
374 | " data['origin'] == origin.value)]\n",
375 | " temp_df = data[filter_list]\n",
376 | "\n",
377 | " else:\n",
378 | " filter_list = [i and j for i, j in\n",
379 | " zip(data['carrier'] == 'DL', data['origin'] == origin.value)]\n",
380 | " temp_df = data[filter_list]\n",
381 | " x1 = temp_df['arr_delay']\n",
382 | " x2 = temp_df['dep_delay']\n",
383 | " with g.batch_update():\n",
384 | " g.data[0].x = x1\n",
385 | " g.data[1].x = x2\n",
386 | " g.layout.barmode = 'overlay'\n",
387 | " g.layout.xaxis.title = 'Delay in Minutes'\n",
388 | " g.layout.yaxis.title = 'Number of Delays'\n",
389 | "\n",
390 | "\n",
391 | "origin.observe(response, names=\"value\")\n",
392 | "textbox.observe(response, names=\"value\")\n",
393 | "month.observe(response, names=\"value\")\n",
394 | "use_date.observe(response, names=\"value\")"
395 | ]
396 | },
397 | {
398 | "cell_type": "code",
399 | "execution_count": 14,
400 | "metadata": {},
401 | "outputs": [
402 | {
403 | "data": {
404 | "application/vnd.jupyter.widget-view+json": {
405 | "model_id": "54e57c4ba6fa40148ae304d27b719413",
406 | "version_major": 2,
407 | "version_minor": 0
408 | },
409 | "text/plain": [
410 | "VBox(children=(HBox(children=(Checkbox(value=True, description='Date: '), IntSlider(value=1, continuous_update…"
411 | ]
412 | },
413 | "metadata": {},
414 | "output_type": "display_data"
415 | }
416 | ],
417 | "source": [
418 | "container2 = widgets.HBox([origin, textbox])\n",
419 | "widgets.VBox([container,\n",
420 | " container2,\n",
421 | " g])"
422 | ]
423 | },
424 | {
425 | "cell_type": "code",
426 | "execution_count": 18,
427 | "metadata": {},
428 | "outputs": [
429 | {
430 | "data": {
431 | "application/vnd.jupyter.widget-view+json": {
432 | "model_id": "4efc2d7d9dba46f8b6bf44dddb34d0ce",
433 | "version_major": 2,
434 | "version_minor": 0
435 | },
436 | "text/plain": [
437 | "interactive(children=(Dropdown(description='x', options=('year', 'month', 'day', 'dep_time', 'dep_delay', 'arr…"
438 | ]
439 | },
440 | "metadata": {},
441 | "output_type": "display_data"
442 | }
443 | ],
444 | "source": [
445 | "\n",
446 | "@interact_manual\n",
447 | "def scatter_plot(x = list(data.select_dtypes('number').columns),\n",
448 | " y = list(data.select_dtypes('number').columns)[1:],\n",
449 | " ):\n",
450 | " data.plot(kind = 'scatter',\n",
451 | " x = x,\n",
452 | " y = y,\n",
453 | " )"
454 | ]
455 | },
456 | {
457 | "cell_type": "code",
458 | "execution_count": null,
459 | "metadata": {},
460 | "outputs": [],
461 | "source": []
462 | }
463 | ],
464 | "metadata": {
465 | "kernelspec": {
466 | "display_name": "Python 3",
467 | "language": "python",
468 | "name": "python3"
469 | },
470 | "language_info": {
471 | "codemirror_mode": {
472 | "name": "ipython",
473 | "version": 3
474 | },
475 | "file_extension": ".py",
476 | "mimetype": "text/x-python",
477 | "name": "python",
478 | "nbconvert_exporter": "python",
479 | "pygments_lexer": "ipython3",
480 | "version": "3.6.8"
481 | }
482 | },
483 | "nbformat": 4,
484 | "nbformat_minor": 4
485 | }
486 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/04. Pie Charts.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "## Pie Charts\n",
8 | "\n",
9 | "* Pie Charts are one of the most popular Charts used in the domain of Data Science and Business Intelligence.\n",
10 | "* Pie Charts are beautiful and provide users to visualize data very easily.\n",
11 | "* Pie Charts are can be used to Visualize ```Univariate``` and ```Bivariate Data```.\n",
12 | "\n",
13 | "**In this Tutorial, we will learn,**\n",
14 | " * Making a simple Pie Chart.\n",
15 | " * Using other parameters of pie charts, to make it look more attractive.\n",
16 | " * Making ```Donut Charts```.\n",
17 | " \n"
18 | ]
19 | },
20 | {
21 | "cell_type": "code",
22 | "execution_count": 2,
23 | "metadata": {},
24 | "outputs": [],
25 | "source": [
26 | "# importing basic libraries\n",
27 | "import numpy as np\n",
28 | "import pandas as pd\n",
29 | "\n",
30 | "# importing matplot for data visualization\n",
31 | "import matplotlib.pyplot as plt"
32 | ]
33 | },
34 | {
35 | "cell_type": "code",
36 | "execution_count": 3,
37 | "metadata": {},
38 | "outputs": [
39 | {
40 | "data": {
41 | "text/plain": [
42 | "(1470, 35)"
43 | ]
44 | },
45 | "execution_count": 3,
46 | "metadata": {},
47 | "output_type": "execute_result"
48 | }
49 | ],
50 | "source": [
51 | "# lets import a dataset to work with\n",
52 | "data = pd.read_csv('employee.csv')\n",
53 | "\n",
54 | "# lets also check the shape of the dataset\n",
55 | "data.shape"
56 | ]
57 | },
58 | {
59 | "cell_type": "code",
60 | "execution_count": 5,
61 | "metadata": {},
62 | "outputs": [
63 | {
64 | "data": {
65 | "text/html": [
66 | "
\n",
67 | "\n",
80 | "
\n",
81 | " \n",
82 | "
\n",
83 | "
\n",
84 | "
Age
\n",
85 | "
Attrition
\n",
86 | "
BusinessTravel
\n",
87 | "
DailyRate
\n",
88 | "
Department
\n",
89 | "
DistanceFromHome
\n",
90 | "
Education
\n",
91 | "
EducationField
\n",
92 | "
EmployeeCount
\n",
93 | "
EmployeeNumber
\n",
94 | "
EnvironmentSatisfaction
\n",
95 | "
Gender
\n",
96 | "
HourlyRate
\n",
97 | "
JobInvolvement
\n",
98 | "
JobLevel
\n",
99 | "
JobRole
\n",
100 | "
JobSatisfaction
\n",
101 | "
MaritalStatus
\n",
102 | "
MonthlyIncome
\n",
103 | "
MonthlyRate
\n",
104 | "
NumCompaniesWorked
\n",
105 | "
Over18
\n",
106 | "
OverTime
\n",
107 | "
PercentSalaryHike
\n",
108 | "
PerformanceRating
\n",
109 | "
RelationshipSatisfaction
\n",
110 | "
StandardHours
\n",
111 | "
StockOptionLevel
\n",
112 | "
TotalWorkingYears
\n",
113 | "
TrainingTimesLastYear
\n",
114 | "
WorkLifeBalance
\n",
115 | "
YearsAtCompany
\n",
116 | "
YearsInCurrentRole
\n",
117 | "
YearsSinceLastPromotion
\n",
118 | "
YearsWithCurrManager
\n",
119 | "
\n",
120 | " \n",
121 | " \n",
122 | "
\n",
123 | "
0
\n",
124 | "
41
\n",
125 | "
Yes
\n",
126 | "
Travel_Rarely
\n",
127 | "
1102
\n",
128 | "
Sales
\n",
129 | "
1
\n",
130 | "
2
\n",
131 | "
Life Sciences
\n",
132 | "
1
\n",
133 | "
1
\n",
134 | "
2
\n",
135 | "
Female
\n",
136 | "
94
\n",
137 | "
3
\n",
138 | "
2
\n",
139 | "
Sales Executive
\n",
140 | "
4
\n",
141 | "
Single
\n",
142 | "
5993
\n",
143 | "
19479
\n",
144 | "
8
\n",
145 | "
Y
\n",
146 | "
Yes
\n",
147 | "
11
\n",
148 | "
3
\n",
149 | "
1
\n",
150 | "
80
\n",
151 | "
0
\n",
152 | "
8
\n",
153 | "
0
\n",
154 | "
1
\n",
155 | "
6
\n",
156 | "
4
\n",
157 | "
0
\n",
158 | "
5
\n",
159 | "
\n",
160 | "
\n",
161 | "
1
\n",
162 | "
49
\n",
163 | "
No
\n",
164 | "
Travel_Frequently
\n",
165 | "
279
\n",
166 | "
Research & Development
\n",
167 | "
8
\n",
168 | "
1
\n",
169 | "
Life Sciences
\n",
170 | "
1
\n",
171 | "
2
\n",
172 | "
3
\n",
173 | "
Male
\n",
174 | "
61
\n",
175 | "
2
\n",
176 | "
2
\n",
177 | "
Research Scientist
\n",
178 | "
2
\n",
179 | "
Married
\n",
180 | "
5130
\n",
181 | "
24907
\n",
182 | "
1
\n",
183 | "
Y
\n",
184 | "
No
\n",
185 | "
23
\n",
186 | "
4
\n",
187 | "
4
\n",
188 | "
80
\n",
189 | "
1
\n",
190 | "
10
\n",
191 | "
3
\n",
192 | "
3
\n",
193 | "
10
\n",
194 | "
7
\n",
195 | "
1
\n",
196 | "
7
\n",
197 | "
\n",
198 | "
\n",
199 | "
2
\n",
200 | "
37
\n",
201 | "
Yes
\n",
202 | "
Travel_Rarely
\n",
203 | "
1373
\n",
204 | "
Research & Development
\n",
205 | "
2
\n",
206 | "
2
\n",
207 | "
Other
\n",
208 | "
1
\n",
209 | "
4
\n",
210 | "
4
\n",
211 | "
Male
\n",
212 | "
92
\n",
213 | "
2
\n",
214 | "
1
\n",
215 | "
Laboratory Technician
\n",
216 | "
3
\n",
217 | "
Single
\n",
218 | "
2090
\n",
219 | "
2396
\n",
220 | "
6
\n",
221 | "
Y
\n",
222 | "
Yes
\n",
223 | "
15
\n",
224 | "
3
\n",
225 | "
2
\n",
226 | "
80
\n",
227 | "
0
\n",
228 | "
7
\n",
229 | "
3
\n",
230 | "
3
\n",
231 | "
0
\n",
232 | "
0
\n",
233 | "
0
\n",
234 | "
0
\n",
235 | "
\n",
236 | "
\n",
237 | "
3
\n",
238 | "
33
\n",
239 | "
No
\n",
240 | "
Travel_Frequently
\n",
241 | "
1392
\n",
242 | "
Research & Development
\n",
243 | "
3
\n",
244 | "
4
\n",
245 | "
Life Sciences
\n",
246 | "
1
\n",
247 | "
5
\n",
248 | "
4
\n",
249 | "
Female
\n",
250 | "
56
\n",
251 | "
3
\n",
252 | "
1
\n",
253 | "
Research Scientist
\n",
254 | "
3
\n",
255 | "
Married
\n",
256 | "
2909
\n",
257 | "
23159
\n",
258 | "
1
\n",
259 | "
Y
\n",
260 | "
Yes
\n",
261 | "
11
\n",
262 | "
3
\n",
263 | "
3
\n",
264 | "
80
\n",
265 | "
0
\n",
266 | "
8
\n",
267 | "
3
\n",
268 | "
3
\n",
269 | "
8
\n",
270 | "
7
\n",
271 | "
3
\n",
272 | "
0
\n",
273 | "
\n",
274 | "
\n",
275 | "
4
\n",
276 | "
27
\n",
277 | "
No
\n",
278 | "
Travel_Rarely
\n",
279 | "
591
\n",
280 | "
Research & Development
\n",
281 | "
2
\n",
282 | "
1
\n",
283 | "
Medical
\n",
284 | "
1
\n",
285 | "
7
\n",
286 | "
1
\n",
287 | "
Male
\n",
288 | "
40
\n",
289 | "
3
\n",
290 | "
1
\n",
291 | "
Laboratory Technician
\n",
292 | "
2
\n",
293 | "
Married
\n",
294 | "
3468
\n",
295 | "
16632
\n",
296 | "
9
\n",
297 | "
Y
\n",
298 | "
No
\n",
299 | "
12
\n",
300 | "
3
\n",
301 | "
4
\n",
302 | "
80
\n",
303 | "
1
\n",
304 | "
6
\n",
305 | "
3
\n",
306 | "
3
\n",
307 | "
2
\n",
308 | "
2
\n",
309 | "
2
\n",
310 | "
2
\n",
311 | "
\n",
312 | " \n",
313 | "
\n",
314 | "
"
315 | ],
316 | "text/plain": [
317 | " Age Attrition BusinessTravel DailyRate Department \\\n",
318 | "0 41 Yes Travel_Rarely 1102 Sales \n",
319 | "1 49 No Travel_Frequently 279 Research & Development \n",
320 | "2 37 Yes Travel_Rarely 1373 Research & Development \n",
321 | "3 33 No Travel_Frequently 1392 Research & Development \n",
322 | "4 27 No Travel_Rarely 591 Research & Development \n",
323 | "\n",
324 | " DistanceFromHome Education EducationField EmployeeCount EmployeeNumber \\\n",
325 | "0 1 2 Life Sciences 1 1 \n",
326 | "1 8 1 Life Sciences 1 2 \n",
327 | "2 2 2 Other 1 4 \n",
328 | "3 3 4 Life Sciences 1 5 \n",
329 | "4 2 1 Medical 1 7 \n",
330 | "\n",
331 | " EnvironmentSatisfaction Gender HourlyRate JobInvolvement JobLevel \\\n",
332 | "0 2 Female 94 3 2 \n",
333 | "1 3 Male 61 2 2 \n",
334 | "2 4 Male 92 2 1 \n",
335 | "3 4 Female 56 3 1 \n",
336 | "4 1 Male 40 3 1 \n",
337 | "\n",
338 | " JobRole JobSatisfaction MaritalStatus MonthlyIncome \\\n",
339 | "0 Sales Executive 4 Single 5993 \n",
340 | "1 Research Scientist 2 Married 5130 \n",
341 | "2 Laboratory Technician 3 Single 2090 \n",
342 | "3 Research Scientist 3 Married 2909 \n",
343 | "4 Laboratory Technician 2 Married 3468 \n",
344 | "\n",
345 | " MonthlyRate NumCompaniesWorked Over18 OverTime PercentSalaryHike \\\n",
346 | "0 19479 8 Y Yes 11 \n",
347 | "1 24907 1 Y No 23 \n",
348 | "2 2396 6 Y Yes 15 \n",
349 | "3 23159 1 Y Yes 11 \n",
350 | "4 16632 9 Y No 12 \n",
351 | "\n",
352 | " PerformanceRating RelationshipSatisfaction StandardHours \\\n",
353 | "0 3 1 80 \n",
354 | "1 4 4 80 \n",
355 | "2 3 2 80 \n",
356 | "3 3 3 80 \n",
357 | "4 3 4 80 \n",
358 | "\n",
359 | " StockOptionLevel TotalWorkingYears TrainingTimesLastYear \\\n",
360 | "0 0 8 0 \n",
361 | "1 1 10 3 \n",
362 | "2 0 7 3 \n",
363 | "3 0 8 3 \n",
364 | "4 1 6 3 \n",
365 | "\n",
366 | " WorkLifeBalance YearsAtCompany YearsInCurrentRole \\\n",
367 | "0 1 6 4 \n",
368 | "1 3 10 7 \n",
369 | "2 3 0 0 \n",
370 | "3 3 8 7 \n",
371 | "4 3 2 2 \n",
372 | "\n",
373 | " YearsSinceLastPromotion YearsWithCurrManager \n",
374 | "0 0 5 \n",
375 | "1 1 7 \n",
376 | "2 0 0 \n",
377 | "3 3 0 \n",
378 | "4 2 2 "
379 | ]
380 | },
381 | "execution_count": 5,
382 | "metadata": {},
383 | "output_type": "execute_result"
384 | }
385 | ],
386 | "source": [
387 | "# lets also check the structure of the dataset\n",
388 | "\n",
389 | "pd.set_option('max_columns', 300)\n",
390 | "data.head()"
391 | ]
392 | },
393 | {
394 | "cell_type": "code",
395 | "execution_count": 5,
396 | "metadata": {},
397 | "outputs": [
398 | {
399 | "name": "stdout",
400 | "output_type": "stream",
401 | "text": [
402 | "Help on function pie in module matplotlib.pyplot:\n",
403 | "\n",
404 | "pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=None, radius=None, counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), frame=False, rotatelabels=False, *, data=None)\n",
405 | " Plot a pie chart.\n",
406 | " \n",
407 | " Make a pie chart of array *x*. The fractional area of each wedge is\n",
408 | " given by ``x/sum(x)``. If ``sum(x) < 1``, then the values of *x* give\n",
409 | " the fractional area directly and the array will not be normalized. The\n",
410 | " resulting pie will have an empty wedge of size ``1 - sum(x)``.\n",
411 | " \n",
412 | " The wedges are plotted counterclockwise, by default starting from the\n",
413 | " x-axis.\n",
414 | " \n",
415 | " Parameters\n",
416 | " ----------\n",
417 | " x : array-like\n",
418 | " The wedge sizes.\n",
419 | " \n",
420 | " explode : array-like, optional, default: None\n",
421 | " If not *None*, is a ``len(x)`` array which specifies the fraction\n",
422 | " of the radius with which to offset each wedge.\n",
423 | " \n",
424 | " labels : list, optional, default: None\n",
425 | " A sequence of strings providing the labels for each wedge\n",
426 | " \n",
427 | " colors : array-like, optional, default: None\n",
428 | " A sequence of matplotlib color args through which the pie chart\n",
429 | " will cycle. If *None*, will use the colors in the currently\n",
430 | " active cycle.\n",
431 | " \n",
432 | " autopct : None (default), string, or function, optional\n",
433 | " If not *None*, is a string or function used to label the wedges\n",
434 | " with their numeric value. The label will be placed inside the\n",
435 | " wedge. If it is a format string, the label will be ``fmt%pct``.\n",
436 | " If it is a function, it will be called.\n",
437 | " \n",
438 | " pctdistance : float, optional, default: 0.6\n",
439 | " The ratio between the center of each pie slice and the start of\n",
440 | " the text generated by *autopct*. Ignored if *autopct* is *None*.\n",
441 | " \n",
442 | " shadow : bool, optional, default: False\n",
443 | " Draw a shadow beneath the pie.\n",
444 | " \n",
445 | " labeldistance : float or None, optional, default: 1.1\n",
446 | " The radial distance at which the pie labels are drawn.\n",
447 | " If set to ``None``, label are not drawn, but are stored for use in\n",
448 | " ``legend()``\n",
449 | " \n",
450 | " startangle : float, optional, default: None\n",
451 | " If not *None*, rotates the start of the pie chart by *angle*\n",
452 | " degrees counterclockwise from the x-axis.\n",
453 | " \n",
454 | " radius : float, optional, default: None\n",
455 | " The radius of the pie, if *radius* is *None* it will be set to 1.\n",
456 | " \n",
457 | " counterclock : bool, optional, default: True\n",
458 | " Specify fractions direction, clockwise or counterclockwise.\n",
459 | " \n",
460 | " wedgeprops : dict, optional, default: None\n",
461 | " Dict of arguments passed to the wedge objects making the pie.\n",
462 | " For example, you can pass in ``wedgeprops = {'linewidth': 3}``\n",
463 | " to set the width of the wedge border lines equal to 3.\n",
464 | " For more details, look at the doc/arguments of the wedge object.\n",
465 | " By default ``clip_on=False``.\n",
466 | " \n",
467 | " textprops : dict, optional, default: None\n",
468 | " Dict of arguments to pass to the text objects.\n",
469 | " \n",
470 | " center : list of float, optional, default: (0, 0)\n",
471 | " Center position of the chart. Takes value (0, 0) or is a sequence\n",
472 | " of 2 scalars.\n",
473 | " \n",
474 | " frame : bool, optional, default: False\n",
475 | " Plot axes frame with the chart if true.\n",
476 | " \n",
477 | " rotatelabels : bool, optional, default: False\n",
478 | " Rotate each label to the angle of the corresponding slice if true.\n",
479 | " \n",
480 | " Returns\n",
481 | " -------\n",
482 | " patches : list\n",
483 | " A sequence of :class:`matplotlib.patches.Wedge` instances\n",
484 | " \n",
485 | " texts : list\n",
486 | " A list of the label :class:`matplotlib.text.Text` instances.\n",
487 | " \n",
488 | " autotexts : list\n",
489 | " A list of :class:`~matplotlib.text.Text` instances for the numeric\n",
490 | " labels. This will only be returned if the parameter *autopct* is\n",
491 | " not *None*.\n",
492 | " \n",
493 | " Notes\n",
494 | " -----\n",
495 | " The pie chart will probably look best if the figure and axes are\n",
496 | " square, or the Axes aspect is equal.\n",
497 | " This method sets the aspect ratio of the axis to \"equal\".\n",
498 | " The axes aspect ratio can be controlled with `Axes.set_aspect`.\n",
499 | " \n",
500 | " .. note::\n",
501 | " In addition to the above described arguments, this function can take a\n",
502 | " **data** keyword argument. If such a **data** argument is given, the\n",
503 | " following arguments are replaced by **data[]**:\n",
504 | " \n",
505 | " * All arguments with the following names: 'colors', 'explode', 'labels', 'x'.\n",
506 | " \n",
507 | " Objects passed as **data** must support item access (``data[]``) and\n",
508 | " membership test (`` in data``).\n",
509 | "\n"
510 | ]
511 | }
512 | ],
513 | "source": [
514 | "# lets check the documentaion of the pie chart in matplotlib\n",
515 | "help(plt.pie)"
516 | ]
517 | },
518 | {
519 | "cell_type": "markdown",
520 | "metadata": {},
521 | "source": [
522 | "### Making a Simple Pie Chart\n"
523 | ]
524 | },
525 | {
526 | "cell_type": "code",
527 | "execution_count": 24,
528 | "metadata": {},
529 | "outputs": [
530 | {
531 | "name": "stdout",
532 | "output_type": "stream",
533 | "text": [
534 | "Help on function value_counts in module pandas.core.algorithms:\n",
535 | "\n",
536 | "value_counts(values, sort=True, ascending=False, normalize=False, bins=None, dropna=True)\n",
537 | " Compute a histogram of the counts of non-null values.\n",
538 | " \n",
539 | " Parameters\n",
540 | " ----------\n",
541 | " values : ndarray (1-d)\n",
542 | " sort : boolean, default True\n",
543 | " Sort by values\n",
544 | " ascending : boolean, default False\n",
545 | " Sort in ascending order\n",
546 | " normalize: boolean, default False\n",
547 | " If True then compute a relative histogram\n",
548 | " bins : integer, optional\n",
549 | " Rather than count values, group them into half-open bins,\n",
550 | " convenience for pd.cut, only works with numeric data\n",
551 | " dropna : boolean, default True\n",
552 | " Don't include counts of NaN\n",
553 | " \n",
554 | " Returns\n",
555 | " -------\n",
556 | " value_counts : Series\n",
557 | "\n"
558 | ]
559 | }
560 | ],
561 | "source": [
562 | "# lets check the documentataion of the value_counts function\n",
563 | "help(pd.value_counts)"
564 | ]
565 | },
566 | {
567 | "cell_type": "code",
568 | "execution_count": 25,
569 | "metadata": {},
570 | "outputs": [
571 | {
572 | "data": {
573 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR4AAADnCAYAAADIIzmzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAdr0lEQVR4nO3deZwU9Z3/8ddnGhgOFQUVUaKF4hFEUVS8UIwXIb1eoNFodFTc5OcmRuNv163VxIyPqOkk6k/z06xxdWMSNUFdj8TyvjgED0RwENFEbWFmuI/mHub47h9Vow0OM9Mz3fWtqv48H4950DPTXfUeYN5d9a2qb4kxBqWUClOF7QBKqfKjxaOUCp0Wj1IqdFo8SqnQafEopUKnxaOUCp0Wj1IqdFo8SqnQafEopUKnxaOUCp0Wj1IqdFo8SqnQafEopUKnxaOUCp0Wj1IqdFo8SqnQafEopUKnxaOUCp0Wj1IqdFo8SqnQafEopUKnxaOUCp0Wj1IqdFo8SqnQafEopUKnxaOUCp0Wj1IqdD1sB1Cl57heb2AosDfwNWBPYBCwO7AL0Afovc2HAJuAjcFH6+M1QB1Qm/dRB9RnM+mW0H4oFWtijLGdQRWJ43oVwP7AIcCI4OMQYD8gVeLVbwbmA+8Dc1v/zGbSK0u8XhVDWjwx5rheChgFjAVOBE4AdrYa6quywBTgNeC1bCa90G4cFQVaPDHjuN6ewAQgD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AirROjnY//C7k7/nSopxhjRuEPhF9dwLqnBb/UM/K+dgxwnTHmEBEZgX+u1XHGmMPw9yguEJEhwE+BY/FPgxjR0YpE5FvA3sDR+IVynIgcF3z7QOBOY8zB+AP6ZxtjJgNzgPONMYdtszv6CDBBRFr3cC4DHizg5y463dVScfOJMeadvM+/IyKT8P8v7wkMN8bMF5GXgLSIPA2MA64BTsMvrhn+nhq9gOkFrLutXa2ZxpiFweNT8S91mRUsvw/+IPwW4JVgFxIReRS/VNpzOjCeYEsK2AH/COUy4B/GmJrg6+8CTnsLMsasE5GpwHgR+RRoNsbM72D9JaXFo+JmQ+sDEdkff4tltDFmjYg8hD8wDjAZmIR/JG6mMWZDMC70vDHm4lLkAQT4b2PMT/OfICLnAts7itNEsOchIim+/J0U4GZjzAPbLGsY/kmYrZrp3O/x/cC1QBb4fSeeX1K6q6XibCf8WR3Xishg/C2bVq/g76ZMwi8hgBnAWBHZF0BE+gXlVSwvA98WkV2D5Q8Ukb2BN4FTRGRAMPZybt5rsvg3hgR/N631dIYXgEmtY1AiMqR1ue1YB7R5pxFjzBvAfsB5fPn3YY1u8ag4mw3Mxz8z+lP8SzEAMMY0ichzwIXARcHXlga7ZZPzBl+vB/5ejDDGmBoRuQl4ORhUbgT+jzHmHRG5Gb+A6vHvgtHqd8DTInIa/j3AGoJlPSsiBwFvBrtt64KfpT2/B+4XkU3A6Da+/zhwkDEm1+Ufskj0PB6lQiYiVwAjjDHXhLze54FfGGOmhLnetuiullIJF+zyfQysjkLpgG7xKLUVEZnFV4cgLrR9FChptHiUUqHTXS2lVOi0eJRSodPiUUqFTotHKRU6LR6lVOi0eJRSodPiUUqFTotHKRU6LR6lVOi0eJRSodPiUUqFTotHKRU6LR6lVOi0eJRSodPiUUqFTotHKRU6LR6lVOj+FyUP2bokBSyWAAAAAElFTkSuQmCC\n",
574 | "text/plain": [
575 | ""
576 | ]
577 | },
578 | "metadata": {},
579 | "output_type": "display_data"
580 | }
581 | ],
582 | "source": [
583 | "# lets make a simple pie Chart\n",
584 | "\n",
585 | "# we will the Business Travel Column\n",
586 | "plt.pie(data['BusinessTravel'].value_counts(), labels = data['BusinessTravel'].value_counts().index)\n",
587 | "plt.show()"
588 | ]
589 | },
590 | {
591 | "cell_type": "markdown",
592 | "metadata": {},
593 | "source": [
594 | "### Making a Donut Chart "
595 | ]
596 | },
597 | {
598 | "cell_type": "code",
599 | "execution_count": 5,
600 | "metadata": {},
601 | "outputs": [
602 | {
603 | "data": {
604 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR4AAADnCAYAAADIIzmzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3deXxcdb3/8ddnZpJJ0p1CSxfKdGMpZWmBUqSAymYdQPYdooAiIopeL56LivGnwIjgVa/ci1y5eqGoRQV6ccqOUkoLpZTSlAJF6JTuQJe0aZbJZL6/P86JhtA263zPnDOf5+ORB1km8/mkJO/5nnO+3+8RYwxKKWVTxO8GlFKlR4NHKWWdBo9SyjoNHqWUdRo8SinrNHiUUtZp8CilrNPgUUpZp8GjlLJOg0cpZZ0Gj1LKOg0epZR1GjxKKes0eJRS1mnwKKWs0+BRSlmnwaOUsk6DRyllnQaPUso6DR6llHUaPEop6zR4lFLWafAopazT4FFKWafBo5SyToNHKWWdBo9SyrqY3w2owks46QpgLDAG2A8YCQwHhgFDgEqgosObAI1Ag/fW9v42YB2wtt3bOmB9JpXMW/uhVKCJMcbvHlQfSTjpCDAROBSY7L0dCowHogUu3wSsAJYBr7X9N5NKbi5wXRVAGjwBlnDSUWAqcCJwAnA8MNjXpj4uAzwH/BX4ayaVfM/fdlQx0OAJmISTHgmcAySB44AB/nbUbauAvwFp4LFMKtngbzvKDxo8AZBw0uNxw+Yc4Bjc8y9h0AA8BvwZ+Esmldzhcz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]
608 | },
609 | "metadata": {},
610 | "output_type": "display_data"
611 | }
612 | ],
613 | "source": [
614 | "# we will the Business Travel Column\n",
615 | "plt.pie(data['BusinessTravel'].value_counts(), labels = data['BusinessTravel'].value_counts().index)\n",
616 | "\n",
617 | "# lets draw a white circle in the middle of the pie chart\n",
618 | "my_circle=plt.Circle( (0,0), 0.7, color='white')\n",
619 | "\n",
620 | "# adding the circle in the plot\n",
621 | "p=plt.gcf()\n",
622 | "p.gca().add_artist(my_circle)\n",
623 | "\n",
624 | "plt.show()"
625 | ]
626 | },
627 | {
628 | "cell_type": "code",
629 | "execution_count": null,
630 | "metadata": {},
631 | "outputs": [],
632 | "source": [
633 | "**When to Use Pie Chart**\n",
634 | "\n",
635 | "* It is Advisable to Use Pie Charts or Donut Charts only to display and explore the Univariate Attributes\n",
636 | "* We Should use Pie Charts only when the attributes have some Categories that is when the categories are having only two to five categories in them.\n",
637 | "* If we use Pie charts to display many categories, It may look dir"
638 | ]
639 | }
640 | ],
641 | "metadata": {
642 | "kernelspec": {
643 | "display_name": "Python 3",
644 | "language": "python",
645 | "name": "python3"
646 | },
647 | "language_info": {
648 | "codemirror_mode": {
649 | "name": "ipython",
650 | "version": 3
651 | },
652 | "file_extension": ".py",
653 | "mimetype": "text/x-python",
654 | "name": "python",
655 | "nbconvert_exporter": "python",
656 | "pygments_lexer": "ipython3",
657 | "version": "3.6.8"
658 | }
659 | },
660 | "nbformat": 4,
661 | "nbformat_minor": 4
662 | }
663 |
--------------------------------------------------------------------------------