<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@vertical+block@1bae7e80eaf94b38b298a6926539b335" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@f25a87a1fa4644e7825e92d1bbf35dba">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@f25a87a1fa4644e7825e92d1bbf35dba" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p><span class="cf0">This tutorial introduces </span><span class="cf0">numpy</span><span class="cf0"> (pronounced num</span><span class="cf1">‑</span><span class="cf0">pye</span><span class="cf0">, rhymes with eye), a Python library for performing numerical computations in Python. We will learn how to create and manipulate </span><span class="cf0">numpy</span><span class="cf0"> arrays, which are useful matrix</span><span class="cf1">‑</span><span class="cf0">like structures for holding large amounts of data.</span></p>
<p><strong><span class="cf0">Download the tutorial notebook</span></strong></p>
<ul>
<li><a href="https://learn.digitalearthafrica.org/assets/courseware/v1/9c4888117a4e8e76d695e59d2a14bcf5/asset-v1:digitalearthafrica+DEA101+2021+type@asset+block/02_download-numpy.ipynb" target="_blank">Download the Python basics 2 tutorial notebook</a></li>
</ul>
<p class="pf0"><span class="cf0">To view this notebook on the Sandbox, you will need to first download it to your computer, then upload it to the Sandbox. Ensure you have followed the set</span><span class="cf1">‑</span><span class="cf0">up prerequisites listed in <strong>Python basics 1: </strong></span><strong><span class="cf0">Jupyter</span></strong><span class="cf0">, and then follow these instructions:</span></p>
<p>1. Download the notebook by clicking the link above.<br />2. On the Sandbox, open the <strong>Training</strong> folder.<br />3. Click the <strong>Upload Files</strong> button as shown below.</p>
<p><img height="114" width="400" src="/assets/courseware/v1/4ea6ce25bce944072250cbc0e0f815fb/asset-v1:digitalearthafrica+DEA101+2021+type@asset+block/Image184.png" alt="Image" /><br />4. Select the downloaded notebook using the file browser. Click <strong>OK</strong>.<br /><span class="cf0">5. The solution notebook will appear in the <strong>Training</strong> folder. Double</span><span class="cf1">‑</span><span class="cf0">click to open it.</span></p>
<p class="pf0"><span class="cf0">You can now use the tutorial notebook as an interactive version of this webpage.</span></p>
<p><em><span class="cf0"><strong>Note</strong>: The tutorial notebook should look like the text and code below. However, the tutorial notebook outputs are blank (i.e. no results showing after code cells). Follow the instructions in the notebook to run the cells in the tutorial notebook. Refer to this page to check your outputs look similar.</span></em></p>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@8f2c96c5cf9449b3b4226b5ccf4dfe28">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@8f2c96c5cf9449b3b4226b5ccf4dfe28" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<h3 class="pf0"><strong><span class="cf0">Introduction to Numpy</span></strong></h3>
<p class="pf0"><strong><span class="cf0">Import </span><span class="cf0">numpy</span></strong></p>
<p class="pf0"><span class="cf0">In order to be able to use </span><span class="cf0">numpy</span><span class="cf0"> we need to import the </span><span class="cf0">numpy</span><span class="cf0"> library using the special word <code><span style="color: #339966;">import</span></code>. To avoid typing </span><code><span class="cf0" style="color: #339966;">numpy</span></code><span class="cf0"> every time we want to use one of its functions, we can provide an alias using the special word as. We will nickname </span><span class="cf0">numpy</span><span class="cf0"> as <code><span style="color: #339966;">np</span></code>:<br />_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0"><span id="docs-internal-guid-2ce1b7a4-7fff-ead2-adc3-31080956bda1"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1967d2; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">import</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">numpy</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1967d2; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">as</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">np<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></span></p>
<p class="pf0"><span class="cf0"><strong>Note</strong>: If we do not import </span><code><span class="cf0" style="color: #339966;">numpy</span></code><span class="cf0">, we cannot use any of the </span><span class="cf0">numpy</span><span class="cf0"> functions. If you forget to import packages, you may get an error that says <code><span style="color: #339966;">name</span> </code>is <code><span style="color: #339966;">not defined</span></code>.</span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">Now, we have access to all the functions available in </span><code><span class="cf0" style="color: #339966;">numpy</span></code><span class="cf0"> by typing <code><span style="color: #339966;">np.</span></code></span><code><span class="cf0" style="color: #339966;">name_of_function</span></code><span class="cf0">. For example, the equivalent of <code><span style="color: #339966;">1 + 1</span></code> in Python can be done in </span><span class="cf0">numpy</span><span class="cf0">:<br />_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0"><span id="docs-internal-guid-12ecafc2-7fff-6550-988d-497a6826b46c"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">np.add(</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">1</span></span></span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">)<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p class="pf0"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________<br /></span></span><span id="docs-internal-guid-cdc16c71-7fff-53ac-cb78-0899c6849b39"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">2</span></span><br />_____________________________________________________________</p>
<p class="pf0"><span class="cf0"><span class="cf0">By default, the result of a function or operation is shown underneath the cell containing the code. If we want to reuse this result for a later operation, we can assign it to a variable. For instance, let us call the variable <code><span style="color: #339966;">a</span></code>: <br />_____________________________________________________________</span><span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"></span></span></span></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span id="docs-internal-guid-d52ec38c-7fff-1eff-68c9-13dd2303a6cf"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">a</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">np.add(</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">)<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></span></span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">We have just declared a variable a that holds the result of the function. We can now use or display this variable, at any point of this notebook. For example, we can show its contents by typing the variable name in a new cell: <br />_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0" style="color: #ff0000;"><span id="docs-internal-guid-ecaea112-7fff-9b61-b702-56e0e40ceb14"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">a<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></span></p>
<p class="pf0"><span class="cf0" style="color: #ff0000;"><span style="color: #3c3c3c;">_____________________________________________________________</span><span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></span></span></p>
<p class="pf0"><span id="docs-internal-guid-c98cdb3d-7fff-feb9-5efb-d9d9373dad55"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #188038; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">5<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></p>
<p class="pf0"></p>
<p class="pf0"><strong><span class="cf0">Numpy</span><span class="cf0"> arrays</span></strong></p>
<p class="pf0"><span class="cf0">One of </span><span class="cf0">numpy’s</span><span class="cf0"> core concepts is the array. They can hold multi</span><span class="cf1">‑</span><span class="cf0">dimensional data. To declare a </span><span class="cf0">numpy</span><span class="cf0"> array explicitly we do:<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p class="pf0">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p class="pf0"><em><span class="cf0"><strong>Note</strong>: The array defined above has only 1 dimension.</span></em></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">Most of the functions and operations defined in </span><span class="cf0">numpy</span><span class="cf0"> can be applied to arrays. For example, with the previous add operation:<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.add(arr1,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2)</span><br /><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">We can also add arrays using the following convenient notation:<br />_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span id="docs-internal-guid-8667f365-7fff-f354-a5a4-081e161e3907"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr1</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">+</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr2<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________<br /><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0"><span class="cf0">Arrays can be sliced and diced. We can get subsets of the arrays using the indexing notation, which is [ start : end : stride ]. Let’s see what this means:</span></p>
<p class="pf0">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">11</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">12</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">13</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><b style="font-weight: normal;" id="docs-internal-guid-28aba8c0-7fff-2fbc-c07d-5413cf667926"> </b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(arr[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(arr[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(arr[:</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1967d2; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">(arr[::</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">11</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">12</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">13</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span id="docs-internal-guid-5d32c355-7fff-c3ed-4bd2-52db917b177f"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">0</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">12</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">14</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">]</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0"><span class="cf0">Experiment with the indices to understand the meaning of <code><span style="color: #339966;">start, end </span></code><span style="color: #000000;">and</span><code><span style="color: #339966;"> stride</span></code>. What happens if you don’t specify a start? What value does </span><span class="cf0">numpy</span><span class="cf0"> use instead?</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><em><span class="cf0"><strong>Note:</strong> </span><span class="cf0">Numpy</span><span class="cf0"> indexes start on 0, the same convention used in Python lists.</span></em></p>
<p class="pf0"><span class="cf0">Indexes can also be negative, meaning that you start counting from the end. For example, to select the last 2 elements in an array we can do:<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">11</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">12</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">13</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p class="pf0"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:]<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p class="pf0"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><em style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-weight: 400; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-weight: 400; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-weight: 400; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; white-space-collapse: collapse;">_____________________________________________________________</span></span></em></span></p>
<p class="pf0"><span class="cf0">Numpy</span><span class="cf0"> arrays can have multiple dimensions. Dimensions are indicated using nested square brackets <code><span style="color: #339966;">[ ]</span></code>. The convention in </span><span class="cf0">numpy</span><span class="cf0"> is that the outer <code><span style="color: #339966;">[ ]</span></code> represent the first dimension and the innermost <code><span style="color: #339966;">[ ]</span></code> contains the last dimension.</span></p>
<p class="pf0"><span class="cf0">The following cell declares a 2</span><span class="cf1">‑</span><span class="cf0">dimensional array with shape (1, 9).</span></p>
<p class="pf0"><em><span class="cf0"><strong>Tip</strong>: Notice the nested (double) square brackets [[ ]]. As there are two brackets, this indicates the array is 2</span><span class="cf1">‑</span><span class="cf0">dimensional.<br /></span></em>_____________________________________________________________<em><span class="cf0"></span></em></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p class="pf0"><span id="docs-internal-guid-e6c62d2c-7fff-8c60-94d9-ef2291b1b5be"> </span>_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">array([[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><em> </em></p>
<p class="pf0"><span class="cf0">To visualise the shape (dimensions) of a </span><span class="cf0">numpy</span><span class="cf0"> array, we can add the suffix .shape to an array expression or variable containing a </span><span class="cf0">numpy</span><span class="cf0"> array.<br />_____________________________________________________________<br /></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]])</span></p>
<p class="pf0"><span class="cf0"><span id="docs-internal-guid-e2201fd1-7fff-9c09-3d8c-52dc41c043c5"><br /><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr1.shape,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr2.shape,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr3.shape,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">]).shape</span></span><br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________<br /><span id="docs-internal-guid-0b71ed51-7fff-e159-b1c7-4e2529b23586"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">((</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,),</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">(</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">),</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">(</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">),</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">(</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">,))</span></span><br />_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0"><strong><span class="cf0">Data types</span></strong></p>
<p class="pf0"><span class="cf0">Numpy</span><span class="cf0"> arrays can contain numerical values of different types. These types can be divided into these groups:</span></p>
<ul>
<ul>
<li><strong><span class="cf0">Integers</span></strong></li>
<ul>
<li><strong><span class="cf0">Unsigned</span></strong></li>
<ul>
<li><span class="cf0">8 bits: <code><span style="color: #339966;">uint8</span></code></span></li>
<li><span class="cf0">16 bits: <code><span style="color: #339966;">uint16</span></code></span></li>
<li><span class="cf0">32 bits: <code><span style="color: #339966;">uint32</span></code></span></li>
<li><span class="cf0">64 bits: <code><span style="color: #339966;">uint64</span></code></span></li>
</ul>
</ul>
<li><strong><span class="cf0">Signed</span></strong></li>
<ul>
<li><span class="cf0">8 bits: <code><span style="color: #339966;">int8</span></code></span></li>
<li><span class="cf0">16 bits: <code><span style="color: #339966;">int16</span></code></span></li>
<li><span class="cf0">32 bits: <code><span style="color: #339966;">int32</span></code></span></li>
<li><span class="cf0">64 bits: <span style="color: #339966;"><code>int64</code></span></span></li>
</ul>
<li><strong><span class="cf0">Floats</span></strong></li>
<ul>
<li><span class="cf0">32 bits: <code><span style="color: #339966;">float32</span></code></span></li>
<li><span class="cf0">64 bits: <code><span style="color: #339966;">float64</span></code></span></li>
</ul>
</ul>
</ul>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">We can look up the type of an array by using the <code><span style="color: #339966;">.</span></code></span><code><span class="cf0" style="color: #339966;">dtype</span></code><span class="cf0"> suffix.</span></p>
<p class="pf0">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.ones((</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">))</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><b style="font-weight: normal;" id="docs-internal-guid-a914b985-7fff-ccb9-53ad-b982fb005bf6"> </b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr.dtype</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________<span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">dtype(</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #188038; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">'float64'</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0"><strong><span class="cf0">Boolean (true/false) data</span></strong></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span class="cf0">Numpy</span><span class="cf0"> arrays normally store numeric values but they can also contain </span><span class="cf0">boolean</span><span class="cf0"> values, '<code><span style="color: #339966;">bool'</span></code>. Boolean is a data type that can have two possible values: <code><span style="color: #339966;">True</span></code>, or <span style="color: #339966;"><code>False</code></span>. For example:<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([True,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span id="docs-internal-guid-327f3366-7fff-8c1e-82b5-d010a9a1ae96"><br /><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr.shape,</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">arr.dtype</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p class="pf0">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True]),</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,),</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">dtype(</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'bool'</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">))<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span class="cf0">We can operate with </span><span class="cf0">boolean</span><span class="cf0"> arrays using the </span><span class="cf0">numpy</span><span class="cf0"> functions for performing logical operations such as and </span><span class="cf0">and</span><span class="cf0"> or.<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([True,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([True,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><b style="font-weight: normal;" id="docs-internal-guid-489b1985-7fff-fd8e-7c06-433559bdd1c9"> </b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(np.logical_and(arr1,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2))</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(np.logical_or(arr1,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2))</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><b style="font-weight: normal;"> </b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False]</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">False]</span></p>
<p><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span id="docs-internal-guid-2a42b0da-7fff-d845-0dbb-8ed33d43c4a0"><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></span></p>
<p></p>
<p class="pf0"><span class="cf0">These operations are conveniently offered by </span><span class="cf0">numpy</span><span class="cf0"> with the symbols * (and), and + (or).</span></p>
<p class="pf0"><em><span class="cf0"><strong>Note</strong>: Here the * and + symbols are not performing multiplication and addition as with numerical arrays. </span><span class="cf0">Numpy</span><span class="cf0"> detects the type of the arrays involved in the operation and changes the behaviour of these operators.<br /></span></em>_____________________________________________________________<em><span class="cf0"></span></em></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(arr1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">*</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(arr1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr2)<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span> </p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False]</span></p>
<p class="pf0"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False]<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p></p>
<p class="pf0"><span class="cf0">Boolean arrays are often the result of comparing numerical arrays with certain values. This is sometimes useful to detect values that are equal, below or above a number in a </span><span class="cf0">numpy</span><span class="cf0"> array. For example, if we want to know which values in an array are equal to 1, and the values that are greater than 2, we can do:<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p class="pf0"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">==</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></p>
<p class="pf0"><span class="cf0"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1967d2; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">print</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">(arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">></span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #c5221f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;">)<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></p>
<p class="pf0"><span class="cf0"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></span></p>
<p class="pf0"><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">[</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">True</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">False</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">False</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">True</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">False</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">False</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">True</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">False</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">False</span><span style="font-size: 8pt; color: #1c1c1c; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;"> </span><span style="font-size: 8pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline;">True]<br /><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">False]<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span class="cf0">You can use a </span><span class="cf0">boolean</span><span class="cf0"> array to mask out <code><span style="color: #339966;">False</span></code> values from a numeric array. The returned array only contains the numeric values which are at the same index as <code><span style="color: #339966;">True</span> </code>values in the <code><span style="color: #339966;">mask</span> </code>array.<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">mask</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([True,False,True,False,True,False,True,False,True])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span class="cf0"><b style="font-weight: normal;" id="docs-internal-guid-e5584995-7fff-62a8-8c71-ab31ddd8d9d0"> </b></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr[mask]<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;"></span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span class="cf0"> </span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])<br /><span style="color: #3c3c3c; font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@vertical+block@a7adfbd9e23147348c7204538b0050d5" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@29b10c13f09a42c3a00b4deb7854b46c">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@29b10c13f09a42c3a00b4deb7854b46c" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p class="pf0" style="padding-left: 30px;"><span class="cf0">2.1 Use the </span><span class="cf0">numpy</span><span class="cf0"> add function to add the values 34 and 29 in the cell below.</span></p>
<p class="pf0">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Use numpy add function to add 34 and 29<br /><span style="color: rgb(60, 60, 60); font-family: "Open Sans", Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0" style="padding-left: 30px;"><span class="cf0">2.2 Declare a new array with contents [5,4,3,2,1] and slice it to select the last 3 items.</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Substitute the ? symbols by the correct expressions and values</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Declare the array</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">?</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Slice array for the last 3 items only</span></p>
<p class="pf0"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr[?:?]</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0" style="padding-left: 30px;"><span class="cf0">2.3 Select all the elements in the array below excluding the last one, <code><span style="color: #339966;">[15]</span></code>.</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">8</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">9</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">10</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">11</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">12</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">13</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">14</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Substitute the ? symbols by the correct expressions and values</span></p>
<p class="pf0"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr[?]</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="color: rgb(60, 60, 60); font-family: "Open Sans", Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><br /><br /></p>
<p dir="ltr" style="line-height: 1.8; margin-top: 0pt; margin-bottom: 0pt; padding-left: 30px;"><span class="cf0">2.4 Use </span><code><span class="cf0" style="color: #339966;">arr</span></code><span class="cf0"> as defined in 2.3. Exclude the last element from the list, but now only select every 3rd element. Remember, the third index indicates <strong>stride</strong>, if used.</span></p>
<p class="pf0"><em>Hint: The result should be</em> <code><span style="color: #339966;">[0,3,6,9,12]</span></code>.<</p>
<p class="pf0">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Substitute the ? symbols by the correct expressions and values</span></p>
<p class="pf0"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr[?:?:?]<br /><span style="color: rgb(60, 60, 60); font-family: "Open Sans", Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0" style="padding-left: 30px;"><span class="cf0">2.5 You’ll need to combine array comparisons and logical operators to solve this one. Find out the values in the following array that are greater than <code><span style="color: #339966;">3</span></code> <strong>AND</strong> less than <code><span style="color: #339966;">7</span></code>. The output should be a </span><span class="cf0">boolean</span><span class="cf0"> array.</span></p>
<p class="pf0"><em><span class="cf0">Hint: If you are stuck, reread the section on </span><span class="cf0">boolean</span><span class="cf0"> arrays.<br /></span></em>_____________________________________________________________<em><span class="cf0"></span></em></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">arr</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">np.array([</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">6</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">])</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Use array comparisons (<, >, etc.) and logical operators (*, +) to find where</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># the values are greater than 3 and less than 7.</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">boolean_array</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">?</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">_____________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p class="pf0" style="padding-left: 30px;"><span class="cf0">2.6 Use your </span><span class="cf0">boolean</span><span class="cf0"> array from 2.5 to mask the <code><span style="color: #339966;">False</span></code> values from arr.</span></p>
<p class="pf0"><span class="cf0"><em>Hint: The result should be</em> <code><span style="color: #339966;">[5, 6, 5]</span></code>.<br />_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Use your resulting boolean_array array from 2.5</span></p>
<p class="pf0"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 8pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># to mask arr as defined in 2.5<br /><span style="color: rgb(60, 60, 60); font-family: "Open Sans", Verdana, Arial, Helvetica, sans-serif; font-size: 16px; white-space-collapse: collapse;">_____________________________________________________________</span></span> </p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@vertical+block@987ccead5b41404e837d9280dfc3f5cd" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@1b755e2f3364469da76ca84b328e1e67">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@1b755e2f3364469da76ca84b328e1e67" data-request-token="b7fd2bc64cfa11f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p><span class="cf0">Numpy</span><span class="cf0"> is a fundamental numerical computing library in Python programming and it is useful to understand how it works. Next, we explore plotting geospatial data using matplotlib.</span></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>