{"id":4502,"date":"2020-09-28T14:59:54","date_gmt":"2020-09-28T09:29:54","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=4502"},"modified":"2021-06-14T15:00:21","modified_gmt":"2021-06-14T09:30:21","slug":"numpy-divide","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/numpy-divide\/","title":{"rendered":"Numpy Divide | How to Use Numpy.divide() Function in Python"},"content":{"rendered":"\n<p>The <strong>Numpy <\/strong>divide function is a part of numpy arithmetic operations. There are basic arithmetic operators available in the numpy module, which are <a href=\"http:\/\/www.pythonpool.com\/numpy-add\/\" target=\"_blank\" rel=\"noreferrer noopener\">add<\/a>, <a href=\"http:\/\/www.pythonpool.com\/numpy-subtract\/\" target=\"_blank\" rel=\"noreferrer noopener\">subtract<\/a>, <a href=\"http:\/\/www.pythonpool.com\/numpy-multiply\/\" target=\"_blank\" rel=\"noreferrer noopener\">multiply<\/a>, and divide. The significance of the python divide is equivalent to the division operation in mathematics.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#What_does_Numpy_Divide_Function_do\" >What does Numpy Divide Function do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Syntax_of_Numpy_Divide\" >Syntax of Numpy Divide<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Parameters_of_Numpy_Divide\" >Parameters of Numpy Divide<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Return_Value_of_Numpy_Divide\" >Return Value of Numpy Divide<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Examples_of_Numpy_Divide_Function\" >Examples of Numpy Divide Function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Example_1_Using_Npdivide_Function_To_Find_Division_of_two_numbers\" >Example 1: Using Np.divide() Function To Find Division of two numbers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Explanation\" >Explanation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Example_2_Using_NpDivide_Function_to_find_the_division_between_two_input_arrays\" >Example 2: Using Np.Divide() Function to find the division between two input arrays<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Explanation-2\" >Explanation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Example_3_Using_Npdivide_Function_To_Find_Division_Between_Two_Multi-Dimensional_Arrays\" >Example 3: Using Np.divide() Function To Find Division Between Two Multi-Dimensional Arrays<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Explanation-3\" >Explanation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Can_We_Find_Division_Between_Two_Numpy_Arrays_With_Different_Shapes\" >Can We Find Division Between Two Numpy Arrays With Different Shapes?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Explanation-4\" >Explanation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Whats_Next\" >What\u2019s Next?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_does_Numpy_Divide_Function_do\"><\/span><strong>What does Numpy Divide Function do?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>The numpy divide function calculates the division between the two<\/strong> <strong>arrays. It calculates the division between the two arrays, say a1 and a2, element-wise. The numpy.divide() is a universal function, i.e., supports several parameters that allow you to optimize its work depending on the specifics of the algorithm.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Syntax_of_Numpy_Divide\"><\/span><strong>Syntax of Numpy Divide<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>numpy.divide(a1, a2, \/, out=None, *, where=True, casting=\u2019same_kind\u2019, order=\u2019K\u2019, dtype=None, subok=True&#91;, signature, extobj], ufunc \u2018divide\u2019)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Parameters_of_Numpy_Divide\"><\/span><strong>Parameters of Numpy Divide<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Parameter<\/strong><\/td><td><strong>Mandatory or Not<\/strong><\/td><\/tr><tr><td>a1<\/td><td>Mandatory<\/td><\/tr><tr><td>a2<\/td><td>Mandatory<\/td><\/tr><tr><td>\/<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>out<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>*<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>where<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>casting<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>order<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>dtype<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>subok<\/td><td>Not-Mandatory<\/td><\/tr><tr><td>unfunc<\/td><td>Not-Mandatory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li><em><strong>a1:\u00a0[arrayLike]<\/strong><\/em><br><span><em style=\"font-style: italic;\">1st Input array <\/em><\/span>for calculating the division.<\/li><li>a2:\u00a0[arrayLike]<br>2nd input array for calculating the division.<\/li><li>out:\u00a0[ndarray, None, or tuple of ndarray and None, optional]<br>out will be the location where the result is to be stored. have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned.<\/li><li>where: [array_like, optional]<br>If the value of where is true, it indicates to calculate the unfunc at that position, whereas if the value is false, then<em> it denotes to leave the value in output only.<\/em><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Return_Value_of_Numpy_Divide\"><\/span><strong>Return Value of Numpy Divide<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The divide function returns the\u00a0<strong>division between a1 and a2<\/strong>. The divide() function can be scalar of nd-array. It depends on the a1 and a2. If a1 and a2 are scalar, than numpy.divide() will return a scalar value. Else it will return an nd-array.<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-light-green-cyan-background-color has-text-color has-background\"><strong><em>Note:&nbsp;The input a1 and a2 must be broadcastable to a common shape (which becomes the shape of the output).<\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Examples_of_Numpy_Divide_Function\"><\/span><strong>Examples of Numpy Divide Function<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s go through the examples of Numpy divide() function and see how it works.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_1_Using_Npdivide_Function_To_Find_Division_of_two_numbers\"><\/span>Example 1: Using Np.divide() Function To Find Division of two numbers<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\na1 = 24\na2 = 13\n\nprint (&quot;1st Input number : &quot;, a1) \nprint (&quot;2nd Input number : &quot;, a2) \n\t\ndiv = np.divide(a1, a2) \nprint (&quot;Division of two input number : &quot;, div) \n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1st Input number :  24\r\n2nd Input number :  13\r\nDivision of two input number :  1.8461538461538463<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanation\"><\/span>Explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this simple first example, we just divided two numbers and get the result. Let&#8217;s take a look at each step and know what happens in each stage. First of all, we imported the <strong>numpy module as np<\/strong> it&#8217;s obvious because we are working on the numpy library. After that, we have taken two pre-defined inputs <strong>&#8217;24&#8217;, &#8217;13&#8217;,<\/strong> and stored them in variables <strong>&#8216;a1&#8217;, &#8216;a2&#8217;<\/strong> respectively. We printed our inputs to check whether they are specified properly or not. Then the main part comes where we will find the division between the two numbers.<\/p>\n\n\n\n<p>Herewith the help of the <strong>np.divide()<\/strong> function, we will calculate the division between <strong>a1 and a2<\/strong>. This division operation is identical to what we do in mathematics. <\/p>\n\n\n\n<p>So, we will get the division between the number <strong>24<\/strong> and <strong>13<\/strong> which is <strong>11<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"block-aac8f550-bf59-4d90-9921-f577280e5478\"><span class=\"ez-toc-section\" id=\"Example_2_Using_NpDivide_Function_to_find_the_division_between_two_input_arrays\"><\/span>Example 2: Using Np.Divide() Function to find the division between two input arrays<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\na1 = &#x5B;20, 21, 5, 9]\na2 = &#x5B;13, 17, 6, 11]\n\nprint (&quot;1st Input array : &quot;, a1) \nprint (&quot;2nd Input array : &quot;, a2) \n\t\ndiv = np.divide(a1, a2) \nprint (&quot;Division of two input arrays : &quot;, div) \n<\/pre><\/div>\n\n\n<p id=\"block-b5e9446a-ed31-4a89-b089-bd0dfc5a94ff\"><strong>Output:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n1st Input array :  &#x5B;20, 21, 5, 9]\n2nd Input array :  &#x5B;13, 17, 6, 11]\nDivision of two input arrays :  &#x5B;1.53846154 1.23529412 0.83333333 0.81818182]\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"block-d7baddd8-b75c-444b-a812-bd7c3f157536\"><span class=\"ez-toc-section\" id=\"Explanation-2\"><\/span>Explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>From this example, things get Lil bit tricky; instead of numbers, we have used arrays as our input value.<br> We can now see we have two input arrays a1 &amp; a2 with array inputs  <strong>[20, 21, 5, 9] and [13, 17, 6, 11],<\/strong> respectively. The divide() function will find the division between <strong>a1 &amp; a2 array arguments, element-wise.<\/strong><\/p>\n\n\n\n<p>So, the solution will be an array with the shape equal to input arrays a1 and a2. The division between a1 and a2 will be calculated parallelly, and the result will be stored in the <strong>ad<\/strong> variable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"block-d39205b2-1ea4-4e3b-9eeb-4353f925c56d\"><span class=\"ez-toc-section\" id=\"Example_3_Using_Npdivide_Function_To_Find_Division_Between_Two_Multi-Dimensional_Arrays\"><\/span>Example 3: Using Np.divide() Function To Find Division Between Two Multi-Dimensional Arrays<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\na1 = &#x5B;&#x5B;20, 21, 5], &#x5B;-9, 11, 1]]\na2 = &#x5B;&#x5B;13, 17, 6], &#x5B;1, -8, 7]]\n\nprint (&quot;1st Input array : &quot;, a1) \nprint (&quot;2nd Input array : &quot;, a2) \n\t\ndiv = np.divide(a1, a2) \nprint (&quot;Division of two input arrays : &quot;, div) \n<\/pre><\/div>\n\n\n<p id=\"block-f802e174-cc61-4d84-bc3c-58884f0d0ccd\"><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1st Input array :  &#91;&#91;20, 21, 5], &#91;-9, 11, 1]]\r\n2nd Input array :  &#91;&#91;13, 17, 6], &#91;1, -8, 7]]\r\nDivision of two input arrays :  &#91;&#91; 1.53846154  1.23529412  0.83333333]\r\n &#91;-9. -1.37  0.14285714]]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"block-eb981d18-6042-4c82-ba7f-019d175d22b3\"><span class=\"ez-toc-section\" id=\"Explanation-3\"><\/span>Explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The third example in this divide() function tutorial is slightly similar to the second example which we have already gone through. What we have done here in this example is instead of a simple array we have used a multi-dimensional array in both of our input values<strong> a1 and a2.<\/strong><\/p>\n\n\n\n<p>Make sure both the input arrays should be of the same dimension and same shapes. The numpy.divide() function will find the Division between <a href=\"https:\/\/en.wikipedia.org\/wiki\/Array_data_structure\" target=\"_blank\" rel=\"noreferrer noopener\">array<\/a> arguments, element-wise.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_We_Find_Division_Between_Two_Numpy_Arrays_With_Different_Shapes\"><\/span><strong>Can We Find Division Between Two Numpy Arrays With Different Shapes?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>In simple words, No, we can&#8217;t find division or use the numpy divide function in two numpy arrays that have different shapes.<\/strong><\/p>\n\n\n\n<p>Let&#8217;s look it through one example,<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\na1 = &#x5B;&#x5B;20, 21, 5], &#x5B;-9, 11, 1]]\na2 = &#x5B;&#x5B;7, 13, 17, 6], &#x5B;1, -8, 7]]\n\nprint (&quot;1st Input array : &quot;, a1) \nprint (&quot;2nd Input array : &quot;, a2) \n\t\ndiv = np.divide(a1, a2) \nprint (&quot;Division of two input arrays : &quot;, div) \n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ValueError: operands could not be broadcast together with shapes (2,3) (2,)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanation-4\"><\/span>Explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If the shape of two numpy arrays will be different than we will get a value error. The value error will say something like for example. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>ValueError: operands could not be broadcast together with shapes (2,3) (2,)<\/strong><\/pre>\n\n\n\n<p>Here in this example, we get a value error because the a2 input array has a different shape than the <strong>a1<\/strong> input array. In order to get the division without any value error, make sure to check the shape of arrays.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Whats_Next\"><\/span><strong>What\u2019s Next?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>NumPy is very powerful and incredibly essential for information science in Python. That being true, if you are interested in <a href=\"http:\/\/www.pythonpool.com\/data-science-internship\/\" >data science<\/a> in Python, you really ought to find out more about Python.<\/p>\n\n\n\n<p>You might like our following tutorials on numpy.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/www.pythonpool.com\/numpy-mean\/\">Mean: Implementation and Importance<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/numpy-random\/\">Using <\/a> <a href=\"http:\/\/www.pythonpool.com\/numpy-random\/\">Random Function to Create Random Data<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/numpy-reshape\/\">Reshape: Reshaping Arrays With Ease<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/numpy-power\/\">In-depth Explanation of np.power() With Examples<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/numpy-clip\/\">Clip Function<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The\u00a0<strong>numpy divide()<\/strong>\u00a0is a compelling and essential function available in the numpy module, which can be very useful and highly recommended by many experts while finding the division between very large data sets.<\/p>\n\n\n\n<p>If you still have any questions regarding the NumPy divide function. Leave your question in the comments below.<\/p>\n\n\n\n<p><strong><em>Happy Pythonning!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Numpy divide function is a part of numpy arithmetic operations. There are basic arithmetic operators available in the numpy module, which are add, subtract, &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Numpy Divide | How to Use Numpy.divide() Function in Python\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/#more-4502\" aria-label=\"More on Numpy Divide | How to Use Numpy.divide() Function in Python\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":4506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1495],"tags":[2334,2327,2331,2332,2333,2329,2335,2328,2326,2330],"class_list":["post-4502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-numpy","tag-divide-numpy-array-by-scalar","tag-numpy-divide","tag-numpy-divide-array-by-scalar","tag-numpy-divide-by-scalar","tag-numpy-divide-by-zero","tag-numpy-divide-each-row-by-its-sum","tag-numpy-divide-element-wise","tag-numpy-divide-vector-by-scalar","tag-numpy-element-wise-divide","tag-numpy-true-divide","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Numpy Divide | How to Use Numpy.divide() Function in Python<\/title>\n<meta name=\"description\" content=\"The numpy divide function calculates the division between the two numpy arrays. And returns the division between the input array a1 and a2.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/numpy-divide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Numpy Divide | How to Use Numpy.divide() Function in Python\" \/>\n<meta property=\"og:description\" content=\"The Numpy divide function is a part of numpy arithmetic operations. There are basic arithmetic operators available in the numpy module, which are add,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/numpy-divide\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-28T09:29:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T09:30:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1350\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Python Pool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Python Pool\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/\"},\"author\":{\"name\":\"Python Pool\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\"},\"headline\":\"Numpy Divide | How to Use Numpy.divide() Function in Python\",\"datePublished\":\"2020-09-28T09:29:54+00:00\",\"dateModified\":\"2021-06-14T09:30:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/\"},\"wordCount\":901,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png\",\"keywords\":[\"divide numpy array by scalar\",\"numpy divide\",\"numpy divide array by scalar\",\"numpy divide by scalar\",\"numpy divide by zero\",\"numpy divide each row by its sum\",\"numpy divide element wise\",\"numpy divide vector by scalar\",\"numpy element wise divide\",\"numpy true divide\"],\"articleSection\":[\"Numpy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/numpy-divide\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/\",\"url\":\"https:\/\/www.pythonpool.com\/numpy-divide\/\",\"name\":\"Numpy Divide | How to Use Numpy.divide() Function in Python\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png\",\"datePublished\":\"2020-09-28T09:29:54+00:00\",\"dateModified\":\"2021-06-14T09:30:21+00:00\",\"description\":\"The numpy divide function calculates the division between the two numpy arrays. And returns the division between the input array a1 and a2.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/numpy-divide\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png\",\"width\":1350,\"height\":650,\"caption\":\"numpy divide\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-divide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Numpy Divide | How to Use Numpy.divide() Function in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\",\"name\":\"Python Pool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"caption\":\"Python Pool\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Numpy Divide | How to Use Numpy.divide() Function in Python","description":"The numpy divide function calculates the division between the two numpy arrays. And returns the division between the input array a1 and a2.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/numpy-divide\/","og_locale":"en_US","og_type":"article","og_title":"Numpy Divide | How to Use Numpy.divide() Function in Python","og_description":"The Numpy divide function is a part of numpy arithmetic operations. There are basic arithmetic operators available in the numpy module, which are add,","og_url":"https:\/\/www.pythonpool.com\/numpy-divide\/","og_site_name":"Python Pool","article_published_time":"2020-09-28T09:29:54+00:00","article_modified_time":"2021-06-14T09:30:21+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png","type":"image\/png"}],"author":"Python Pool","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Python Pool","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/numpy-divide\/"},"author":{"name":"Python Pool","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998"},"headline":"Numpy Divide | How to Use Numpy.divide() Function in Python","datePublished":"2020-09-28T09:29:54+00:00","dateModified":"2021-06-14T09:30:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/numpy-divide\/"},"wordCount":901,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png","keywords":["divide numpy array by scalar","numpy divide","numpy divide array by scalar","numpy divide by scalar","numpy divide by zero","numpy divide each row by its sum","numpy divide element wise","numpy divide vector by scalar","numpy element wise divide","numpy true divide"],"articleSection":["Numpy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/numpy-divide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/numpy-divide\/","url":"https:\/\/www.pythonpool.com\/numpy-divide\/","name":"Numpy Divide | How to Use Numpy.divide() Function in Python","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png","datePublished":"2020-09-28T09:29:54+00:00","dateModified":"2021-06-14T09:30:21+00:00","description":"The numpy divide function calculates the division between the two numpy arrays. And returns the division between the input array a1 and a2.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/numpy-divide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/09\/Theatre-Actor-Portfolio-Website-7.png","width":1350,"height":650,"caption":"numpy divide"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/numpy-divide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Numpy Divide | How to Use Numpy.divide() Function in Python"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998","name":"Python Pool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","caption":"Python Pool"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/4502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=4502"}],"version-history":[{"count":6,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/4502\/revisions"}],"predecessor-version":[{"id":13480,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/4502\/revisions\/13480"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/4506"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=4502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=4502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=4502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}