{"id":3619,"date":"2020-07-17T22:15:34","date_gmt":"2020-07-17T16:45:34","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=3619"},"modified":"2024-01-01T13:20:27","modified_gmt":"2024-01-01T07:50:27","slug":"ln-in-python","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/ln-in-python\/","title":{"rendered":"ln in Python: Implementation and Real Life Uses"},"content":{"rendered":"\n<p>Python&#8217;s math module has provided us with many important functions, such as sqrt (), which is used to calculate the square root of a number. We also have functions to calculate a number&#8217;s <strong>cos, sin, tan, and exponent<\/strong>. Not only this, but we can also calculate <strong>Natural Log<\/strong>, commonly known as<strong> ln<\/strong> in Python. In this article, we will study how to calculate the natural log of a number using the math module and some other ways.<\/p>\n\n\n\n<p>A normal log means base 10 logarithm (or example log10(x)), but a <strong>natural log is a base e algorithm (for example, loge(x) or ln(x))<\/strong>. The formula for calculating natural log is ln(x)= log(x) \/ log (2.71828). We will also learn how to calculate the natural log of every element of an array.<br>Note-<br>log(e(x)) = x<\/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\/ln-in-python\/#How_to_Calculate_Ln_in_Python\" >How to Calculate Ln in Python?<\/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\/ln-in-python\/#Using_Math_Module\" >Using Math Module<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#Syntax\" >Syntax-<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#Examples_of_ln_in_Python\" >Examples of ln in Python<\/a><\/li><\/ul><\/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\/ln-in-python\/#Using_Numpy_module\" >Using Numpy module<\/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\/ln-in-python\/#Examples_of_ln_in_Python_using_numpy\" >Examples of ln in Python using numpy<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#Calculating_the_ln_of_elements_of_an_Array_in_Python\" >Calculating the ln of elements of an Array in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#Plotting_Natural_Log_ln_vs_Standard_Log_in_Python\" >Plotting Natural Log (ln) vs Standard Log in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#Must_Read\" >Must Read<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-how-to-calculate-ln-in-python\"><span class=\"ez-toc-section\" id=\"How_to_Calculate_Ln_in_Python\"><\/span>How to Calculate Ln in Python?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We will use a math module in Python, which provides a direct method to calculate the natural log.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-using-math-module\"><span class=\"ez-toc-section\" id=\"Using_Math_Module\"><\/span>Using Math Module<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-syntax\"><span class=\"ez-toc-section\" id=\"Syntax\"><\/span>Syntax-<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>math.log(x[, base])-<\/strong><br>Parameters-<br><strong>X<\/strong>&#8211; It is the number whose natural log we want to calculate. It must be a numeric value.<br><strong>Base-<\/strong> By default, the value of this is &#8216;e.&#8217; It means that if we do not provide any base, it will calculate the natural log. But we can change the value of the base according to our needs.<br>Note- Returns Value Error if negative or zero value is passed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-examples-of-ln-in-python\"><span class=\"ez-toc-section\" id=\"Examples_of_ln_in_Python\"><\/span>Examples of ln in Python<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Let us learn how to use the above function for calculating ln in Python.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\na=5\nx=10\ny=20\nz=10\n# Using log() to find the natural log of the element\nprint( &quot; number: &quot;, x ,&quot; log: &quot;, math.log(x))\nprint(&quot; number : &quot;, y ,&quot; log: &quot;, math.log(y))\nprint(&quot; number: &quot;, z ,&quot; log: &quot;, math.log(z))\nprint(&quot; number:&quot;,a ,&quot; log: &quot;, math.log(a))\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-<br>number: 10 log: 2.302585092994046<br>number: 20 log: 2.995732273553991<br>number: 10 log: 2.302585092994046<br>number: 5 log: 1.6094379124341003<\/pre>\n\n\n\n<p>To calculate the standard log, we will use the <strong>base 10<\/strong>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\na=5\nx=10\ny=20\nz=10\nprint(&quot;number:&quot;,x,&quot;log:&quot;,math.log(x,10))\nprint(&quot;number:&quot;,y,&quot;log:&quot;,math.log(y,10))\nprint(&quot;number:&quot;,z,&quot;log:&quot;,math.log(z,10))\nprint(&quot;number:&quot;,a,&quot;log:&quot;,math.log(a,10))\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-<br>number: 10 log: 1.0<br>number: 20 log: 1.301029995663981<br>number: 10 log: 1.0<br>number: 5 log: 0.6989700043360187<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-using-numpy-module\"><span class=\"ez-toc-section\" id=\"Using_Numpy_module\"><\/span>Using Numpy module<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>numpy.log()<\/strong>&#8211;<\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<p>X- Though there are many parameters in numpy.log(), we will study only one parameter to calculate the natural log of one element. Here, x is that element.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-examples-of-ln-in-python-using-numpy\"><span class=\"ez-toc-section\" id=\"Examples_of_ln_in_Python_using_numpy\"><\/span>Examples of ln in Python using numpy<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\na=59\nx=50\ny=200\nz=100\nprint(&quot; number: &quot;, x ,&quot; log: &quot;, numpy.log(x))\nprint(&quot; number: &quot;, y ,&quot; log: &quot;, numpy.log(y))\nprint(&quot; number: &quot;, z ,&quot; log: &quot;, numpy.log(z))\nprint(&quot; number: &quot;, a ,&quot; log: &quot;, numpy.log(a))\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-<br>number: 50 log: 3.912023005428146<br>number: 200 log: 5.298317366548036<br>number: 100 log: 4.605170185988092<br>number: 59 log: 4.07753744390572<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-calculating-the-ln-of-elements-of-an-array-in-python\"><span class=\"ez-toc-section\" id=\"Calculating_the_ln_of_elements_of_an_Array_in_Python\"><\/span>Calculating the ln of elements of an Array in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Numpy.log(arr,out_arr)<\/strong><\/p>\n\n\n\n<p><strong>Parameters<\/strong>:<\/p>\n\n\n\n<p><strong>Arr<\/strong>&#8211; In this parameter, we must pass the array, whose ln we must find.<br><strong>Out_Arr<\/strong> \u2013 This array should be of the same size as the input <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/en.wikipedia.org\/wiki\/Array_data_structure\" target=\"_blank\" rel=\"noreferrer noopener\">array<\/a>. The log of the elements of the array will be passed in this array<br>import numpy as np.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\n# input list\nlist1=&#x5B;10,20,30,40,50,60,70,80,90,100,110,120,130,140]\n# Converting the list into array\narr=np.array(list1)\n# Finding the Natural Log and storing it into another array\nout_arr=np.log(arr)\nprint(out_arr)\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-<br>[2.30258509 2.99573227 3.40119738 3.68887945 3.91202301 4.09434456 4.24849524 4.38202663 4.49980967 4.60517019 4.70048037 4.78749174 4.86753445 4.94164242]<\/pre>\n\n\n\n<p>If you have still not understood the difference between Natural Log and Standard Log, let us plot a graph of the same input array between the Natural Log and Standard Log.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-plotting-natural-log-ln-vs-standard-log-in-python\"><span class=\"ez-toc-section\" id=\"Plotting_Natural_Log_ln_vs_Standard_Log_in_Python\"><\/span>Plotting Natural Log (ln) vs Standard Log in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\n# If we use %matplotlib inline, we do not need to use plt.show() again and again\n%matplotlib inline\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\n# input list\nlist1=&#x5B;10,20,30,40,50,60,70,80,90,100,110,120,130,140]\n# Converting the list into array\narr=np.array(list1)\n# Finding the Natural Log and storing it into another array\nout_arr=np.log(arr)\n# Finding the Standard Log (base:10) and storing it into another array\nout_arr2=np.log10(arr)\n# Plotting input array with Natural Log\nplt.plot(arr,out_arr,color=&quot;red&quot;,marker=&quot;.&quot;,label=&quot;Natural Log&quot;)\n# Plotting input array with Standard Log\nplt.plot(arr,out_arr2,color=&quot;blue&quot;,marker='.',label=&quot;Standard Log&quot;)\n# Giving the x axis a label\nplt.xlabel(&quot;input array&quot;)\n# Giving the y axis a label\nplt.ylabel(&quot;output array&quot;)\n# Giving the title to the grapph\nplt.title(&quot;Natural Log vs Standard Log&quot;)\nplt.legend()\n<\/pre><\/div>\n\n\n<p>Output-<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"389\" height=\"278\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-15.png\" alt=\"ln in python\" class=\"wp-image-3620\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-15.png 389w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-15-300x214.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/image-15-20x14.png 20w\" sizes=\"(max-width: 389px) 100vw, 389px\" \/><\/figure>\n\n\n\n<p>Observe that as the value of our input increases, the output using a natural log increases exponentially. But with the Standard log, the increase in value is not that great.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-must-read\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span><span style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">Must Read<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/www.pythonpool.com\/python-lowercase\/\">How to Convert String to Lowercase in<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/square-root-in-python\/\">How to Calculate Square Root<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/python-user-input\/\">User Input | Input () Function | Keyboard Input<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/python-book\/\">Best Book to Learn Python<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There is widespread use of ln in Python over Standard Log. It is generally used when we want to measure the growth w.r.t. Time. For example, if we&#8217;re going to know the rate of decay or growth as time passes, it is an interesting example of a Natural Log. Other examples include the Richter Scale (used for measuring the intensity of Earthquake), calculating the population growth, etc.<\/p>\n\n\n\n<p>Try to run the programs on your side, and let us know if you have any queries.<\/p>\n\n\n\n<p><strong><em>Happy Coding!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python&#8217;s math module has provided us with many important functions, such as sqrt (), which is used to calculate the square root of a number. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ln in Python: Implementation and Real Life Uses\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/ln-in-python\/#more-3619\" aria-label=\"More on ln in Python: Implementation and Real Life Uses\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":3625,"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":[15],"tags":[1571,1581,1570,1574,1584,1583,1580,1582,1568,1566,1576,1579,1578,1577,1569,1567,1575,1572,1573],"class_list":["post-3619","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-drop-ln-in-string-python","tag-how-to-compute-ln-in-python","tag-how-to-do-ln-in-python","tag-how-to-graph-ln-in-python","tag-how-to-put-ln-function-in-python","tag-how-to-take-the-ln-of-a-in-python","tag-how-to-use-ln-function-in-python","tag-how-to-use-ln-in-python","tag-ln-for-a-matrix-in-python","tag-ln-function-in-python","tag-ln-in-python","tag-ln-in-python-math","tag-ln-in-python-2","tag-ln-in-python-length","tag-logaritmo-ln-in-python","tag-python-why-does-my-ln-have-a-in-it","tag-use-ln-in-python","tag-usig-ln-in-python","tag-what-dose-the-ln-and-col-mean-in-python","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>ln in Python: Implementation and Real Life Uses - Python Pool<\/title>\n<meta name=\"description\" content=\"To use ln in python, we can use the math module and the numpy module of python. We can also find the natural log of all elements of the array.\" \/>\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\/ln-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ln in Python: Implementation and Real Life Uses\" \/>\n<meta property=\"og:description\" content=\"Python&#039;s math module has provided us with many important functions, such as sqrt (), which is used to calculate the square root of a number. We also have\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/ln-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-17T16:45:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T07:50:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"606\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashwini Mandani\" \/>\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=\"Ashwini Mandani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/\"},\"author\":{\"name\":\"Ashwini Mandani\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056\"},\"headline\":\"ln in Python: Implementation and Real Life Uses\",\"datePublished\":\"2020-07-17T16:45:34+00:00\",\"dateModified\":\"2024-01-01T07:50:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/\"},\"wordCount\":561,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg\",\"keywords\":[\"drop ln in string python\",\"how to compute ln in python\",\"how to do ln in python\",\"how to graph ln in python\",\"how to put ln function in python\",\"how to take the ln of a in python\",\"how to use ln function in python\",\"how to use ln in python\",\"ln for a matrix in python\",\"ln function in python\",\"ln in python\",\"ln in python math\",\"ln() in python\",\"ln() in python length\",\"logaritmo ln in python\",\"python why does my ln have a * in it\",\"use ln in python\",\"usig ln in python\",\"what dose the ln and col mean in python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/ln-in-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/\",\"url\":\"https:\/\/www.pythonpool.com\/ln-in-python\/\",\"name\":\"ln in Python: Implementation and Real Life Uses - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg\",\"datePublished\":\"2020-07-17T16:45:34+00:00\",\"dateModified\":\"2024-01-01T07:50:27+00:00\",\"description\":\"To use ln in python, we can use the math module and the numpy module of python. We can also find the natural log of all elements of the array.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/ln-in-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg\",\"width\":1000,\"height\":606,\"caption\":\"ln in python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/ln-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ln in Python: Implementation and Real Life Uses\"}]},{\"@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\/8a75fb48eb1f3dc952df65a8c28ac056\",\"name\":\"Ashwini Mandani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g\",\"caption\":\"Ashwini Mandani\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"ln in Python: Implementation and Real Life Uses - Python Pool","description":"To use ln in python, we can use the math module and the numpy module of python. We can also find the natural log of all elements of the array.","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\/ln-in-python\/","og_locale":"en_US","og_type":"article","og_title":"ln in Python: Implementation and Real Life Uses","og_description":"Python's math module has provided us with many important functions, such as sqrt (), which is used to calculate the square root of a number. We also have","og_url":"https:\/\/www.pythonpool.com\/ln-in-python\/","og_site_name":"Python Pool","article_published_time":"2020-07-17T16:45:34+00:00","article_modified_time":"2024-01-01T07:50:27+00:00","og_image":[{"width":1000,"height":606,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg","type":"image\/jpeg"}],"author":"Ashwini Mandani","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Ashwini Mandani","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/ln-in-python\/"},"author":{"name":"Ashwini Mandani","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056"},"headline":"ln in Python: Implementation and Real Life Uses","datePublished":"2020-07-17T16:45:34+00:00","dateModified":"2024-01-01T07:50:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/ln-in-python\/"},"wordCount":561,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg","keywords":["drop ln in string python","how to compute ln in python","how to do ln in python","how to graph ln in python","how to put ln function in python","how to take the ln of a in python","how to use ln function in python","how to use ln in python","ln for a matrix in python","ln function in python","ln in python","ln in python math","ln() in python","ln() in python length","logaritmo ln in python","python why does my ln have a * in it","use ln in python","usig ln in python","what dose the ln and col mean in python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/ln-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/ln-in-python\/","url":"https:\/\/www.pythonpool.com\/ln-in-python\/","name":"ln in Python: Implementation and Real Life Uses - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg","datePublished":"2020-07-17T16:45:34+00:00","dateModified":"2024-01-01T07:50:27+00:00","description":"To use ln in python, we can use the math module and the numpy module of python. We can also find the natural log of all elements of the array.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/ln-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/07\/Capture-18.jpg","width":1000,"height":606,"caption":"ln in python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/ln-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"ln in Python: Implementation and Real Life Uses"}]},{"@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\/8a75fb48eb1f3dc952df65a8c28ac056","name":"Ashwini Mandani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g","caption":"Ashwini Mandani"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3619","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=3619"}],"version-history":[{"count":7,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3619\/revisions"}],"predecessor-version":[{"id":31471,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3619\/revisions\/31471"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/3625"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=3619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=3619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=3619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}