<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shubhanshu Singh on Medium]]></title>
        <description><![CDATA[Stories by Shubhanshu Singh on Medium]]></description>
        <link>https://medium.com/@shubhanshu1995?source=rss-fdb7ff8da275------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p3rSPzlY0gSBDr-ypui27w.jpeg</url>
            <title>Stories by Shubhanshu Singh on Medium</title>
            <link>https://medium.com/@shubhanshu1995?source=rss-fdb7ff8da275------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:27:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhanshu1995/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[NumPy — The King of Scientific Computing with Python]]></title>
            <link>https://medium.com/data-science/numpy-the-king-of-scientific-computing-with-python-d1de680b811d?source=rss-fdb7ff8da275------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1de680b811d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Shubhanshu Singh]]></dc:creator>
            <pubDate>Sun, 07 Jun 2020 22:51:19 GMT</pubDate>
            <atom:updated>2020-06-19T05:37:29.997Z</atom:updated>
            <content:encoded><![CDATA[<h4>Python for Data Science and Machine Learning</h4><h3>NumPy — The King of Scientific Computing with Python</h3><h4>A comprehensive guide to get started with NumPy</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pF9s_WbiPjWN-8Nh" /><figcaption>Photo by <a href="https://unsplash.com/@dilja96?utm_source=medium&amp;utm_medium=referral">Dilyara Garifullina</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Python is one of my favourite programming languages ( I love cpp too ). It is super easy to learn because of its beginner-friendly syntax. What makes it stand apart from the other programming language is its awesome developers&#39; community. It comes pre-loaded with so many tools &amp; libraries. And it is one of the most preferred languages in the field of Data Science &amp; Machine Learning.</p><blockquote>In this article, I’m going to tell you about one such powerful library in Python known as <strong>NumPy.</strong></blockquote><blockquote>Enjoy the ride !!</blockquote><h3>Contents:</h3><ol><li><a href="#cef9">What is NumPy?</a></li><li><a href="#e7cc">NumPy vs List</a></li><li><a href="#ca14">Installation</a></li><li><a href="#931b">Let’s get started with NumPy Arrays</a></li><li><a href="#71bb">Let’s check out some built-in methods of NumPy</a><br>a) <a href="#47a4">arange</a><br>b) <a href="#3784">Zeros and Ones</a><br>c) <a href="#a330">linspace</a><br>d) <a href="#d48e">eye</a><br>e) <a href="#f5c7">Random</a></li><li><a href="#cafe">Array Attributes and Methods</a><br>a) <a href="#0799">Reshape</a><br>b)<a href="#08a6"> max, min, argmax, argmin</a><br>c) <a href="#6582">Shape</a><br>d) <a href="#1d11">dtype</a></li><li><a href="#d946">NumPy Indexing and Selection</a></li><li><a href="#346e">Broadcasting</a></li><li><a href="#ac02">Indexing a 2D array (matrices)</a></li><li><a href="#688c">Selection</a></li><li><a href="#2d38">NumPy Operations</a><br>a) <a href="#ca9c">Arithematic</a><br>b) <a href="#f2a8">Universal Array Functions</a></li><li><a href="#303b">Vectorization</a></li><li><a href="#9059">Conclusion</a></li><li><a href="#a0f4">Github Repository</a></li><li><a href="#1790">References</a></li><li><a href="#3461">Suggested Reading</a></li></ol><h3>1. What is NumPy</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FDHqth0hVQoIzS%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmaths-DHqth0hVQoIzS&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FDHqth0hVQoIzS%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="186" frameborder="0" scrolling="no"><a href="https://medium.com/media/edf4499f184112dabe060cbf2577d147/href">https://medium.com/media/edf4499f184112dabe060cbf2577d147/href</a></iframe><blockquote>NumPy is a Linear Algebra Library for python.</blockquote><ol><li>It is the core library for scientific computation in python.</li><li>It is super fast as it has bindings to C libraries.</li><li>It provides a high-performance multidimensional array object and tools for working with these arrays.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wJnBdEKujzl9dsWAmJF4A.png" /><figcaption><strong>Multidimensional Array</strong> ( Source: <a href="https://ipython-books.github.io/pages/chapter01_basic/images/numpy.png">https://ipython-books.github.io/ </a>)</figcaption></figure><h3>2. NumPy vs List</h3><blockquote>Who is the winner?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*bMpgvUN7D3HuJTzIqRfcMQ.png" /><figcaption>Image by <a href="https://pixabay.com/users/GraphicMama-team-2641041/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1424831">GraphicMama-team</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1424831">Pixabay</a></figcaption></figure><blockquote>Let’s see the difference</blockquote><ul><li><strong>NumPy</strong> has a fixed type of nature. NumPy is used for creating <strong>homogeneous</strong> n-dimensional arrays. <strong>Lists</strong> can be heterogeneous in nature.</li><li>We don’t need to type check while iterating through <strong>NumPy</strong> arrays. On the other hand, <strong>Lists</strong> object can be of type <em>int</em>, <em>boolean</em>, <em>string</em> etc.</li></ul><p><strong><em>This code will give an error if we mention the dtype explicitly:</em></strong></p><pre>#heterogenous 1D array <br>#gives an error in numpy<br>np_arr = np.array([1,2,&quot;a&quot;,3,&quot;b&quot;], dtype=np.int32)</pre><p><strong><em>This a valid code for python Lists:</em></strong></p><pre>#heterogenous 1D array<br>arr = [1,2,&quot;a&quot;,3,&quot;b&quot;]</pre><blockquote>Mathematical operations can’t be performed on heterogeneous data. That’s why it is recommended to have homogenous <strong>NumPy</strong> arrays</blockquote><p>Let’s take one more example:</p><p><strong><em>This code will give an error in python Lists:</em></strong></p><pre>x = [1,2,3]<br>y = [4,5,6]</pre><pre>#this will give an error,<br>#not possible in Lists<br>x*y</pre><p><strong><em>But this a valid code for NumPy:</em></strong></p><pre>x = np.array([1,2,3])<br>y = np.array([4,5,6])</pre><pre>x*y</pre><pre>#Output<br>np.array([4,10,18])</pre><p>We’ll learn more about some awesome features in NumPy in the upcoming sections.</p><blockquote>Suppose we have a matrix:</blockquote><pre>[[1,2,3],<br> [4,5,6],<br> [7,8,9]]</pre><p>We’ll analyse for a number 7 in the matrix.</p><p>Computers read the information in binary.</p><p>By default <strong>Numpy</strong> stores 7 in total memory space of 4 bytes.</p><p>On the other hand in <strong>Lists</strong>, there is a lot of information that needs to be stored for integer 7.</p><p>Lists use a built-in int type for python.</p><p>The built-in int type consists of four different things:</p><h4>Size</h4><p>Depicts the size of that particular integer value.</p><h4>Reference Count</h4><p>It tells how many times that particular integer (here 7) has been pointed at.</p><blockquote>Every variable in Python is just a reference (a pointer) to an object. It is not the actual value itself.</blockquote><blockquote>So for keeping track of references, every object (even integer) has an extra field called <strong>reference count </strong>that is increased or decreased when a pointer to the object is created or deleted.</blockquote><h4>Object Type</h4><p>It tells whether the object is int, boolean, string etc.</p><h4>Object Value</h4><p>It has its own binary representation</p><blockquote>up to 64 bits……..00000000 00000111 (8 bytes)</blockquote><blockquote>Like this we also have binary representation for <strong>size</strong>, <strong>reference count</strong>, <strong>object type.</strong></blockquote><blockquote>So basically it’s faster to read less bytes of memory.</blockquote><blockquote>We can clearly see Numpy takes less memory than Lists for a single integer storage !!</blockquote><blockquote>Have look at this illustration</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CeOUCT3vUumkMmBbESyY-w.jpeg" /><figcaption>Image by author</figcaption></figure><p>The data on our list will be scattered in the computer’s memory. It doesn&#39;t have contiguous blocks of memory. The list will contain just a pointer to those 8 blocks of memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sR0i1KxIZNzSQCXTH-PQbA.jpeg" /><figcaption>Image by author</figcaption></figure><p>On the other hand, NumPy array will have contiguous blocks of memory in the computer. All 8 blocks are right next to each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qrBwqOiLB4SRYWZisiczA.jpeg" /><figcaption>Image by author</figcaption></figure><blockquote>So the takeaway from above analysis is that Lists are very slow and NumPy is superfast !!</blockquote><blockquote>NumPy has the speed like cheetah ;)</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F7lz6nPd56aHh6%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F7lz6nPd56aHh6%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F7lz6nPd56aHh6%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="234" frameborder="0" scrolling="no"><a href="https://medium.com/media/900b631a7de963a5c54f1b2a47f0618a/href">https://medium.com/media/900b631a7de963a5c54f1b2a47f0618a/href</a></iframe><h3>3. Installation</h3><p>I’ll recommend you to install Python using the Anaconda distribution to make sure all underlying dependencies (such as Linear Algebra libraries) sync up with the use of conda install.</p><blockquote>Refer this link to know more about anaconda installation:</blockquote><p><a href="https://docs.anaconda.com/anaconda/install/">Installation — Anaconda Documentation</a></p><p>If you have Anaconda, install NumPy by going to your terminal or command prompt and start typing:</p><pre>conda install numpy</pre><p>If you don’t have Anaconda distribution, you can also use:</p><pre>pip install numpy</pre><h3>4. Let’s get started with NumPy Arrays:</h3><p>We’ll talk about vectors &amp; matrices.</p><blockquote><strong>Vectors are strictly 1-D arrays and Matrices are 2-D arrays</strong></blockquote><blockquote><strong>Note: Matrix can still have only one row or one column</strong></blockquote><blockquote>First import Numpy</blockquote><pre>import numpy as np</pre><blockquote>Let’s create NumPy Arrays using python Lists</blockquote><p><strong><em>Code 1:</em></strong></p><pre>#define<br>just_a_list = [1,2,3]</pre><pre>#show<br>just_a_list</pre><p><strong><em>Output:</em></strong></p><pre>[1, 2, 3]</pre><p>Now we will convert the above <em>code 1</em> snippet variable just_a_list to NumPy array.</p><p><strong><em>Code 2:</em></strong></p><pre>np.array(just_a_list)</pre><p><strong><em>Output:</em></strong></p><pre>array([1, 2, 3])</pre><p><strong><em>Code 3:</em></strong></p><pre>#define<br>just_a_matrix = [[1,2,3],[4,5,6],[7,8,9]]</pre><pre>#show<br>just_a_matrix</pre><p><strong><em>Output:</em></strong></p><pre>[[1, 2, 3], [4, 5, 6], [7, 8, 9]]</pre><p>Now we will convert the above <em>code 3 </em>snippet variable just_a_matrix to NumPy 2d array</p><p><strong><em>Code 4:</em></strong></p><pre>np.array(just_a_matrix)</pre><p><strong><em>Output:</em></strong></p><pre>array([[1, 2, 3],<br>       [4, 5, 6],<br>       [7, 8, 9]])</pre><h3><strong>5. Let’s check out some built-in methods of NumPy:</strong></h3><h3>a) arange</h3><blockquote>It returns evenly spaced values within a given interval.</blockquote><blockquote>This is very similar to Python’s own built-in range function.</blockquote><blockquote>The upper limit gets excluded in output.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>np.arange(0,20)</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])</pre><p><strong><em>Code 2:</em></strong></p><pre>#step size of 2<br>np.arange(0,10,2)</pre><p><strong><em>Output:</em></strong></p><pre>array([0, 2, 4, 6, 8])</pre><p>In the above code snippet, 2 is the step size. As you can see in the output, the series is incrementing by the difference of 2.</p><h3>b) Zeros and Ones</h3><h4>Let’s generate arrays of zeros or ones</h4><p><strong><em>Code 1:</em></strong></p><pre>np.zeros(4)</pre><p><strong><em>Output:</em></strong></p><pre>array([0., 0., 0., 0.])</pre><p>So basically np.zeros(4) returns a new array filled with 4 zeros.</p><p><strong><em>Code 2:</em></strong></p><pre>np.zeros((3,3))</pre><p><strong><em>Output:</em></strong></p><pre>array([[0., 0., 0.],<br>       [0., 0., 0.],<br>       [0., 0., 0.]])</pre><p>np.zeros((3,3))<strong> </strong>returns a matrix of shape (3,3) filled with zeros. Shape (3,3) refers to 3 rows &amp; 3 columns.</p><p><strong><em>Code 3:</em></strong></p><pre>np.ones(4)</pre><p><strong><em>Output:</em></strong></p><pre>array([1., 1., 1., 1.])</pre><p>In the above code snippet,<strong> </strong>np.ones(4) returns a new array filled with 4 ones.</p><p><strong><em>Code 4:</em></strong></p><pre>np.ones((3,3))</pre><p><strong><em>Output:</em></strong></p><pre>array([[ 1.,  1.,  1.],<br>       [ 1.,  1.,  1.],<br>       [ 1.,  1.,  1.]])</pre><h3>c) linspace</h3><blockquote>Return evenly spaced numbers over a specified interval.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>#generates three numbers<br>#between range 0 to 10<br>np.linspace(0,10,3)</pre><p><strong><em>Output:</em></strong></p><pre>array([0., 5., 10.])</pre><p><strong><em>Code 2:</em></strong></p><pre>np.linspace(0,10,20)</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0.,  0.52631579,  1.05263158,  1.57894737,  2.10526316,         2.63157895,  3.15789474,  3.68421053,  4.21052632,  4.73684211,         5.26315789,  5.78947368,  6.31578947,  6.84210526,  7.36842105,         7.89473684,  8.42105263,  8.94736842,  9.47368421,  10.        ])</pre><h3>d) eye</h3><blockquote>Creates an identity matrix.</blockquote><p><strong><em>Code :</em></strong></p><pre>np.eye(3)</pre><p><strong><em>Output:</em></strong></p><pre>array([[1., 0., 0.],<br>       [0., 1., 0.],       <br>       [0., 0., 1.]])</pre><h3>e) Random</h3><blockquote>Numpy also has a lot of ways to create random number arrays</blockquote><h3>i) rand</h3><blockquote>Creates an array of the given shape and populate it with random samples from a <strong>uniform</strong> distribution over [0, 1).</blockquote><p><strong><em>Code 1:</em></strong></p><pre>np.random.rand(2)</pre><p><strong><em>Output:</em></strong></p><pre>array([0.01231767, 0.24372946])</pre><p><strong><em>Code 2:</em></strong></p><pre>np.random.rand(3,3)</pre><p><strong><em>Output:</em></strong></p><pre>array([[0.75250092, 0.7582111 , 0.16155648],        <br>       [0.11020177, 0.51819124, 0.29267394],        <br>       [0.70052998, 0.58651773, 0.80589757]])</pre><h3>ii) randn</h3><blockquote>Return a sample (or samples) from the <strong>Standard Normal</strong> or <strong>Gaussian</strong> distribution.<strong> </strong>Unlike np.random.rand which returns a <strong>uniform</strong> distribution.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>np.random.randn(2)</pre><p><strong><em>Output:</em></strong></p><pre>array([ 1.5868519 , -2.72817085])</pre><p><strong><em>Code 2:</em></strong></p><pre>np.random.randn(4,4)</pre><p><strong><em>Output:</em></strong></p><pre>array([[ 0.24602617, -2.39464955, -0.1382286 ,  1.47872422],    <br>       [ 0.70466341, -0.17408009, -2.22898345,  0.28018941],        <br>       [ 0.57969196,  0.00664889,  1.20221044,  0.47452959],        <br>       [ 0.93939176, -0.07719476, -0.08907384,  1.26465443]])</pre><h3>iii) randint</h3><blockquote>Return random integers from <strong>low</strong> (inclusive) to<strong> high</strong> (exclusive).</blockquote><p><strong><em>Code 1:</em></strong></p><pre>np.random.randint(1,100)</pre><p><strong><em>Output:</em></strong></p><pre>84</pre><p><strong><em>Code 2:</em></strong></p><pre>#generates 10 random <br>#integers between 1 to 100<br>np.random.randint(1,100,10)</pre><p><strong><em>Output:</em></strong></p><pre>array([85, 30,  2, 72, 40, 86, 18, 46,  3, 24])</pre><h3>6. Array Attributes and Methods</h3><h3>a) Reshape</h3><blockquote>One of the most useful methods you can use on an array is the reshape method.</blockquote><blockquote>It returns an array containing the same data with a new shape.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>#define<br>arr = np.arange(16)</pre><pre>#show<br>arr</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])</pre><p>Now let’s reshape the above <em>code 1</em> snippet variable arr</p><p><strong><em>Code 2:</em></strong></p><pre>arr.reshape(4,4)</pre><p><strong><em>Output:</em></strong></p><pre>array([[ 0,  1,  2,  3],        <br>       [ 4,  5,  6,  7],        <br>       [ 8,  9, 10, 11],        <br>       [12, 13, 14, 15]])</pre><h3>b) max, min, argmax, argmin</h3><blockquote>These are useful methods for finding maximum or minimum values. We can also find their index locations using argmin or argmax !!</blockquote><blockquote>Let’s generate a random NumPy array of 10 integers</blockquote><p><strong><em>Code 1:</em></strong></p><pre>#define<br>random_arr = np.random.randint(0,50,10)</pre><pre>#show<br>random_arr</pre><p><strong><em>Output:</em></strong></p><pre>array([16,  8, 40,  7, 15, 39,  0, 15, 20, 35])</pre><p><strong><em>Code 2:</em></strong></p><pre>random_arr.max()</pre><p><strong><em>Output:</em></strong></p><pre>40</pre><p><strong><em>Code 3:</em></strong></p><pre>random_arr.argmax()</pre><p><strong><em>Output:</em></strong></p><pre>2</pre><p><strong><em>Code 4:</em></strong></p><pre>random_arr.min()</pre><p><strong><em>Output:</em></strong></p><pre>0</pre><p><strong><em>Code 5:</em></strong></p><pre>random_arr.argmin()</pre><p><strong><em>Output:</em></strong></p><pre>6</pre><h3>c) Shape</h3><blockquote>Shape is an attribute that arrays have (not a method)</blockquote><blockquote>We have already defined the variable arr under the <a href="#3454"><strong><em>code 1 snippet</em></strong></a> of the Reshape Section.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>arr.shape</pre><p><strong><em>Output:</em></strong></p><pre>(16,)</pre><p>The above shape indicates that arr is just a one-dimensional vector of rank 1.</p><p><strong><em>Code 2:</em></strong></p><pre>arr.reshape(1,16)</pre><p><strong><em>Output:</em></strong></p><pre>array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]])</pre><blockquote>Notice the two sets of brackets in the output. It indicates the 2-dimensional NumPy array.</blockquote><p><strong><em>Code 3:</em></strong></p><pre>arr.reshape(1,16).shape</pre><p><strong><em>Output:</em></strong></p><pre>(1, 16)</pre><p>The reshaped arr contains 1 row &amp; 16 columns.</p><p><strong><em>Code 4:</em></strong></p><pre>arr.reshape(16,1)</pre><p><strong><em>Output:</em></strong></p><pre>array([[ 0], <br>       [ 1], <br>       [ 2], <br>       [ 3], <br>       [ 4], <br>       [ 5], <br>       [ 6], <br>       [ 7], <br>       [ 8], <br>       [ 9], <br>       [10], <br>       [11], <br>       [12], <br>       [13], <br>       [14], <br>       [15]])</pre><p><strong><em>Code 5:</em></strong></p><pre>arr.reshape(16,1).shape</pre><p><strong><em>Output:</em></strong></p><pre>(16, 1)</pre><p>The reshaped arr contains 16 rows &amp; 1 column.</p><h3>d) dtype</h3><blockquote>Using dtype we can get the data type of the object in the array.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>arr.dtype</pre><p><strong><em>Output:</em></strong></p><pre>dtype(‘int64’)</pre><h3>7. NumPy Indexing and Selection</h3><blockquote>Now we will learn how to select elements or group of elements from an array. The simplest way of picking up one or more elements from an array looks very similar to python lists</blockquote><blockquote>We have already defined the variable <em>arr</em> under the <a href="#3454"><strong><em>code 1 snippet</em></strong></a> of the Reshape Section.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>#Get a value <br>#at an index<br>arr[5]</pre><p><strong><em>Output:</em></strong></p><pre>5</pre><p><strong><em>Code 2:</em></strong></p><pre>#Get values <br>#in a range<br>arr[1:5]</pre><p><strong><em>Output:</em></strong></p><pre>array([1, 2, 3, 4])</pre><h3>8. Broadcasting</h3><blockquote>The term broadcasting describes how Numpy treats array with different shapes during arithmetic operations.</blockquote><blockquote>Numpy arrays differ from a normal Python list because of their ability to broadcast.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>#Setting a value with<br>#index range<br>arr[0:5]=100</pre><pre>#Show<br>arr</pre><p><strong><em>Output:</em></strong></p><pre>array([100, 100, 100, 100, 100, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])</pre><p><strong><em>Code 2:</em></strong></p><pre>#Reset array, we&#39;ll <br>#see the reason behind it soon<br>arr = np.arange(0,11)</pre><pre>#Show<br>arr</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10])</pre><p><strong><em>Code 3:</em></strong></p><pre>slice_of_arr = arr[0:6]</pre><pre>#Show slice<br>slice_of_arr</pre><p><strong><em>Output:</em></strong></p><pre>array([0, 1, 2, 3, 4, 5])</pre><p><strong><em>Code 4:</em></strong></p><pre>#Change Slice<br>slice_of_arr[:]=99</pre><pre>#Show Slice again<br>slice_of_arr</pre><p><strong><em>Output:</em></strong></p><pre>array([99, 99, 99, 99, 99, 99])</pre><p><strong><em>Code 5:</em></strong></p><pre>arr</pre><p><strong><em>Output:</em></strong></p><pre>array([99, 99, 99, 99, 99, 99, 6, 7, 8, 9, 10])</pre><blockquote>As you can see in the above output, the changes also occured in our original array !!</blockquote><blockquote>This happened because <em>slice_of_arr</em> is just a reference to the first five elements of <em>arr</em> . Assignment operation doesn’t make a separate copy of the data.</blockquote><blockquote>To Copy the data, we need to use the <strong>copy</strong> method !!</blockquote><p><strong><em>Code 6:</em></strong></p><pre>arr_copy = arr.copy()</pre><pre>arr_copy</pre><p><strong><em>Output:</em></strong></p><pre>array([99, 99, 99, 99, 99, 99,  6,  7,  8,  9, 10])</pre><blockquote>Let’s see another example of broadcasting</blockquote><p><strong><em>Code 7:</em></strong></p><pre>a = [[1,2,3],[4,5,6]]</pre><pre>#Converting to <br>#numpy 2d array<br>np_a = np.array(a)</pre><pre>#show<br>np_a</pre><p><strong><em>Output:</em></strong></p><pre>array([[1, 2, 3],        <br>       [4, 5, 6]])</pre><p><strong><em>Code 8:</em></strong></p><pre>#2 rows, 3 columns<br>np_a.shape</pre><p><strong><em>Output:</em></strong></p><pre>(2, 3)</pre><p><strong><em>Code 9:</em></strong></p><pre>b = [100,200,300]</pre><pre>#converting to <br>#numpy array<br>np_b = np.array(b)</pre><pre>#show<br>np_b</pre><p><strong><em>Output:</em></strong></p><pre>array([100, 200, 300])</pre><p><strong><em>Code 10:</em></strong></p><pre>np_b.shape</pre><p><strong><em>Output:</em></strong></p><pre>(3,)</pre><p><strong><em>Code 11:</em></strong></p><pre>np_b_reshaped = np_b.reshape(1,3)</pre><pre>#show<br>np_b_reshaped</pre><p><strong><em>Output:</em></strong></p><pre>array([[100, 200, 300]])</pre><p><strong><em>Code 12:</em></strong></p><pre>#1 row, 3 columns<br>np_b_reshaped.shape</pre><p><strong><em>Output:</em></strong></p><pre>(1, 3)</pre><blockquote>See the magic of broadcasting</blockquote><p><strong><em>Code 13:</em></strong></p><pre>np_a + np_b_reshaped</pre><p><strong><em>Output:</em></strong></p><pre>array([[101, 202, 303],        <br>       [104, 205, 306]])</pre><blockquote>So basically np_b_reshaped replicates itself for the second row &amp; it’s shape becomes (2,3)</blockquote><p><strong><em>Code 14:</em></strong></p><pre>np.array([[100,200,300],[100,200,300]])</pre><p><strong><em>Output:</em></strong></p><pre>array([[100, 200, 300],        <br>       [100, 200, 300]])</pre><h3>9. Indexing a 2D array (matrices)</h3><blockquote>The general format is arr_2d[row][col] or arr_2d[row,col].</blockquote><p><strong><em>Code 1 :</em></strong></p><pre>arr_2d = np.array(([1,2,3],[4,5,6],[7,8,9]))</pre><pre>#Show<br>arr_2d</pre><p><strong><em>Output:</em></strong></p><pre>array([[1, 2, 3],        <br>       [4, 5, 6],        <br>       [7, 8, 9]])</pre><p><strong><em>Code 2:</em></strong></p><pre>#Indexing row<br>arr_2d[1]</pre><p><strong><em>Output:</em></strong></p><pre>array([4, 5, 6])</pre><p><strong><em>Code 3:</em></strong></p><pre>#Getting individual element value<br>arr_2d[1][0]</pre><p><strong><em>Output:</em></strong></p><pre>4</pre><p><strong><em>Code 4:</em></strong></p><pre>#another way<br>arr_2d[1,0]</pre><p><strong><em>Output:</em></strong></p><pre>4</pre><p><strong><em>Code 5:</em></strong></p><pre>#2D array slicing<br>#Shape (2,2) from<br>#top right corner</pre><pre>arr_2d[:2,1:]</pre><p><strong><em>Output:</em></strong></p><pre>array([[2, 3],        <br>       [5, 6]])</pre><p><strong><em>Code 6:</em></strong></p><pre>#Shape of the <br>#bottom row<br>arr_2d[2]</pre><p><strong><em>Output:</em></strong></p><pre>array([7, 8, 9])</pre><h3>10. Selection</h3><blockquote>Let’s briefly go over how to use brackets for selection based on comparison operators.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>arr1 = np.arange(1,11)</pre><pre>#show<br>arr1</pre><p><strong><em>Output:</em></strong></p><pre>array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10])</pre><p><strong><em>Code 2:</em></strong></p><pre>arr1 &gt; 5</pre><p><strong><em>Output:</em></strong></p><pre>array([False, False, False, False, False,  True,  True,  True, True,          True])</pre><p><strong><em>Code 3:</em></strong></p><pre>bool_arr = arr1 &gt; 5</pre><pre>#show<br>bool_arr</pre><p><strong><em>Output:</em></strong></p><pre>array([False, False, False, False, False,  True,  True,  True, True, True])</pre><p><strong><em>Code 4:</em></strong></p><pre>arr1[bool_arr]</pre><p><strong><em>Output:</em></strong></p><pre>array([ 6,  7,  8,  9, 10])</pre><p><strong><em>Code 5:</em></strong></p><pre>arr1[arr1 &gt; 2]</pre><p><strong><em>Output:</em></strong></p><pre>array([ 3,  4,  5,  6,  7,  8,  9, 10])</pre><h3>11. NumPy Operations</h3><h3>a) Arithmetic</h3><blockquote>You can easily perform array with array arithmetic, or scalar with array arithmetic. Let’s see some examples.</blockquote><p><strong><em>Code 1:</em></strong></p><pre>arr2 = np.arange(0,10)</pre><p><strong><em>Code 2:</em></strong></p><pre>arr2 + arr2</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0,  2,  4,  6,  8, 10, 12, 14, 16, 18])</pre><p><strong><em>Code 3:</em></strong></p><pre>arr2 * arr2</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0,  1,  4,  9, 16, 25, 36, 49, 64, 81])</pre><p><strong><em>Code 4:</em></strong></p><pre>arr2 - arr2</pre><p><strong><em>Output:</em></strong></p><pre>array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])</pre><blockquote>Warning on division by zero, but not an error!</blockquote><blockquote>Numpy will replace it with nan</blockquote><p><strong><em>Code 5:</em></strong></p><pre>arr2 / arr2</pre><p><strong><em>Output:</em></strong></p><pre>/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:3: RuntimeWarning: invalid value encountered in true_divide<br>  This is separate from the ipykernel package so we can avoid doing imports until</pre><pre>array([nan,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])</pre><blockquote>Another warning, but not an error. Value will be replaced with infinity.</blockquote><p><strong><em>Code 6:</em></strong></p><pre>1 / arr2</pre><p><strong><em>Output:</em></strong></p><pre>/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:2: RuntimeWarning: divide by zero encountered in true_divide</pre><pre>array([inf, 1., 0.5, 0.33333333, 0.25, 0.2, 0.16666667, 0.14285714, 0.125, 0.11111111])</pre><blockquote>Cube of numbers</blockquote><p><strong><em>Code 7:</em></strong></p><pre>arr2 ** 3</pre><p><strong><em>Output:</em></strong></p><pre>array([0, 1, 8, 27, 64, 125, 216, 343, 512, 729])</pre><h3>b) Universal Array Functions</h3><blockquote>Numpy comes preloaded with many <a href="https://numpy.org/doc/stable/reference/ufuncs.html">universal array functions</a>, which are essentially just mathematical operations you can use to perform the operation across the array. Let’s see some common ones.</blockquote><blockquote>Taking Square Roots</blockquote><p><strong><em>Code 1:</em></strong></p><pre>np.sqrt(arr2)</pre><p><strong><em>Output:</em></strong></p><pre>array([0. , 1., 1.41421356, 1.73205081, 2., 2.23606798, 2.44948974, 2.64575131, 2.82842712, 3.])</pre><blockquote>Calcualting exponential (e^x)</blockquote><p><strong><em>Code 2:</em></strong></p><pre>np.exp(arr2)</pre><p><strong><em>Output:</em></strong></p><pre>array([1.00000000e+00, 2.71828183e+00, 7.38905610e+00, 2.00855369e+01,        5.45981500e+01, 1.48413159e+02, 4.03428793e+02, 1.09663316e+03,        2.98095799e+03, 8.10308393e+03])</pre><blockquote>same as arr.max()</blockquote><p><strong><em>Code 3:</em></strong></p><pre>np.max(arr2)</pre><p><strong><em>Output:</em></strong></p><pre>9</pre><blockquote>Calculating sine value</blockquote><p><strong><em>Code 4:</em></strong></p><pre>np.sin(arr2)</pre><p><strong><em>Output:</em></strong></p><pre>array([ 0.,  0.84147098,  0.90929743,  0.14112001, -0.7568025 ,        -0.95892427, -0.2794155 ,  0.6569866 ,  0.98935825,  0.41211849])</pre><blockquote>Calculating log</blockquote><p><strong><em>Code 5:</em></strong></p><pre>np.log(arr2)</pre><p><strong><em>Output:</em></strong></p><pre>usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:1: RuntimeWarning: divide by zero encountered in log<br>  &quot;&quot;&quot;Entry point for launching an IPython kernel.</pre><pre>array([ -inf, 0., 0.69314718, 1.09861229, 1.38629436, 1.60943791,  1.79175947, 1.94591015, 2.07944154, 2.19722458])</pre><h3>12. Vectorization</h3><blockquote>Vectorization is used to speed up the Python code without using a loop.</blockquote><blockquote>Various operations on vectors &amp; matrices can be performed like the dot product, element-wise product etc.</blockquote><blockquote>Vectorized version of <strong>dot product</strong></blockquote><p><strong><em>Code:</em></strong></p><pre>import time</pre><pre>a = np.random.rand(1000000)</pre><pre>b = np.random.rand(1000000)</pre><pre>tic= time.time()</pre><pre>c = np.dot(a,b) #dot product of two vectors</pre><pre>toc = time.time()</pre><pre>print(&quot;Time taken in vectorized version: &quot;+str(1000 * (toc - tic))+&quot; ms&quot;)</pre><p><strong><em>Output:</em></strong></p><pre>Time taken in vectorized version: 1.483917236328125 ms</pre><blockquote>let’s check the <strong>for loop</strong> version of <strong>dot product</strong></blockquote><p><strong><em>Code:</em></strong></p><pre>c = 0</pre><pre>tic = time.time()</pre><pre>for i in range(1000000):<br>  c += a[i] * b[i]</pre><pre>toc = time.time()</pre><pre>print(&quot;Time taken in for loop version: &quot;+str(1000 *(toc - tic)) + &quot; ms&quot;)</pre><p><strong><em>Output:</em></strong></p><pre>Time taken in for loop version: 579.4703960418701 ms</pre><blockquote>So basically the takeaway from the above analysis is that <strong>Vectorization</strong> is way more powerful and efficient than simple <strong>for loop</strong>. It takes very less time. So whenever possible avoid explicit <strong>for loops.</strong></blockquote><h3>13. Conclusion</h3><blockquote>I have tried my best to give you a comprehensive introduction to NumPy.</blockquote><blockquote>Linear Algebra becomes a cakewalk with this package.</blockquote><blockquote>NumPy is a fundamental package for scientific computation &amp; mathematical operations in python.</blockquote><blockquote>NumPy is way more powerful than Lists.</blockquote><h3>14. Github Repository</h3><blockquote>Go ahead and check out my GitHub repository for full code access.</blockquote><blockquote>Here is a link to my Medium Articles GitHub repository:</blockquote><p><a href="https://github.com/shubhanshu1995/My-Medium-Articles">shubhanshu1995/My-Medium-Articles</a></p><blockquote>Here is a direct link to my NumPy Jupyter Notebook containing all the codes snippets used in this article :-</blockquote><p><a href="https://github.com/shubhanshu1995/My-Medium-Articles/blob/master/A_Comprehensive_Guide_to_NumPy.ipynb">shubhanshu1995/My-Medium-Articles</a></p><h3>15. References</h3><p><a href="https://numpy.org/devdocs/user/quickstart.html">NumPy quickstart - NumPy v1.23.dev0 Manual</a></p><h3>16. Suggested Reading</h3><blockquote>If you are interested in learning CS Fundamentals. If you are curious about learning Data Structures &amp; Algorithms, then do check out my first blog on Heap Sort Algorithm.</blockquote><p><a href="https://medium.com/@shubhanshu1995/heap-sort-explained-with-c-implementation-85e4fe3f5279">Heap Sort Explained with C++ implementation</a></p><blockquote>Thank you for reading this article.</blockquote><blockquote>Leave a comment below if you have any questions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1de680b811d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/numpy-the-king-of-scientific-computing-with-python-d1de680b811d">NumPy — The King of Scientific Computing with Python</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Heap Sort Explained with C++ implementation]]></title>
            <link>https://medium.com/@shubhanshu1995/heap-sort-explained-with-c-implementation-85e4fe3f5279?source=rss-fdb7ff8da275------2</link>
            <guid isPermaLink="false">https://medium.com/p/85e4fe3f5279</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Shubhanshu Singh]]></dc:creator>
            <pubDate>Sat, 18 Apr 2020 23:10:56 GMT</pubDate>
            <atom:updated>2020-06-23T17:14:51.323Z</atom:updated>
            <content:encoded><![CDATA[<h4>Data Structures and Algorithms</h4><h4>A Comprehensive guide to Heap Sort Algorithm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WmGzf2e0cxtJI9O8" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Hello World !!</h3><p>Welcome to my first blog on medium. I have tried my best to explain the key concepts in detail. I have also added C++ code implementation of Heap Sort. Trust me you’ll learn a lot after going through this article.</p><h4>Enjoy the ride !!</h4><p>In computer science, <strong>heapsort</strong> is a comparison-based sorting algorithm. Before diving deep into the Heap Sort explanation first we’ll learn about array representation of the binary tree.</p><h4>Note: Array index will start from 1 for ease of explanation.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXSh4eiae2AM105muM2zgA.jpeg" /><figcaption>Array representation of a complete binary tree</figcaption></figure><blockquote>If a node is present at index: i</blockquote><blockquote>Node’s left child will be present at index: 2 * i</blockquote><blockquote>Node’s right child will be present at index: ( 2 * i ) + 1</blockquote><blockquote>And Node’s parent is at index: floor( i/2 )</blockquote><blockquote>Now you might be wondering about complete binary tree !!</blockquote><blockquote>According to Wikipedia:</blockquote><blockquote>In a complete binary tree every level, <em>except possibly the last</em>, is completely filled, and all nodes in the last level are as far left as possible.</blockquote><h4>Another definition using array representation:</h4><blockquote>If you represent a binary tree in an array then there should not be any empty locations or gap in between the elements ( from 1st element to the last element )</blockquote><blockquote>Have a look at these diagrams:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xT_PPnoyAkq_4wotUc4hDQ.jpeg" /></figure><h3>Some facts:</h3><blockquote>A Binary Tree with a maximum number of nodes is a Full Binary Tree.</blockquote><blockquote>Every Full Binary Tree is also a Complete Binary Tree.</blockquote><blockquote>A Complete Binary Tree is already a Full Binary Tree up to height h-1.</blockquote><blockquote>Height of a Complete Binary Tree will always be minimum i.e. log(n) because unnecessary we are not going to the next level unless one of the level is completely filled.</blockquote><blockquote>Heap is a Complete Binary Tree</blockquote><blockquote>Let’s talk about different versions of the heap:</blockquote><p><strong>Max Heap</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMJ1SM8jM2DiZcOvpJ9luA.jpeg" /></figure><blockquote>In Max heap, every node is having the value greater than or equal to all its descendants.</blockquote><blockquote>The root will have the maximum value.</blockquote><h3>Min Heap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hp-hFYvyZmc6JfeHxmJedA.jpeg" /></figure><blockquote>In Min Heap, every node is having the element smaller than or equal to all it’s descendants.</blockquote><blockquote>The root will have the minimum value.</blockquote><h3>The procedure of heap sort consists of two steps:</h3><p>For a given set of numbers,</p><ol><li>Create a heap.</li><li>Delete all the elements from the heap.</li></ol><h3>Creating a heap ( A siftUp approach)</h3><p>We don’t need an extra array for heap creation. Within an array, we can form the heap.</p><blockquote>So that’s why it is called as In-Place creation.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FKE2DrLvlu1s0Xzg9tHWrg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWQDI3eWEpuUIwmGAeHn9g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQE5EOAlc30xZ8n33ZwmFw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkgsQCk_mvdkZD9cGVG8cA.jpeg" /></figure><p>Time is equal to the number of swaps. The maximum number of swaps depends on the height of complete binary tree i.e. <strong><em>O( log(n) ).</em></strong></p><p>So for n elements insertion, total time taken is <strong><em>O(nlog(n)).</em></strong></p><blockquote>Complete binary tree height ranges from <strong>O(1) to O( log(n) ).</strong></blockquote><p>As you can see element moves from leaf towards the root.</p><blockquote>The direction of adjustment is upwards.</blockquote><h3>Deleting from heap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5RfTL_Tb1TTmOr7LFFpAw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EPARVXWikxd3U1ctxULHtg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKUoGOOv26Tl9-wX2Wg2SA.jpeg" /></figure><p>Always root element gets deleted from the heap. Other elements deletion will disturb the complete binary tree property.</p><p>Last leaf node replaces the root element.</p><p>As you can see element moves from root to leaf.</p><blockquote>The direction of adjustment is downwards.</blockquote><p>So for deleting n elements one by one, total time taken is <strong><em>O(nlog(n)).</em></strong></p><blockquote>Total time taken for heap sort is O(nlogn)</blockquote><h3>Let’s Code Heap Sort in C++</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6f84c36bf101123dd01ec06b5695d0c/href">https://medium.com/media/d6f84c36bf101123dd01ec06b5695d0c/href</a></iframe><h3>Heapify ( A siftDown approach)</h3><blockquote>A faster method for creating a heap</blockquote><blockquote>Total time taken for heapify is O(n)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5x-mEvwxQ8aHkdtYeBFfw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lG31IiYKvTj3OLADVEOsnA.jpeg" /></figure><p>Heapify is a <strong><em>siftDown</em></strong> approach. Time is less because the total work done is less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Q5BO1N9qDf5iH8xPqMxKQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8MuJKQ5dXhgng7nr_gk1A.jpeg" /></figure><h3>Let’s Code Heapify function in C++</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/edfe045585be9f12a38abb29a48784e1/href">https://medium.com/media/edfe045585be9f12a38abb29a48784e1/href</a></iframe><h3>Summary:</h3><p>Heap Sort is a sum of two stages:</p><ol><li><strong><em>O(n)</em></strong> time complexity for heap creation ( using heapify )</li><li><strong><em>O(nlog(n))</em></strong> time complexity for deletion of nodes one by one</li></ol><blockquote>Total time taken :</blockquote><blockquote><strong>n + nlog(n) = O(nlog(n))</strong></blockquote><h3>Resources</h3><p>I referred the following resources for my understanding and found it very useful. Have a look at these awesome resources if you’re interested in learning more about heap sort.</p><ol><li><a href="https://youtu.be/B7hVxCmfPtM">Heaps and Heap Sort</a>, Professor Srini Devadas, MIT OpenCourseWare</li><li><a href="https://youtu.be/HqPJF2L5h9U">Heap — Heap Sort — Heapify — Priority Queues</a>, Professor Abdul Bari</li><li><a href="https://youtu.be/2DmK_H7IdTo">Heap Sort in 4 minutes</a>, Michael Sambol</li><li><a href="https://en.wikipedia.org/wiki/Heapsort">HeapSort</a>, Wikipedia</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UQqw6MQv5o1Il9m7" /><figcaption>Photo by <a href="https://unsplash.com/@adigold1?utm_source=medium&amp;utm_medium=referral">Adi Goldstein</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Thank you for reading this article! Leave a comment below if you have any questions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85e4fe3f5279" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>