<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@b64ba2664cd24e0f82535dfb64878cd4" data-request-token="f956056e4d0111f1b4d66b8c55c4de7e" 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@e681cfc2fdda4b3197787abc3940d13c">
<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@e681cfc2fdda4b3197787abc3940d13c" data-request-token="f956056e4d0111f1b4d66b8c55c4de7e" 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">Overview</span></strong></h3>
<p class="pf0"><span class="cf0">This tutorial explores further concepts in </span><span class="cf0">Numpy</span><span class="cf0">, such as categorical data, advanced indexing and dealing with Not</span><span class="cf1">‑</span><span class="cf0">a</span><span class="cf1">‑</span><span class="cf0">Number (</span><span class="cf0">NaN</span><span class="cf0">) data.</span></p>
<p class="pf0"><span class="cf0">Follow the instructions below to download the tutorial and open it in the Sandbox.</span></p>
<h5 class="pf0"><span class="cf0">Download the tutorial notebook</span></h5>
<ul>
<ul>
<li><a href="https://learn.digitalearthafrica.org/assets/courseware/v1/38aca23d0de6ee7f7c20240e93e6bf4b/asset-v1:digitalearthafrica+DEA101+2021+type@asset+block/04_download-cleaning_data.ipynb" target="_blank"><strong><span class="cf0">Download the Python basics 4 tutorial notebook</span></strong></a></li>
</ul>
</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 class="pf0"><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 that your outputs look similar.</span></em></p>
<p class="pf0"></p>
<h5 class="pf0"><span class="cf0">Numpy</span><span class="cf0"> dictionaries and categorical data</span></h5>
<p class="pf0"><span class="cf0">We will introduce a </span><span class="cf0">numpy</span><span class="cf0"> structure called a dictionary. This will be useful for the next lesson on </span><span class="cf0">xarray</span><span class="cf0">.</span></p>
<p class="pf0"></p>
<p class="pf0"><strong><span class="cf0">Keys and values</span></strong></p>
<p class="pf0">A dictionary represents a mapping between keys and values. The <strong>keys</strong> and <strong>values</strong> are Python objects of any type. We declare a dictionary using curly braces <code><span style="color: #339966;">{}</span></code>. Inside, we specify the key, then its associated value, with the keys and values separated by a colon<span style="color: #339966;"><strong> :</strong></span>. Commas , are used to separate elements in the dictionary.<br />_____________________________________________________________</p>
<p class="pf0"><span class="cf0"><span id="docs-internal-guid-07089203-7fff-2788-e284-679eb13c921d"><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;">dictionary_name</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;">{key1:</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;">value1,</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;">key2:</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;">value2,</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;">key3:</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;">value3}<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"></p>
<p class="pf0"><span class="cf0">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;">d</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><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: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'one'</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: #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: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'two'</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-74351be9-7fff-8a4a-047f-96f1cc8c6f00"><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;">:</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: #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;">'apple'</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></p>
<p class="pf0"></p>
<p class="pf0">In the above dictionary <code><span style="color: #339966;">d</span></code>, we have three keys <code><span style="color: #339966;">1</span></code>, <code><span style="color: #339966;">2</span></code>,<code><span style="color: #339966;"> 3</span></code>, and their respective values <code><span style="color: #339966;">'one'</span></code>, <code><span style="color: #339966;">'</span><span style="color: #339966;">two'</span></code> and <code><span style="color: #339966;">'apple'</span></code>.</p>
<p class="pf0"><span class="cf0">We can look up elements in a dictionary using the <code><span style="color: #339966;">[ </span></code></span><code><span class="cf0" style="color: #339966;">key_name</span></code><span class="cf0"><code><span style="color: #339966;"> ]</span></code> to address the value stored under a key. The syntax looks like:<br />_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0"><span id="docs-internal-guid-dd570cbd-7fff-3d2d-e808-13d37c8d6a87"><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;">dictionary_name[key_name]<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"></p>
<p class="pf0"><span class="cf0">In our example dictionary <code><span style="color: #339966;">d</span></code> above, we can call upon the value associated with the key name <code><span style="color: #339966;">1</span></code> like so:<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;">d[</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 id="docs-internal-guid-b5ba837e-7fff-ec76-9b16-f5ece88a9fd2"><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;">(d[</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: #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;">" + "</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;">d[</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: #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;">" = "</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;">d[</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></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">Elements in a dictionary can be modified or new elements added by using the </span><code><span style="color: #339966;"><span class="cf0">dictionary_name</span><span class="cf0">[</span><span class="cf0">key_name</span></span></code><span class="cf0"><code><span style="color: #339966;">] = value</span></code> syntax.<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;">d[</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;">=</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: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'three'</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;">d[</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: #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: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'four'</span><span class="cf0"><span id="docs-internal-guid-d7c9d6bf-7fff-a5b2-cf62-07689e8d3443"><br /><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;">(d[</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: #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;">" + "</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;">d[</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: #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;">" = "</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;">d[</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></p>
<p class="pf0"><span class="cf0">Again, the dictionary name, key name, and value must be specified.</span></p>
<p class="pf0"><strong><span class="cf0">Data classification with dictionaries</span></strong></p>
<p class="pf0"><span class="cf0">Dictionaries are useful for data analysis (including satellite data analysis) because they make it easy to assign <strong>categorical</strong> <strong>values</strong> to our dataset. Remote sensing can be used to create classification products that use categorical values. These products do not contain continuous values. They use discrete values to represent different classes individual pixels can belong to.</span></p>
<p class="pf0"><span class="cf0">As an example, the following cells simulate a very simple image containing three different land cover types. Value <code><span style="color: #ff0000;">1</span> </code>represents areas covered with grass, <code><span style="color: #ff0000;">2</span> </code>croplands and <code><span style="color: #ff0000;">3</span> </code>city.</span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">First, we import the libraries we want to use.</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.68; background-color: #f8f8f8; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">%matplotlib</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">inline</span></p>
<p dir="ltr" style="line-height: 1.68; background-color: #f8f8f8; margin-top: 0pt; margin-bottom: 0pt;"></p>
<p dir="ltr" style="line-height: 1.68; background-color: #f8f8f8; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">numpy</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">as</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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</span></p>
<p dir="ltr" style="line-height: 1.68; background-color: #f8f8f8; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">matplotlib</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pyplot</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">as</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">plt</span></p>
<p dir="ltr" style="line-height: 1.68; background-color: #f8f8f8; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">matplotlib</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">colors</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0"><span class="cf0">We will now create a 2-dimensional 100 pixel x 100 pixel </span><span class="cf0">numpy</span><span class="cf0"> array where every value is <code><span style="color: #ff0000;">1</span></code>. This is done using the </span><code><span class="cf0">numpy.ones</span></code><span class="cf0"> function. Then, we use array indexing to assign part of the area to have the value <code><span style="color: #ff0000;">2</span></code>, and another part to have the value <code><span style="color: #ff0000;">3</span></code>.</span></span></p>
<p class="pf0"><span class="cf0"><span class="cf0">_____________________________________________________________</span></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;"># grass = 1</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">area</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">100</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">100</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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><b style="font-weight: normal;"> </b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;"># crops = 2</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">area[</span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">60</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">20</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">50</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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></p>
<p><b style="font-weight: normal;"> </b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;"># city = 3</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">area[</span><span style="font-size: 9pt; 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;">70</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">90</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">60</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">80</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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></p>
<p><b style="font-weight: normal;" id="docs-internal-guid-b88ccde0-7fff-3e8a-09c0-f1f111427fd9"><br /><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">area.shape,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">area.dtype</span></b></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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 id="docs-internal-guid-81aaae5a-7fff-ab8d-e59d-691324897a7e"><span style="font-size: 9pt; 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: 9pt; 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;">100</span><span style="font-size: 9pt; 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: 9pt; 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: 9pt; 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;">100</span><span style="font-size: 9pt; 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: 9pt; 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: 9pt; 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;">dtype(</span><span style="font-size: 9pt; 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;">'float64'</span><span style="font-size: 9pt; 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><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"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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 id="docs-internal-guid-1ed8a0b0-7fff-d537-6742-52e2624803e3"><span style="font-size: 9pt; 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;">area</span></span><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"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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 class="cf0"><span style="font-size: 9pt; 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 id="docs-internal-guid-818ff928-7fff-4b4c-6e3b-95849b590bb7"><span style="font-size: 9pt; color: #000000; 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: 9pt; 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: 9pt; 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;">1</span><span style="font-size: 9pt; 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: 9pt; color: #000000; 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: 9pt; 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;">1</span><span style="font-size: 9pt; 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: 9pt; color: #000000; 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: 9pt; 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;">1</span><span style="font-size: 9pt; 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: 9pt; color: #000000; 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: 9pt; 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: 9pt; color: #000000; 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: 9pt; 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;">1</span><span style="font-size: 9pt; 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: 9pt; color: #000000; 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: 9pt; 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;">1</span><span style="font-size: 9pt; 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: 9pt; color: #000000; 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: 9pt; 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;">1</span><span style="font-size: 9pt; 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><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"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">We now have a matrix filled with 1s, 2s and 3s. At this point, there is no association between the numbers and the different types of ground cover.</span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">If we want to show what the area looks like according to the grass/crops/city designation, we might want to give each of the classifications a colour.</span></p>
<p class="pf0"></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;"># We map the values to colours</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">index</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">'green'</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">'yellow'</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; 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;">'grey'</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;"># Create a discrete colour map</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cmap</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">colors.ListedColormap(index.values())</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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;"># Plot</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">plt.imshow(area,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cmap=cmap)</span></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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 id="docs-internal-guid-4de47ff3-7fff-1cf7-b97f-05e56490a674"><span style="font-size: 9pt; 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;"><matplotlib.image.AxesImage</span><span style="font-size: 9pt; 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: 9pt; 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;">at</span><span style="font-size: 9pt; 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: 9pt; 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;">0x7fe7b5487f98</span><span style="font-size: 9pt; 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><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><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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></span></p>
<p><span class="cf0"><span class="cf0"><span style="font-size: 9pt; 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 id="docs-internal-guid-74141164-7fff-8bac-a84b-3504c8366377"><span style="font-size: 9pt; font-family: 'Courier New', monospace; color: #000000; 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="border: none; display: inline-block; overflow: hidden; width: 251px; height: 251px;"><img alt="../_images/python_basics_04_cleaning_data_21_1.png" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAAD7CAYAAACscuKmAAAQAElEQVR4AeyaXagVZRuGx68+KQvS4iNMg6SsiOgPkULoQA36Iz0oMCI8CPwO+i8oOzIPioLo5yACScKD6AcLlIgiyg46kbSiUovE+kqx7EcrEirJ77437ty23XvN2vOumeeduey555mZPfPO817PuteataZ/FfyDAAQ6QQCzd6LNTBICRYHZeRVAoCMEMHtHGs00IZDS7NCEAAQCE8DsgZtDaRBISQCzp6TJWBAITKCq2a/U3D6XtkvLJQICEAhKoIrZj9Gcnpauks6TbpSclSoHA0AAAokJVDH7XNXiT/Qdyn9IL0qLpLHj+OJgMR3BgNfAwF4D9tgYDqxi9hka8xtpOHZqxfuUjohl2to0pMla/hcVMChgMCAfTNW4Y0QVs48x5Kjdq7RnzpCmaElAAAKNEKhi9l2q+HRpOGZqxfuUQgXFQAACIlDF7O/r/NnSLMk36EuU10sEBCAQkEAVsx/QfG6T3pS2SS9LWyQCAhAISKCK2T2d17U4WzpTekgiIACBoASqmj3otAZWFgNDIFsCmD3b1lE4BPojgNn748XREMiWAGbPtnUUDoH+CGD2/nilPJqxIFArAcxeK24uBoHmCGD25thzZQjUSgCz14qbi0GgOQKYvTn2Ka/MWBDoSQCz90TEARBoBwHM3o4+MgsI9CSA2Xsi4gAItIMAZm9HH1POgrFaSgCzt7SxTAsC/ySA2f9JhG0ItJQAZh+nsQdXFEXXNQ4e/pQZAcyeWcMyK5dyAxHA7IGaQSkQGCQBzD5IuowNgUAEMHugZlAKBAZJALMPki5jpyTAWBUJYPaKADkdArkQwOy5dIo6IVCRAGavCJDTIZALAcyeS6eoMyWBTo6F2TvZdibdRQKYvYtdZ86dJIDZO9l2Jt1FApi9i11nzikJZDMWZs+mVRQKgWoEMHs1fpwNgWwIYPZsWkWhEKhGALNX48fZEEhJYKBjYfaB4mVwCMQhgNnj9IJKIDBQAmXMfroq2CBtlbZId0qOk7V4S/pCcp6mTEAAAkEJlDH7AdV+r3SedKl0q+T15cpvS7MlZ29rlYAABAIQGFVCGbPv1lkfSI5ftdgmzZAWSWskh/NiryAIQCAmgTJmH1n5Gdq4WNoonSr5jUCp+FYLbyuNimXas2lI+7UkIACBRgj0Y/YTVeEr0l3SL9LIOKgNS2lUrNKeOUOaoiUBAQg0QqCs2f+t6mz055VflRzfaTFdcjjv8QqCAARiEihj9kkqfbXk7+qPKx+KYr1WlkoO53VeQRCAQEwCZcw+T6XfLM2XPjqkq5Ufka6Q/OhtobK3lQgIQCAigTJmf0+F+9P9AuWLDul15R+lBZIfvdnsP2mdgAAEghIoY/agpVMWBCDQD4EgZu+nZI6FAAQmQgCzT4Qa50AgQwKYPcOmUTIEJkIAs0+EGudAIEMCLTR7hl2gZAjUQACz1wCZS0AgAgHMHqEL1ACBGghg9hogcwkIRCCA2cftAn+EQHsIYPb29JKZQGBcAph9XDz8EQLtIYDZ29NLZgKBcQlg9nHxpPwjY0GgWQKYvVn+XB0CtRHA7LWh5kIQaJYAZm+WP1eHQG0EMHttqFNeiLEg0D8BzN4/M86AQJYEMHuWbaNoCPRPALP3z4wzIJAlAcyeZdtSFs1YXSGA2bvSaebZeQKYvfMvAQB0hQBm70qnmWfnCWD2zr8EUgJgrMgEMHvk7lAbBBISwOwJYTIUBCITwOyRu0NtEEhIALMnhMlQKQkwVmoCmD01UcaDQFACmD1oYygLAqkJYPbURBkPAkEJYPagjaGslAQYywT6MfsxOuFD6TXJMUuLjdJ26SVpskRAAAJBCfRj9js1h23ScDyqlSeks6S90i0SAQEIBCVQ1uwzVf810rOSY5IW86W1kmONFoslAgIQCEqgrNmfVP33SX9JjlO02CcdkBw7tZghHS2WaeemIe3XkoBA1gTyLb6M2a/V9PZIm6WJxCqdNGdIU7QkIACBRgiUMfs8VXad9JX0ouTb96eUp0rHSg7f5u/yCoIABGISKGP2B1S6zXyG8hLpHekmaYN0veRYqsU6iYAABIISKGP2sUq/X3+4R/KjN3+HX611AgIQKE2g3gP7Nfu7Ks/f4ZWKHVrMlfzo7Qbl3yUCAhAISqBfswedBmVBAAK9CGD2XoT4OwRaQgCzt6SRTKPrBHrPH7P3ZsQREGgFAczeijYyCQj0JoDZezPiCAi0ggBmb0UbmQQEehMob/beY3EEBCAQmABmD9wcSoNASgKYPSVNxoJAYAKYPXBzKA0CKQk0Y/aUM2AsCECgFAHMXgoTB0EgfwKYPf8eMgMIlCKA2Uth4iAI5E8gf7Pn3wNmAIFaCGD2WjBzEQg0TwCzN98DKoBALQQwey2YuQgEmieA2Uf2gHUItJgAZm9xc5kaBEYSwOwjabAOgRYTwOwtbi5Tg8BIAph9JI2U64wFgWAEMHuwhlAOBAZFALMPiizjQiAYAcwerCGUA4FBEcDsgyKbclzGgkACApg9AUSGgEAOBDB7Dl2iRggkIIDZE0BkCAjkQACz59CllDUyVmcJYPbOtp6Jd40AZu9ax5lvZwlg9s62nol3jUBZs08VmLXSZ9I26TLpZOkt6QvJeZoy0SUCzDUrAmXN/pRm9YZ0rnShZMMvV35bmi05e1urRFsITFrZlpkwDxMoY/aTdODl0mrJ8YcW+6RF0hrJ4bzYK22SX+xdVpt6yVyKoozZZwnU99Jz0ofSs9IJ0qnSbsnxrRbeVhoVy7Rn05D2a0lAAAKNEChj9mNV2SXSM9LF0m/SP2/ZD2qfpTQqVmnPnCFN0ZKAwNEIsG/gBMqYfaeqsDYqO/xDnc3/nTamSw7nPV5BEIBATAJlzO5b9G9U/jmSY4EWW6X10lLJ4bzOKwgCEIhJoIzZXfntWjwvfSxdJD0sPSJdIfnR20JlbysREIBARAJlzf6Rivf37guU/av7XuUfJX/K+9Gbzf6TtgkINE+ACo5KoKzZj3oyOyEAgXwIYPZ8ekWlEKhEALNXwsfJEMiHAGbPp1dU2gSBFl0Ts7eomUwFAuMRwOzj0eFvEGgRAczeomYyFQiMRwCzj0eHv0EgJYGGx8LsDTeAy0OgLgKYvS7SXAcCDRPA7A03gMtDoC4CmL0u0lwHAikJTGAszD4BaJwCgRwJYPYcu0bNEJgAAcw+AWicUp3AwRVFkYuqzzbGCJg9Rh86V8XKlQ8WuchvSm1o0Jhmb8PkmAMEIHCYAGY/zII1CLSaAGZvdXuZHAQOE8Dsh1mwBoFWE6jF7K0myOQgkAkBzJ5JoygTAlUJYPaqBDkfApkQwOyZNIoyIVCVQHZmrzphzodAVwlg9q52nnl3jgBm71zLmXBXCWD2rnaeeXeOQKfN3rluM+FOE8DsnW4/k+8SAczepW4z104TwOydbj+T7xIBzJ6o2wwDgegEMHv0DlEfBBIRKGv2u3W9LdKn0gvScdIsaaO0XXpJmiwREIBAUAJlzD5Dtd8hzZHOl46RlkiPSk9IZ0l7pVskAgIQCEqgjNld+rFaHC85T1HeLc2X1kqONVoslogEBBgCAoMgUMbsu3Thx6SvJZv8Z+XN0j7pgOTYqYXvAJRGxTLt2TSk/VoSEIBAIwTKmH2aKlsk+Tv6aconSFdKZWOVDvRXgDmF7wm0QUAAAvUTKGP2hSrrS+l76U/pVWmeNFXybb1SMVML3wEoERCAQEQCZczu2/dLVbw/lycpL5C2Shuk6yXHUi3WSUQwApQDgWECZczux2v+Ie4DnfSJ5HN8a36/1u+R/OjtFOXVEgEBCAQlYOOWKW2FDjpX8qO3m5V/l3ZIcyU/ertB2fuUCAhAICKBsmaPWDs1QQACfRDA7H3A6vqhzD9vApg97/5RPQRKE8DspVFxIATyJoDZ8+4f1UOgNAHMXhoVB6YkwFj1E8Ds9TPnihBohABmbwQ7F4VA/QQwe/3MuSIEGiGA2RvBzkVTEmCscgQwezlOHAWB7Alg9uxbyAQgUI4AZi/HiaMgkD0BzJ59C5lASgJtHguzt7m7zA0CIwhg9hEwWK2PwINFPv9NWlm04h9mb0UbmQQEehPA7L0ZcQQEJkQg2kmYPVpHqAcCAyKA2QcElmEhEI0AZo/WEeqBwIAIYPYBgWVYCKQkkGIszJ6CImNAIAMCmD2DJlEiBFIQwOwpKDIGBDIggNkzaBIlQiAFgWGzpxiLMSAAgcAEMHvg5lAaBFISwOwpaTIWBAITwOyBm0NpEEhJYBBmT1kfY0EAAokIYPZEIBkGAtEJYPboHaI+CCQigNkTgWQYCEQnEN3s0flRHwSyIYDZs2kVhUKgGgHMXo0fZ0MgGwL1mn138UPxYPE/aXMmyqlWM82p3pxqzYetPVYc/V+9Zi+K/6iMH6Q5DWgi18ypVs8vp3pzqjUntvaY7DU66jb76ArYAwEI1EIAs9eCmYtAoHkCTZh9VfPTLl1BTrV6UjnVm1OtubF1vaOE2UchOWLHWC/IIw4KtJFTvTnV6hbnVq9rPkJNmP2IAtiAAATqIYDZ6+HMVSDQOIE6zX6lZvu5tF1aLkWL01XQBmmrtEW6U3KcrMVb0heS8zTlKHGMCvlQek1yzNJio2TGLylPlqLEVBWyVvpM2iZdJkVle7dq82vgU+UXpOOkyGxVXu+oy+x+UT6tcq6SzpNulJyVwsQBVXKv5LouVb5V8rrfmN7W+mzJ2dtaTRZVBvIbko0zPMajWnlCOkvaK90iRYmnVMgb0rnShZLrNkszjcR2hmq7Q/Kz9fOV/dpdohyZrcrrHXWZfa5K8afNDuU/pBelRVKk2K1iPpAcv2rhF6Mb7zrXaNvhvNgrATRTNVwjPSs5JmkxX/Knp1IRqdaTVNDl0mrJ4dfAPq1EZXusajtecp6i7NdGVLYqr1zUZXab5psRJe3UuvcphYwzVNXFkm+JT1V2s5WKb7XwtlLj8aQquE/6S3KcooUN5DsUrRaRGPsW+HsV9Zzkrx1+gzpB62YZje0u1fWY9LXk2n5W3ixFZavSykVdZi9XTYyjTlQZr0h3Sb9II+OgNiylRuNaXX2P5BehUvjwJ+QlqvIZyW+ivyn7Fl7p7zBX6+8dDa34NxnfcfgN6jTV4Dcl/96k1byjLrP73dI/gA3T8i2o9w1vR8n/ViE2+vPKr0qO77SYLjmcbTKvN6l5uvh10leSvxL5FtPfif0jmI2l3UUkxr7LsHyn5Nr8VcPmj8h2oQr8UvKdyJ/Kfh2Yd1S2KrFc1GX291WOf4Txu6V/IfYPHuu1L1L4O6+/U/q7+uMjCnOdSw9tO687tN5kekAXt5n9dcMs39H2TZKfJlyv7IhSq2vx1x9/jTvHG9ICyU89IrL17bt/oPV3db8mhmuNylYoy0VdZvf3yNtU0puSzfSysh9tKIUJv3vfrGr8KfmRsnW18iPSFZIfvfld39vaDBn3q6p7JP8Y6u/wfvPSZoi4XVX4juljKKazUAAAAMlJREFU5YukhyWzjMbWdx++8/CPtZ+oRnvE//dcZLYqs3d4Ir2PSnPE6xrmbOlM6SEpWryngvxOfoGyX4yWa/5R2353952Jzf6TtiPFuyrG3+GVCj/t8JMPP3q7QTt+l6KE3zz9OMt8/UTDjwajsl0haH5E6Edv/gAwx8hsVW7vqNPsvavhiEgEqKVlBDB7yxrKdCAwFgHMPhYZ9kOgZQQwe8saynQgMBYBzD4WGfanJMBYAQhg9gBNoAQI1EEAs9dBmWtAIACB/wMAAP//Or1D2AAAAAZJREFUAwD/M0NCDcwKLAAAAABJRU5ErkJggg==" width="251" height="251" style="margin-left: 0px; margin-top: 0px;" /></span></span></span></span></span></span></p>
<p></p>
<p class="pf0"><span class="cf0">In the case above, every pixel had a value of either <code><span style="color: #ff0000;">1</span></code>, <code><span style="color: #ff0000;">2</span> </code>or <code><span style="color: #ff0000;">3</span></code>. What happens if our dataset is incomplete and there is no data in some places?</span></p>
<p class="pf0"><strong><span class="cf0">Missing data</span></strong></p>
<p class="pf0"><span class="cf0">This is a common problem in real-life datasets. Real datasets can be incomplete and may be missing data at certain times or places. To deal with this, we use the special value known as </span><code><span class="cf0" style="color: #ff0000;">NaN</span></code><span class="cf0">, which stands for <strong>Not a Number</strong>.</span></p>
<p class="pf0"></p>
<p class="pf0"><code><span class="cf0" style="color: #ff0000;">NaNs</span></code><span class="cf0"> are designated by the </span><span class="cf0">numpy</span><span class="cf0"> </span><code><span class="cf0" style="color: #ff0000;">np.nan</span></code><span class="cf0"> function.</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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.nan,</span><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; font-family: 'Roboto Mono',monospace; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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=np.float32)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; 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 class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p class="pf0"><span class="cf0"><span id="docs-internal-guid-f4f71a81-7fff-3732-e811-a209571b3e05"><span style="font-size: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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;">5</span><span style="font-size: 9pt; 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: 9pt; 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: 9pt; 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;">nan,</span><span style="font-size: 9pt; 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: 9pt; 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;">7</span><span style="font-size: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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: 9pt; 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=float32)</span></span></span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________<span><span style="font-size: 9pt; 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></span></p>
<p class="pf0"><span class="cf0">To compute statistics on arrays containing </span><span class="cf0">NaN</span><span class="cf0"> values, </span><span class="cf0">numpy</span><span class="cf0"> has special versions of common functions such as <code><span style="color: #ff0000;">mean</span></code>, standard deviation <code><span style="color: #ff0000;">std</span></code>, and <code><span style="color: #ff0000;">sum</span> </code>that ignore the </span><code><span class="cf0" style="color: #ff0000;">NaN</span></code><span class="cf0"> values. For example, the next cell shows the difference between using the usual <code><span style="color: #ff0000;">mean</span> </code>function and the </span><code><span class="cf0" style="color: #ff0000;">nanmean</span></code><span class="cf0"> function.</span></p>
<p class="pf0"></p>
<p class="pf0"><span class="cf0">The <code><span style="color: #ff0000;">mean</span> </code>function cannot handle </span><code><span class="cf0" style="color: #ff0000;">NaN</span></code><span class="cf0"> values so it will return <code><span style="color: #ff0000;">nan</span></code>. The </span><span class="cf0">nanmean</span><span class="cf0"> function does not include </span><span class="cf0">NaN</span><span class="cf0"> values in the calculation, and therefore returns a number value.</span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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.mean(arr))</span><span class="cf0"><span id="docs-internal-guid-792efa92-7fff-7ca3-4a72-6210d7457f41"><br /><span style="font-size: 9pt; 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: 9pt; 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.nanmean(arr))</span></span></span></p>
<p class="pf0"><span class="cf0">_____________________________________________________________</span></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0">_____________________________________________________________</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">nan</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 10pt; margin-bottom: 0pt;"><span style="font-size: 9pt; 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: 9pt; font-family: 'Roboto Mono',monospace; 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: 9pt; 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;">875</span></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0">_____________________________________________________________</span></p>
<p class="pf0" style="font-size: 16px;"><span class="cf0"><span class="cf0">Note that </span><code><span class="cf0" style="color: #ff0000;">NaN</span></code><span class="cf0"> is generally not used as a key in dictionary key-value entries because there are different ways of expressing </span><code><span class="cf0" style="color: #ff0000;">NaN</span></code><span class="cf0"> in Python and they are not always equivalent. However, it is still possible to visualise data with </span><code><span class="cf0">NaNs</span></code><span class="cf0">; there will be gaps in the image where there is no data.</span></span></p>
<p><span class="cf0"> </span></p>
<p class="pf0"></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@6d60c8d0182e4369bd89c4d2bfec2b1d" data-request-token="f956056e4d0111f1b4d66b8c55c4de7e" 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@0b41e33da11b4f2d898b54b5ce2f4d6c">
<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@0b41e33da11b4f2d898b54b5ce2f4d6c" data-request-token="f956056e4d0111f1b4d66b8c55c4de7e" 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">4.1 The harvesting season has arrived and our cropping lands have changed colour to brown. Can you:</span></p>
<ul style="padding-left: 30px;">
<ul>
<ul>
<li><span class="cf0">4.1.1 Modify the yellow area to contain the new value <code><span style="color: #339966;">4</span></code>?</span></li>
<li><span class="cf0">4.1.2 Add a new entry to the <code><span style="color: #339966;">index</span></code> dictionary mapping number 4 to the value <code><span style="color: #339966;">brown</span></code>.</span></li>
<li><span class="cf0">4.1.3 Plot the area.</span></li>
</ul>
</ul>
</ul>
<p><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;"># 4.1.1 Modify the yellow area to hold the value 4</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;"># 4.1.2 Add a new key-value pair to index that maps 4 to 'brown'</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;"># 4.1.3 Copy the cmap definition and re-run it to add the new colour</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;"># Plot the area<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"><em><span class="cf0">Hint: If you want to plot the new area, you have to redefine </span><code><span class="cf0" style="color: #339966;">cmap</span></code><span class="cf0"> so the new value is assigned a colour in the colour map. Copy and paste the </span><code><span class="cf0" style="color: #339966;">cmap</span></code><span class="cf0"><code><span style="color: #339966;"> = ...</span></code> line from the original plot.</span></em></p>
<p></p>
<p class="pf0" style="padding-left: 30px;"><span class="cf0">4.2 Set <code><span style="color: #339966;">area[20:40, 80:95] = </span></code></span><code><span class="cf0" style="color: #339966;">np.nan</span></code><span class="cf0">. Plot the area now.</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;"># Set the nan area</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;"># Plot the entire area<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.8; margin-top: 0pt; margin-bottom: 0pt; padding-left: 30px;"><span class="cf0">4.3 Find the median of the <code><span style="color: #339966;">area</span> </code>array from 4.2 using </span><code><span class="cf0" style="color: #339966;">np.nanmedian</span></code><span class="cf0">. Does this match your visual interpretation? How does this compare to using </span><code><span class="cf0" style="color: #339966;">np.median</span></code><span class="cf0">?</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;"></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span class="cf0"><span id="docs-internal-guid-9036a9ef-7fff-74c1-d21c-c8f9b5520959"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #b80672; 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;"># Use np.nanmedian to find the median of the area<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>
</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@5aad7ee3bd9e49af9c5079c5b0a40a64" data-request-token="f956056e4d0111f1b4d66b8c55c4de7e" 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@eeabde918bf4447eba7d5198e8b80fdb">
<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@eeabde918bf4447eba7d5198e8b80fdb" data-request-token="f956056e4d0111f1b4d66b8c55c4de7e" 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">Two key Python capabilities have been introduced in this section. We can organise our data using the dictionary syntax, and understand incomplete datasets that may use </span><code><span class="cf0" style="color: #339966;">NaN</span></code><span class="cf0"> values to show blanks. The next lesson provides a guide to </span><span class="cf0">xarray</span><span class="cf0">, a Python package that builds on these concepts to make multi</span><span class="cf1">‑</span><span class="cf0">dimensional data easier to load and use.</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>