<?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 YashNagare on Medium]]></title>
        <description><![CDATA[Stories by YashNagare on Medium]]></description>
        <link>https://medium.com/@yashpnagare?source=rss-e4502b942d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xkvZb4OFLzqTTFfR</url>
            <title>Stories by YashNagare on Medium</title>
            <link>https://medium.com/@yashpnagare?source=rss-e4502b942d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 12:14:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yashpnagare/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[Split Your Dataset With scikit-learn’s train_test_split()]]></title>
            <link>https://pub.towardsai.net/split-your-dataset-with-scikit-learns-train-test-split-b666285e5e23?source=rss-e4502b942d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b666285e5e23</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[scikit-learn]]></category>
            <dc:creator><![CDATA[YashNagare]]></dc:creator>
            <pubDate>Mon, 22 Nov 2021 11:26:23 GMT</pubDate>
            <atom:updated>2021-11-22T11:26:23.497Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsai.net/p/category/machine-learning">Machine Learning</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pcM5EKgpINOUDDxU" /><figcaption>Photo by <a href="https://unsplash.com/@isaacmsmith?utm_source=medium&amp;utm_medium=referral">Isaac Smith</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Model evaluation and validation are important parts of supervised machine learning. It aids in the selection of the best model to represent our data as well as the prediction of how well that model will perform in the future.</p><p>To predict this model we need to split this model dataset into training and testing data. Manually splitting out this data is difficult because of the large size of datasets and data needs to be shuffled.</p><p>For making this task easier we will use Scikit-learn’s train_test_split() module, which will split our data into training and testing sets.</p><h3>Installation of Scikit-Learn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nOzSiMQceaMhWyuo" /><figcaption>Photo by <a href="https://unsplash.com/@lunarts?utm_source=medium&amp;utm_medium=referral">Volodymyr Hryshchenko</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Installing Scikit-learn using pip :</strong></p><pre>$ pip install -U scikit-learn</pre><p><strong>Installing Scikit-learn using conda :</strong></p><pre>$ conda install -c anaconda scikit-learn=0.24</pre><h3>Importing Library —</h3><pre>&gt;&gt;&gt; from <strong>sklearn.model_selection</strong> import <strong>train_test_split</strong></pre><h3>Getting Started —</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_v7Ce0hghRm9VlHL" /><figcaption>Photo by <a href="https://unsplash.com/@dtopkin1?utm_source=medium&amp;utm_medium=referral">Dayne Topkin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Syntax -</h4><pre><em>train_test_split(*arrays, test_size=None, train_size=None, random_state=None, shuffle=True, stratify=None)</em></pre><h4><strong>Parameters -</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d0gwk9yD50fwd9lN" /><figcaption>Photo by <a href="https://unsplash.com/@sapegin?utm_source=medium&amp;utm_medium=referral">Artem Sapegin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>arrays</strong> - The data you want to split is held in a sequence of lists, NumPy arrays, pandas DataFrames, or other array-like objects called arrays. The dataset is made up of all of these objects, and they must all be of the same length.</p><p><strong>train_size - </strong>The size of the training dataset is determined by this option. None, which is the default. Int, which requires the precise number of samples and float, which goes from 0.1 to 1.0, are the three alternatives.</p><p><strong>test_size - </strong>This parameter specifies the testing dataset size. If the training size is set to default the <strong>test_size</strong> will be set to <strong>0.25</strong>.</p><p><strong>random_state - </strong>This parameter specifies random split of data using np.random or int.</p><p><strong>shuffle - </strong>Shuffle has the Boolean value (<em>default=True</em>). This determines whether data should be shuffled or not.</p><p><strong>stratify - </strong>It is an array-like object(<em>default=None</em>). If stratify is not any then it determines how to use stratified split of data.</p><p>Now it’s time to put your data splitting skills to the test! To begin, you’ll need to create a simple dataset to work with. The inputs will be in a two-dimensional array <strong>X</strong>, while the outputs will be in a one-dimensional array <strong>y</strong> in the dataset.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C%2B184%252C%2B195%252C%2B1%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D0px%26ph%3D0px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D117%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%25253E%25253E%25253E%252520import%252520numpy%252520as%252520np%25250A%25253E%25253E%25253E%252520from%252520sklearn.model_selection%252520import%252520train_test_split%25250A%25250A%25253E%25253E%25253E%252520X%25252Cy%252520%25253D%252520np.arange%252820%2529.reshape%2528%252810%25252C%2525202%2529%2529%25252C%252520range%252810%2529%25250A%25253E%25253E%25253E%252520X%25250Aarray%2528%25255B%25255B%2525200%25252C%252520%2525201%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525202%25252C%252520%2525203%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525204%25252C%252520%2525205%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525206%25252C%252520%2525207%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525208%25252C%252520%2525209%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B10%25252C%25252011%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B12%25252C%25252013%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B14%25252C%25252015%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B16%25252C%25252017%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B18%25252C%25252019%25255D%25255D%2529%25250A%25253E%25253E%25253E%252520list%2528y%2529%25250A%25255B0%25252C%2525201%25252C%2525202%25252C%2525203%25252C%2525204%25252C%2525205%25252C%2525206%25252C%2525207%25252C%2525208%25252C%2525209%25255D&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C%2B184%25252C%2B195%25252C%2B1%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D0px%26ph%3D0px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D117%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%2525253E%2525253E%2525253E%25252520import%25252520numpy%25252520as%25252520np%2525250A%2525253E%2525253E%2525253E%25252520from%25252520sklearn.model_selection%25252520import%25252520train_test_split%2525250A%2525250A%2525253E%2525253E%2525253E%25252520X%2525252Cy%25252520%2525253D%25252520np.arange%25252820%252529.reshape%252528%25252810%2525252C%252525202%252529%252529%2525252C%25252520range%25252810%252529%2525250A%2525253E%2525253E%2525253E%25252520X%2525250Aarray%252528%2525255B%2525255B%252525200%2525252C%25252520%252525201%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525202%2525252C%25252520%252525203%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525204%2525252C%25252520%252525205%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525206%2525252C%25252520%252525207%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525208%2525252C%25252520%252525209%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B10%2525252C%2525252011%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B12%2525252C%2525252013%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B14%2525252C%2525252015%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B16%2525252C%2525252017%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B18%2525252C%2525252019%2525255D%2525255D%252529%2525250A%2525253E%2525253E%2525253E%25252520list%252528y%252529%2525250A%2525255B0%2525252C%252525201%2525252C%252525202%2525252C%252525203%2525252C%252525204%2525252C%252525205%2525252C%252525206%2525252C%252525207%2525252C%252525208%2525252C%252525209%2525255D&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9f32bb5c0d5463d3c24dc194d37b826/href">https://medium.com/media/f9f32bb5c0d5463d3c24dc194d37b826/href</a></iframe><p>We had used the NumPy library to generate the dataset. arange() will return evenly spaced values within a specified interval and .reshape() will change the shape of the array without changing its data.</p><p><a href="https://medium.com/@yashpnagare/a-complete-guide-on-numpy-for-machine-learning-fd4ec1f168b7">A complete guide on NumPy for Machine Learning</a></p><p>With a single function call, you can split both the input and output datasets.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C%2B184%252C%2B195%252C%2B1%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D0px%26ph%3D0px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D12.5px%26lh%3D114%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%25253E%25253E%25253E%252520X_train%25252C%252520X_test%25252C%252520y_train%25252C%252520y_test%252520%25253D%252520train_test_split%2528%25250A...%252520%252520%252520%252520X%25252C%252520y%25252C%252520test_size%25253D0.2%25252C%252520random_state%25253D42%2529%25250A%25253E%25253E%25253E%252520X_train%25250Aarray%2528%25255B%25255B10%25252C%25252011%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525200%25252C%252520%2525201%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B14%25252C%25252015%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525204%25252C%252520%2525205%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B18%25252C%25252019%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525208%25252C%252520%2525209%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525206%25252C%252520%2525207%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B12%25252C%25252013%25255D%25255D%2529%25250A%25253E%25253E%25253E%252520y_train%25250A%25255B5%25252C%2525200%25252C%2525207%25252C%2525202%25252C%2525209%25252C%2525204%25252C%2525203%25252C%2525206%25255D%25250A%25253E%25253E%25253E%252520X_test%25250Aarray%2528%25255B%25255B16%25252C%25252017%25255D%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%25255B%2525202%25252C%252520%2525203%25255D%25255D%2529%25250A%25253E%25253E%25253E%252520y_test%25250A%25255B8%25252C%2525201%25255D%25250A%25253E%25253E%25253E&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C%2B184%25252C%2B195%25252C%2B1%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D0px%26ph%3D0px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D12.5px%26lh%3D114%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3D%2525253E%2525253E%2525253E%25252520X_train%2525252C%25252520X_test%2525252C%25252520y_train%2525252C%25252520y_test%25252520%2525253D%25252520train_test_split%252528%2525250A...%25252520%25252520%25252520%25252520X%2525252C%25252520y%2525252C%25252520test_size%2525253D0.2%2525252C%25252520random_state%2525253D42%252529%2525250A%2525253E%2525253E%2525253E%25252520X_train%2525250Aarray%252528%2525255B%2525255B10%2525252C%2525252011%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525200%2525252C%25252520%252525201%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B14%2525252C%2525252015%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525204%2525252C%25252520%252525205%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B18%2525252C%2525252019%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525208%2525252C%25252520%252525209%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525206%2525252C%25252520%252525207%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B12%2525252C%2525252013%2525255D%2525255D%252529%2525250A%2525253E%2525253E%2525253E%25252520y_train%2525250A%2525255B5%2525252C%252525200%2525252C%252525207%2525252C%252525202%2525252C%252525209%2525252C%252525204%2525252C%252525203%2525252C%252525206%2525255D%2525250A%2525253E%2525253E%2525253E%25252520X_test%2525250Aarray%252528%2525255B%2525255B16%2525252C%2525252017%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525255B%252525202%2525252C%25252520%252525203%2525255D%2525255D%252529%2525250A%2525253E%2525253E%2525253E%25252520y_test%2525250A%2525255B8%2525252C%252525201%2525255D%2525250A%2525253E%2525253E%2525253E&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/22688e2add65c3b4fde20b569a961c2a/href">https://medium.com/media/22688e2add65c3b4fde20b569a961c2a/href</a></iframe><p>train_test_split() performs splitting of data and returns the four sequences of NumPy array in this order:</p><ol><li>X_train - The training part of the X sequence</li><li>y_train - The training part of the y sequence</li><li>X_test - The testing part of the X sequence</li><li>y_test - The testing part of the y sequence</li></ol><pre><strong>&gt;&gt;&gt;</strong> train_test_split(y, shuffle=True)<br>[[4, 0, 6, 2, 5, 9, 3], [1, 7, 8]]<br><strong>&gt;&gt;&gt;</strong></pre><p>The samples of the dataset are shuffled randomly and then split data into training and testing sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1A_U8JQMqytRGHVY" /><figcaption>Photo by <a href="https://unsplash.com/@alx_andru?utm_source=medium&amp;utm_medium=referral">Alex</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Conclusion</h3><p>You now understand why and how to utilize sklearn’s train_test_split() function and various parameters which are used in it. You can now use your data to train, validate, and test as many machine learning models as you want.</p><h3>Before you go</h3><p>I welcome you to<strong> join me on this journey!</strong> Follow this <a href="https://medium.com/@yashpnagare">Medium </a>page to stay in the loop of more exciting Data Science/Python content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b666285e5e23" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/split-your-dataset-with-scikit-learns-train-test-split-b666285e5e23">Split Your Dataset With scikit-learn’s train_test_split()</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[8 Interesting Facts About Python Programming Language]]></title>
            <link>https://pub.towardsai.net/8-interesting-facts-about-python-programming-language-ff8ccba88cad?source=rss-e4502b942d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff8ccba88cad</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[interesting-facts]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[YashNagare]]></dc:creator>
            <pubDate>Sun, 14 Nov 2021 16:22:29 GMT</pubDate>
            <atom:updated>2021-11-14T16:22:29.718Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsai.net/p/category/programming">Programming</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2Jp7fn0wwCszl2ut" /><figcaption>Photo by <a href="https://unsplash.com/@timothycdykes?utm_source=medium&amp;utm_medium=referral">Timothy Dykes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Python is a programming language created by Guido Van Rossum that has quickly risen to become one of the most popular in the world. It is well-known for having code that is both readable and simple.</p><p>Many companies have started using Python for a variety of projects, so let’s check out 8 interesting facts about Python!</p><h3>Table of contents</h3><ol><li><a href="#3781">Why is it called ‘Python’?</a></li><li><a href="#ad1a">Poem written about Python Programming</a></li><li><a href="#f8a9">Python has overtaken French in primary schools</a></li><li><a href="#43b6">There are C and Java variants in Python</a></li><li><a href="#33d0">Python does not require a compiler</a></li><li><a href="#a41e">Python is one of Google’s official programming languages</a></li><li><a href="#1ff0">Python is similar to English</a></li><li><a href="#49c1">Wide range of aspects</a></li></ol><h3>1. Why is it called ‘Python’?</h3><p>While many people assume the name Python Programming comes from something related to the Python snake, it actually comes from the TV comedy series ‘<strong><em>Monty Python’s Flying Circus</em></strong>.’ This series broadcast on the BBC channel in the United Kingdom in the 1970s and was a favorite of Guido Van Rossum’s. Because it was short, cryptic, and included the name of his favorite TV comedy show, he chose the name ‘Python.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjzRVOyNL_AP_ZfRT0OfOw.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@divinetechygirl?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Christina Morillo</a> from <a href="https://www.pexels.com/photo/python-book-1181671/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><h3>2. Poem Written about Python Programming</h3><p>Believe it or not, a man named Tim Peters composed a poem called ‘<strong><em>The Zen of Python</em></strong>’ about Python programming. Simply type ‘import this’ into an interpreter to read this poetry.It’s a fascinating and entertaining poetry that you should read for yourself.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C%2B184%252C%2B195%252C%2B1%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dfalse%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D0px%26ph%3D0px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D12px%26lh%3D141%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%252520this%25250AThe%252520Zen%252520of%252520Python%25252C%252520by%252520Tim%252520Peters%25250A%25250ABeautiful%252520is%252520better%252520than%252520ugly.%25250AExplicit%252520is%252520better%252520than%252520implicit.%25250ASimple%252520is%252520better%252520than%252520complex.%25250AComplex%252520is%252520better%252520than%252520complicated.%25250AFlat%252520is%252520better%252520than%252520nested.%25250ASparse%252520is%252520better%252520than%252520dense.%25250AReadability%252520counts.%25250ASpecial%252520cases%252520aren%2527t%252520special%252520enough%252520to%252520break%252520the%252520rules.%25250AAlthough%252520practicality%252520beats%252520purity.%25250AErrors%252520should%252520never%252520pass%252520silently.%25250AUnless%252520explicitly%252520silenced.%25250AIn%252520the%252520face%252520of%252520ambiguity%25252C%252520refuse%252520the%252520temptation%252520to%252520guess.%25250AThere%252520should%252520be%252520one--%252520and%252520preferably%252520only%252520one%252520--obvious%252520way%252520to%252520do%252520it.%25250AAlthough%252520that%252520way%252520may%252520not%252520be%252520obvious%252520at%252520first%252520unless%252520you%2527re%252520Dutch.%25250ANow%252520is%252520better%252520than%252520never.%25250AAlthough%252520never%252520is%252520often%252520better%252520than%252520%252Aright%252A%252520now.%25250AIf%252520the%252520implementation%252520is%252520hard%252520to%252520explain%25252C%252520it%2527s%252520a%252520bad%252520idea.%25250AIf%252520the%252520implementation%252520is%252520easy%252520to%252520explain%25252C%252520it%252520may%252520be%252520a%252520good%252520idea.%25250ANamespaces%252520are%252520one%252520honking%252520great%252520idea%252520--%252520let%2527s%252520do%252520more%252520of%252520those%2521%25250A&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C%2B184%25252C%2B195%25252C%2B1%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dfalse%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D0px%26ph%3D0px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D12px%26lh%3D141%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%25252520this%2525250AThe%25252520Zen%25252520of%25252520Python%2525252C%25252520by%25252520Tim%25252520Peters%2525250A%2525250ABeautiful%25252520is%25252520better%25252520than%25252520ugly.%2525250AExplicit%25252520is%25252520better%25252520than%25252520implicit.%2525250ASimple%25252520is%25252520better%25252520than%25252520complex.%2525250AComplex%25252520is%25252520better%25252520than%25252520complicated.%2525250AFlat%25252520is%25252520better%25252520than%25252520nested.%2525250ASparse%25252520is%25252520better%25252520than%25252520dense.%2525250AReadability%25252520counts.%2525250ASpecial%25252520cases%25252520aren%252527t%25252520special%25252520enough%25252520to%25252520break%25252520the%25252520rules.%2525250AAlthough%25252520practicality%25252520beats%25252520purity.%2525250AErrors%25252520should%25252520never%25252520pass%25252520silently.%2525250AUnless%25252520explicitly%25252520silenced.%2525250AIn%25252520the%25252520face%25252520of%25252520ambiguity%2525252C%25252520refuse%25252520the%25252520temptation%25252520to%25252520guess.%2525250AThere%25252520should%25252520be%25252520one--%25252520and%25252520preferably%25252520only%25252520one%25252520--obvious%25252520way%25252520to%25252520do%25252520it.%2525250AAlthough%25252520that%25252520way%25252520may%25252520not%25252520be%25252520obvious%25252520at%25252520first%25252520unless%25252520you%252527re%25252520Dutch.%2525250ANow%25252520is%25252520better%25252520than%25252520never.%2525250AAlthough%25252520never%25252520is%25252520often%25252520better%25252520than%25252520%25252Aright%25252A%25252520now.%2525250AIf%25252520the%25252520implementation%25252520is%25252520hard%25252520to%25252520explain%2525252C%25252520it%252527s%25252520a%25252520bad%25252520idea.%2525250AIf%25252520the%25252520implementation%25252520is%25252520easy%25252520to%25252520explain%2525252C%25252520it%25252520may%25252520be%25252520a%25252520good%25252520idea.%2525250ANamespaces%25252520are%25252520one%25252520honking%25252520great%25252520idea%25252520--%25252520let%252527s%25252520do%25252520more%25252520of%25252520those%252521%2525250A&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ecba870087d91945d3530b5b1e356eda/href">https://medium.com/media/ecba870087d91945d3530b5b1e356eda/href</a></iframe><h3>3. Python has overtaken French in primary schools</h3><p>Doesn’t this one sound funny? Believe it or not, Python surpassed French as the most popular primary school language in 2015. Statistics show that 60% parents would prefer their children to learn Python than French. This shows that the importance of Python programming was acknowledged by a vast number of people. According to the same figures, 75 % of children in primary school would rather learn how to manage a robot than learn French.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VbrS270Sh--MZCPa" /><figcaption>Photo by <a href="https://unsplash.com/@bermixstudio?utm_source=medium&amp;utm_medium=referral">Bermix Studio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>4. There are C and Java Variants in Python</h3><p>Python offers variations for the C and Java programming languages, despite being a self-contained programming language. The C derivative, known as CPython, was built to give Python the benefits of C. One of these criteria is performance. The variation can be used as an interpreter as well as a compiler.</p><p>Jython is Python’s Java implementation. It allows some of Java’s most important features, such as productivity, to run on a virtual machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pGjiX0tPmTG9pCHD" /><figcaption>Photo by <a href="https://unsplash.com/@robowunderkind?utm_source=medium&amp;utm_medium=referral">Robo Wunderkind</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>5. Python does not require a compiler</h3><p>Python is a high-level, interpreted language that does not require a compiler, unlike other programming languages such as Java and C++.Python code is stored in a .pyc file, which serves as the Python engine and eliminates the need for a compiler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8pYQ6VdASZIJntvr" /><figcaption>Photo by <a href="https://unsplash.com/@eikosipente?utm_source=medium&amp;utm_medium=referral">Giannis Skarlatos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>6. Python is one of Google’s official programming languages</h3><p>Python is one of the few programming languages that has been designated as an official Google language. Python became one of Google’s official programming languages due of its efficiency. It was advantageous to them because it is simple to use, even on large projects. Even YouTube is powered by Python programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VzftYEv9aLVk4WPv" /><figcaption>Photo by <a href="https://unsplash.com/@esen_aza?utm_source=medium&amp;utm_medium=referral">Azamat E</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>7. Python is similar to English</h3><p>Many people claim that Python is a simple language to learn. The fundamental reason for this claim is that Python is more similar to English than other programming languages. It’s simple to figure out what each line of code accomplishes. Everything is simple and straightforward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yowCVtNlFr3STCZ4" /><figcaption>Photo by <a href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>8. Wide range of aspects</h3><p>Python is a general-purpose programming language. In fact, it can be used in a wide range of coding scenarios like web development, artificial intelligence, machine learning, data analytics, internet of things and many more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zeicTXcd17WQrz99" /><figcaption>Photo by <a href="https://unsplash.com/@askkell?utm_source=medium&amp;utm_medium=referral">Andy Kelly</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Conclusion</h3><p>Overall, Python programming has grown in popularity among people of all ages and industries. It is a top-notch programming language that allows it to be both dynamic and effective, making it the language of choice today.</p><h3>Before you go</h3><p>I welcome you to<strong> join with me on these journey!</strong> Follow this <a href="https://medium.com/@yashpnagare">Medium </a>page to stay in the loop of more exciting Data Science/Python content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff8ccba88cad" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/8-interesting-facts-about-python-programming-language-ff8ccba88cad">8 Interesting Facts About Python Programming Language</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A complete guide on NumPy for Machine Learning]]></title>
            <link>https://medium.com/geekculture/a-complete-guide-on-numpy-for-machine-learning-fd4ec1f168b7?source=rss-e4502b942d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd4ec1f168b7</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[numpy]]></category>
            <dc:creator><![CDATA[YashNagare]]></dc:creator>
            <pubDate>Tue, 19 Oct 2021 02:43:11 GMT</pubDate>
            <atom:updated>2021-11-22T07:23:45.453Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVzUOf3iHgPdh48xnfXzPg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mohammad Rahmani</a> on <a href="https://unsplash.com/s/photos/coding?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Table of contents</h3><ol><li><a href="http://77d3/">What is NumPy</a></li><li><a href="http://1a3e/">How to install NumPy</a></li><li><a href="http://4b1c/">Getting Started with NumPy</a></li><li><a href="http://92bf/">Array creation routines</a></li><li><a href="http://0.0.13.33/">Array manipulation routines</a></li><li><a href="http://a1ea/">Binary Operations</a></li><li><a href="http://e8e8/">Mathematical Functions</a></li><li><a href="http://003a/">Linear algebra</a></li></ol><h3><strong><em>What is NumPy?</em></strong></h3><p>NumPy is a Python library that allows you to work with multidimensional arrays, linear algebra, statistical operations and much more. NumPy also means for <strong>Num</strong>erical <strong>Py</strong>thon. Numpy provides us with a variety of features that simplify the handling of Python data.</p><h3>How to install NumPy?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0epzGsm9tJ9EMtgv" /><figcaption>Photo by <a href="https://unsplash.com/@crissyjarvis?utm_source=medium&amp;utm_medium=referral">Crissy Jarvis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Installing Numpy using pip :</p><pre> pip install numpy</pre><p>Installing Numpy using Anaconda:</p><pre>conda install numpy</pre><h3><strong>Getting Started with NumPy</strong></h3><h4><strong>Importing the library :</strong></h4><pre><strong>&gt;&gt;&gt;</strong> import <strong>numpy</strong> as <strong>np</strong></pre><h4><strong>Basics of NumPy :</strong></h4><p>‣<strong> </strong>Lets create a python list and convert this list into arrays</p><pre><strong>&gt;&gt;&gt;</strong> nums = [[1, 2, 3], [4, 5, 6]]  <em>#2D Python list</em><br><strong>&gt;&gt;&gt;</strong> nums<br>[[1, 2, 3], [4, 5, 6]]</pre><pre><strong>&gt;&gt;&gt;</strong> arr = np.array(nums)  <em>#List converted into array</em><br><strong>&gt;&gt;&gt;</strong> arr<br>array([[1, 2, 3], <br>       [4, 5, 6]])</pre><h3>Array creation routines :</h3><p>‣ <strong>zeros</strong> - returns an array with given shape filled with zeros</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.zeros(5)<br><strong>&gt;&gt;&gt;</strong> arr<br>array([0., 0., 0., 0., 0.])<br><strong>&gt;&gt;&gt;</strong> arr1 = np.zeros((2, 3))<br><strong>&gt;&gt;&gt;</strong> arr1<br>array([[0., 0., 0.], <br>       [0., 0., 0.]])</pre><p>‣ <strong>ones</strong> - returns an array with given shape filled with ones</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.ones(5)<br><strong>&gt;&gt;&gt;</strong> arr<br>array([1., 1., 1., 1., 1.])<br><strong>&gt;&gt;&gt;</strong> arr = np.ones((3, 2))<br>array([[1., 1.], <br>       [1., 1.], <br>       [1., 1.]])</pre><p>‣ <strong>identity</strong> - returns the identity matrix (i.e., array with 1’s on the diagonal)</p><pre><strong>&gt;&gt;&gt;</strong> iden_mat = np.identity(3)<br><strong>&gt;&gt;&gt; </strong>iden_mat<br>array([[1., 0., 0.],<br>       [0., 1., 0.],<br>       [0., 0., 1.]])</pre><p>‣ <strong>eye</strong> - returns 2-D array with 1’s on the diagonal and 0&#39;s elsewhere</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.eye(4)<br><strong>&gt;&gt;&gt;</strong> arr<br>array([[1., 0., 0., 0.],        <br>       [0., 1., 0., 0.],        <br>       [0., 0., 1., 0.],        <br>       [0., 0., 0., 1.]])<br><strong>&gt;&gt;&gt;</strong> arr = np.eye(3, 4)<br><strong>&gt;&gt;&gt;</strong> arr<br>array([[1., 0., 0., 0.],        <br>       [0., 1., 0., 0.],        <br>       [0., 0., 1., 0.]])</pre><p>‣ <strong>diag</strong> - constructs a diagonal array</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.diag([1, 2, 3, 4])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([[1, 0, 0, 0],<br>       [0, 2, 0, 0],<br>       [0, 0, 3, 0],<br>       [0, 0, 0, 4]])</pre><p>‣ <strong>arange</strong> - returns evenly spaced values within a specified interval.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.arange(3, 7)<br><strong>&gt;&gt;&gt;</strong> arr<br>array([3, 4, 5, 6])</pre><p>‣ <strong>linspace</strong> - returns evenly spaced numbers over a specified given range.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.linspace(1, 15, 10)<br><strong>&gt;&gt;&gt;</strong> arr<br>array([ 1.        , 2.55555556, 4.11111111, 5.66666667, 7.22222222, 8.77777778, 10.33333333, 11.88888889, 13.44444444, 15.        ])</pre><h3>Array manipulation routines :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kI9p2uel1gw-TW9a" /><figcaption>Photo by <a href="https://unsplash.com/@bradyn?utm_source=medium&amp;utm_medium=referral">Bradyn Trollip</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>‣ <strong>shape</strong> - returns shape of array.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([[2, 3], [4, 5]])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([[2, 3],<br>       [4, 5]])<br><strong>&gt;&gt;&gt;</strong> arr.shape<br>(2, 2)</pre><p>‣ <strong>reshape </strong>-<strong> </strong>changing shape of the array without changing its data.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([1, 2, 3, 4, 5, 6])<br><strong>&gt;&gt;&gt;</strong> arr.reshape(2, 3)<br>array([[1, 2, 3],<br>       [4, 5, 6]])</pre><p>‣ <strong>ravel -</strong> returns the contiguous flattened array</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([[1, 2, 3], [4, 5, 6]])<br><strong>&gt;&gt;&gt;</strong> np.ravel(arr)<br>array([1, 2, 3, 4, 5, 6])</pre><h3>Binary operations :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z_0trGVsR5a1roPY" /><figcaption>Photo by <a href="https://unsplash.com/@d_kah?utm_source=medium&amp;utm_medium=referral">d kah</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>‣ <strong>bitwise_and</strong> - compute bitwise AND operation of two array element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.bitwise_and([10,7], [14,20])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([10,  4], dtype=int32)</pre><p>‣ <strong>bitwise_or</strong> - compute bitwise OR operation of two array element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.bitwise_or([10,7], [14,20])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([14, 23], dtype=int32)</pre><p>‣ <strong>bitwise_xor</strong> - compute bitwise XOR operation of two array element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.bitwise_xor([10,7], [14,20])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([ 4, 19], dtype=int32)</pre><h3>Mathematical functions :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Tahbf73HCPGUWcA1" /><figcaption>Photo by <a href="https://unsplash.com/@jeswinthomas?utm_source=medium&amp;utm_medium=referral">Jeswin Thomas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4><strong>1. Trigonometric functions</strong></h4><p>‣ <strong>sin -</strong> trigonometric sine element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([2, 80, 1, 97])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([ 2, 80,  1, 97])<br><strong>&gt;&gt;&gt;</strong> np.sin(arr)<br>array([ 0.90929743, -0.99388865,  0.84147098,  0.37960774])</pre><p>‣ <strong>cos -</strong> trigonometric cosine element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([4, 8, 10, 90])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([ 4,  8, 10, 90])<br><strong>&gt;&gt;&gt;</strong> np.cos(arr)<br>array([-0.65364362, -0.14550003, -0.83907153, -0.44807362])</pre><p>‣ <strong>tan - </strong>compute<strong> </strong>trigonometric tangent element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([14, 1, 20, 9])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([14,  1, 20,  9])<br><strong>&gt;&gt;&gt;</strong> np.tan(arr)<br>array([ 7.24460662,  1.55740772,  2.23716094, -0.45231566])</pre><h4>2. Hyperbolic functions</h4><p>‣ <strong>sinh - </strong>Hyperbolic sine element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([2, 80, 1, 97])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([ 2, 80,  1, 97])<br><strong>&gt;&gt;&gt;</strong> np.sinh(arr)<br>array([3.62686041e+00, 2.77031119e+34, 1.17520119e+00, 6.69167360e+41])</pre><p>‣ <strong>cosh - </strong>Hyperbolic cosine element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([4, 8, 10, 90])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([ 4,  8, 10, 90])<br><strong>&gt;&gt;&gt;</strong> np.cosh(arr)<br>array([2.73082328e+01, 1.49047916e+03, 1.10132329e+04, 6.10201647e+38])</pre><p>‣ <strong>tanh - </strong>Hyperbolic tangent element-wise.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([14, 1, 20, 9])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([14,  1, 20,  9])<br><strong>&gt;&gt;&gt;</strong> np.tanh(arr)<br>array([1.        , 0.76159416, 1.        , 0.99999997])</pre><h4>3. Miscellaneous functions</h4><p>Consider this array array([2, 80, 1, 97, 5]) for following concepts</p><p>‣ <strong>min - </strong>returns the minimum element of array.</p><pre><strong>&gt;&gt;&gt;</strong> np.min(arr)<br>1</pre><p>‣ <strong>max - </strong>returns the maximum element of array.</p><pre><strong>&gt;&gt;&gt;</strong> np.max(arr)<br>97</pre><p>‣ <strong>argmin - </strong>returns indices of min element.</p><pre><strong>&gt;&gt;&gt;</strong> np.argmin(arr)<br>2</pre><p>‣ <strong>argmax - </strong>returns indices of max element.</p><pre><strong>&gt;&gt;&gt;</strong> np.argmax(arr)<br>3</pre><p>‣ <strong>sqrt - </strong>returns square root of an array.</p><pre><strong>&gt;&gt;&gt;</strong> np.sqrt(arr)<br>array([1.41421356, 8.94427191, 1.        , 9.8488578 , 2.23606798])</pre><p>‣ <strong>exp - </strong>returns the exponential of all elements.</p><pre><strong>&gt;&gt;&gt;</strong> np.exp(arr)<br>array([7.38905610e+00, 5.54062238e+34, 2.71828183e+00, 1.33833472e+42, 1.48413159e+02])</pre><h3>Linear algebra :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L5uL7DS_BGEqh4la" /><figcaption>Photo by <a href="https://unsplash.com/@wimvanteinde?utm_source=medium&amp;utm_medium=referral">Wim van &#39;t Einde</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>‣ <strong>rank - </strong>returns rank of array.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.arange(1, 10).reshape(3, 3)  <em>#consider this array</em><br><strong>&gt;&gt;&gt;</strong> arr                                   <em>#for below concepts </em><br>array([[1, 2, 3], <br>       [4, 5, 6],<br>       [7, 8, 9]])<br><strong>&gt;&gt;&gt;</strong> rank = np.linalg.matrix_rank(arr)<br><strong>&gt;&gt;&gt;</strong> rank<br>2</pre><p>‣ <strong>trace</strong> <strong>- </strong>returns the trace of an array.</p><pre><strong>&gt;&gt;&gt;</strong> trace = np.trace(arr)<br><strong>&gt;&gt;&gt;</strong> trace<br>11</pre><p>‣ <strong>det- </strong>compute determinant of an array.</p><pre><strong>&gt;&gt;&gt;</strong> det = np.linalg.det(arr)<br><strong>&gt;&gt;&gt;</strong> det<br>-306.0</pre><p>‣ <strong>inv - </strong>compute inverse of an matrix.</p><pre><strong>&gt;&gt;&gt;</strong> inv = np.linalg.inv(arr)<br><strong>&gt;&gt;&gt;</strong> inv<br>array([[ 0.17647059, -0.00326797, -0.02287582],<br>       [ 0.05882353, -0.13071895,  0.08496732],<br>       [-0.11764706,  0.1503268 ,  0.05228758]])</pre><p>‣ <strong>power - </strong>computes power of all elements in the array.</p><pre><strong>&gt;&gt;&gt;</strong> mat_pow = np.linalg.matrix_power(arr, 3)<br><strong>&gt;&gt;&gt;</strong> mat_pow<br>array([[336, 162, 228],<br>       [406, 162, 469],<br>       [698, 702, 905]])</pre><p>‣ <strong>eigh - </strong>computes eigen values of array.</p><pre><strong>&gt;&gt;&gt;</strong> arr = np.array([[1, -2j], [2j, 5]])<br><strong>&gt;&gt;&gt;</strong> arr<br>array([[ 1.+0.j, -0.-2.j],<br>       [ 0.+2.j,  5.+0.j]])<br><strong>&gt;&gt;&gt;</strong> eg1, eg2 = np.linalg.eigh(arr)<br><strong>&gt;&gt;&gt;</strong> eg1<br>array([0.17157288, 5.82842712])<br><strong>&gt;&gt;&gt;</strong> eg2<br>array([[-0.92387953+0.j, -0.38268343+0.j],<br>       [ 0.+0.38268343j,  0.-0.92387953j]])</pre><p>‣ <strong>dot - </strong>returns<strong> </strong>dot product of two array.</p><pre>&gt;&gt;&gt; vector_a = 2 + 3j<br>&gt;&gt;&gt; vector_b = 4 + 5j<br>&gt;&gt;&gt; product = np.dot(vector_a, vector_b)<br>&gt;&gt;&gt; product<br>(-7+22j)</pre><p>‣ <strong>vdot - </strong>returns<strong> </strong>dot product of two vectors.</p><pre>&gt;&gt;&gt; vector_a = 2 + 3j<br>&gt;&gt;&gt; vector_b = 4 + 5j<br>&gt;&gt;&gt; product = np.vdot(vector_a, vector_b)<br>&gt;&gt;&gt; product<br>(23-2j)</pre><h3>Conclusion</h3><p>This article explains what a Numpy array is and how to use it, as well as its various functions and strategies.I hope you enjoy my work. Please feel free to share, discuss, and express your thoughts and opinions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z30PFsS-GsgB4MYS" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd4ec1f168b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/a-complete-guide-on-numpy-for-machine-learning-fd4ec1f168b7">A complete guide on NumPy for Machine Learning</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>