{"id":9416,"date":"2021-02-24T12:33:28","date_gmt":"2021-02-24T07:03:28","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=9416"},"modified":"2021-06-14T15:08:31","modified_gmt":"2021-06-14T09:38:31","slug":"numpy-sin","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/numpy-sin\/","title":{"rendered":"Numpy Sin in Python with Illustrated Examples"},"content":{"rendered":"\n<p>Hello coders!! In this article, we will be learning about NumPy sin in Python. We will be looking into certain examples and will use the function in different ways. So, without wasting any moment, let us begin.<\/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-sin\/#Syntax\" >Syntax:<\/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-sin\/#Parameters\" >Parameters:<\/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-sin\/#Return_Value\" >Return Value:<\/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-sin\/#Does_numpy_sin_take_radians_or_degrees\" >Does numpy sin take radians or degrees?<\/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-sin\/#Illustrated_Examples\" >Illustrated Examples:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/numpy-sin\/#Python_np_sin_inverse\" >Python np sin inverse:<\/a><\/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\/numpy-sin\/#Numpy_sin_vs_Math_sin\" >Numpy sin vs Math sin:<\/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\/numpy-sin\/#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-9\" href=\"https:\/\/www.pythonpool.com\/numpy-sin\/#Conclusion\" >Conclusion:<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-syntax\"><span class=\"ez-toc-section\" id=\"Syntax\"><\/span>Syntax:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is a mathematical function, used to calculate the trigonometric sine for all x, where x is an array.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>numpy.sin(x[, out]) = ufunc \u2018sin\u2019)&nbsp;<\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parameters\"><span class=\"ez-toc-section\" id=\"Parameters\"><\/span>Parameters:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>array: <\/strong>array elements in radians.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>2pi Radians = 360 degrees<\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-return-value\"><span class=\"ez-toc-section\" id=\"Return_Value\"><\/span>Return Value:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An array with trigonometric sine of x for all x <\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-does-numpy-sin-take-radians-or-degrees\"><span class=\"ez-toc-section\" id=\"Does_numpy_sin_take_radians_or_degrees\"><\/span>Does numpy sin take radians or degrees?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The&nbsp;<strong><code>np.sin()<\/code><\/strong>&nbsp;function help to find the sine value of the angle in degree and radian. To get the sine value of the angle in radians, need to multiply the angle with&nbsp;<strong><code>np.pi\/180<\/code>.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-illustrated-examples\"><span class=\"ez-toc-section\" id=\"Illustrated_Examples\"><\/span>Illustrated Examples:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-1-numpy-sin-with-a-single-value\">example 1: Numpy sin with a single value:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nnp.sin(np.pi\/2.)\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\"><strong>1.0<\/strong><\/pre>\n\n\n\n<p>As you can see, we calculated the value of <strong>sin(pi\/2)<\/strong> using the sin() method of the NumPy module.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-2-with-an-array-of-values\">example 2: with an array of values:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np \ninp = &#x5B;0, np.pi \/ 2, np.pi \/ 3, np.pi] \nprint (&quot;Input array : \\n&quot;, inp) \n\nopt = np.sin(inp) \nprint (&quot;\\nSine values : \\n&quot;, opt) \n<\/pre><\/div>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"666\" height=\"117\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-50.png\" alt=\"With An Array Of Values\" class=\"wp-image-9417\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-50.png 666w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-50-300x53.png 300w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><figcaption><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n\n<p>In this example, we have used an array of elements as input. The different elements are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>0<\/li><li>pi \/ 2<\/li><li>np.pi \/ 3<\/li><li>pi<\/li><\/ul>\n\n\n\n<p>We have then used the np sin method to calculate the sin value of all the corresponding elements. As said earlier, this method gives the sin value of each element of the array, thus giving the output as:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>0.00000000e+00  <\/li><li>1.00000000e+00  <\/li><li>8.66025404e-01  <\/li><li>1.22464680e-16<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-4-numpy-sin-degrees\">Example 4: &nbsp;numpy sin degrees:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n np.sin(np.deg2rad(90))\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\"><strong>1.0<\/strong><\/pre>\n\n\n\n<p>To use the angles in degrees rather than radians, we have used the <code>np.deg2rad()<\/code> method. This method is used to convert angles from degrees to radians.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-syntax-1\">Syntax:<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>numpy.deg2rad(x[, out]) = ufunc \u2018deg2rad\u2019)&nbsp;<\/strong><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-5-numpy-sin-squared\">example 5: numpy sin squared:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np \ninp = &#x5B;0, np.pi \/ 2, np.pi \/ 3, np.pi] \nprint (&quot;Input array : \\n&quot;, inp) \n\nopt = np.sin(in_array) ** 2\nprint (&quot;\\nSine Square values : \\n&quot;, opt) \n<\/pre><\/div>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"664\" height=\"102\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-53.png\" alt=\"Numpy Sin Squared\" class=\"wp-image-9422\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-53.png 664w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-53-300x46.png 300w\" sizes=\"(max-width: 664px) 100vw, 664px\" \/><figcaption><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n\n<p>In this example, we have squared the sine values by raising it to <a href=\"http:\/\/www.pythonpool.com\/numpy-power\/\" target=\"_blank\" rel=\"noreferrer noopener\">power<\/a> 2 and stored the output in an array. We then printed the array to get the desired output.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-6-np-sin-fit\">example 6: np sin fit:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom scipy import optimize\nx_data = np.linspace(-5, 5, num=50)\ny_data = 2.9 * np.sin(1.5 * x_data) + np.random.normal(size=50)\n\ndef test_func(x, a, b):\n    return a * np.sin(b * x)\n\npars, pars_co = optimize.curve_fit(test_func, x_data, y_data, p0=&#x5B;2, 2])\n\nplt.figure(figsize=(6, 4))\nplt.scatter(x_data, y_data, label='Data')\nplt.plot(x_data, test_func(x_data, pars&#x5B;0], pars&#x5B;1]))\nplt.show()\n<\/pre><\/div>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"370\" height=\"251\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-55.png\" alt=\"Np Sin Fit\" class=\"wp-image-9424\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-55.png 370w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-55-300x204.png 300w\" sizes=\"(max-width: 370px) 100vw, 370px\" \/><figcaption><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n\n<p>As you can see, in this example, we have used the numpy functions to create the data. We then used the sin method for the value of the y-axis. We then optimize the curve and fit the sine curve to get the desired output.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-7-numpy-generate-sin-wave-plot\">example 7: numpy generate sin wave plot:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np \nimport matplotlib.pyplot as plt \n\ninp = np.linspace(-np.pi, np.pi, 12) \nopt = np.sin(inp) \n\nplt.plot(inp, opt, color = 'green', marker = &quot;o&quot;) \nplt.title(&quot;numpy.sin()&quot;) \nplt.show() \n\n<\/pre><\/div>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"386\" height=\"264\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-51.png\" alt=\"Numpy Generate Sin Wave Plot\" class=\"wp-image-9418\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-51.png 386w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-51-300x205.png 300w\" sizes=\"(max-width: 386px) 100vw, 386px\" \/><figcaption><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n\n<p>Here, we have plotted the sine graph using the sin method, thus getting the <a href=\"https:\/\/www.mathopenref.com\/triggraphsine.html#:~:text=To%20graph%20the%20sine%20function,name%20of%20the%20sine%20function.\" target=\"_blank\" rel=\"noreferrer noopener\">sine graph<\/a> as output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-np-sin-inverse\"><span class=\"ez-toc-section\" id=\"Python_np_sin_inverse\"><\/span>Python np sin inverse:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><code>numpy.arcsin()<\/code>&nbsp;function helps user to calculate inverse sine for all x.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-syntax-2\">Syntax:<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>numpy.arcsin(x[, out]) = ufunc \u2018arcsin\u2019)&nbsp;<\/strong><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-parameters-1\">Parameters:<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>array  : <\/strong>elements in radians<\/li><li><strong>out    : <\/strong>array of same shape as x.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-return-value-1\">Return Value:<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>An array with inverse sine of x.<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np \n\ninp = &#x5B;0, 1, 0.3, -1] \nprint (&quot;Input array : \\n&quot;, inp) \n\nopt = np.arcsin(inp) \nprint (&quot;\\nInverse Sine values : \\n&quot;, opt) \n<\/pre><\/div>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"655\" height=\"136\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-57.png\" alt=\"Python np sin inverse\" class=\"wp-image-9426\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-57.png 655w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-57-300x62.png 300w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/><figcaption><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n\n<p>In this example, we have used the <code>np.arcsin()<\/code> method to find the inverse sin value of the elements of the array. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-numpy-sin-vs-math-sin\"><span class=\"ez-toc-section\" id=\"Numpy_sin_vs_Math_sin\"><\/span>Numpy sin vs Math sin:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><code><em>math<\/em>.sin<\/code> works on a single number, the&nbsp;<em>numpy<\/em>&nbsp;version works on&nbsp;<em>numpy<\/em>&nbsp;arrays and is tremendously faster due to the benefits of vectorization.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>Math Sin<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\"><strong>NumPy Sin<\/strong><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">works on a single number<\/td><td class=\"has-text-align-left\" data-align=\"left\">works on&nbsp;<em>numpy<\/em>&nbsp;arrays<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">relatively slower<\/td><td class=\"has-text-align-left\" data-align=\"left\">tremendously faster due to the benefits of vectorization<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>Syntax:<\/strong> math.sin(<em>x<\/em>)<br>x -&gt; The number to find the sine of<\/td><td class=\"has-text-align-left\" data-align=\"left\"><strong>Syntax:<\/strong> numpy.sin(x[, out]) = ufunc \u2018sin\u2019)<br><strong>array <\/strong>-&gt; array elements in radians.<br><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>import math<br>print(math.sin(math.radians(30)))<br>print(math.sin(math.radians(90)))<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\"><code>import numpy as np<br>inp = [0, np.pi \/ 2, np.pi \/ 3, np.pi]<br>opt = np.sin(inp)<br>print(opt)<\/code><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">0.49999999999999994<br>1.0<\/td><td class=\"has-text-align-left\" data-align=\"left\">[0.00000000e+00 1.00000000e+00 8.66025404e-01 1.22464680e-16]<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"has-vivid-purple-color has-text-color wp-block-heading\" id=\"h-must-read\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span>Must Read<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-yoast-seo-related-links\"><li><a href=\"http:\/\/www.pythonpool.com\/numpy-axis\/\">Numpy Axis in Python With Detailed Examples<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/matplotlib-annotate\/\">Matplotlib Annotate Explained with Examples<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/spectrogram-python\/\">Python Spectrogram Implementation in Python from scratch<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/plus-equal-to-in-python\/\">Demystifying += in Python with Examples<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/matplotlib-gca\/\">Matplotlib GCA in Python Explained with Examples<\/a><\/li><\/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>With this, we come to an end with this article. I hope that this article clarified the concept of NumPy sin.<\/p>\n\n\n\n<p>However, if you have any doubts or questions, do let me know in the comment section below. I will try to help you as soon as possible.<\/p>\n\n\n\n<p><strong><em>Happy Pythoning!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello coders!! In this article, we will be learning about NumPy sin in Python. We will be looking into certain examples and will use the &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Numpy Sin in Python with Illustrated Examples\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/numpy-sin\/#more-9416\" aria-label=\"More on Numpy Sin in Python with Illustrated Examples\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":9438,"comment_status":"open","ping_status":"closed","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":[3663,3662,3661,3666,3660,3664],"class_list":["post-9416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-numpy","tag-numpy-generate-sin-wave-plot","tag-numpy-sin-degrees","tag-numpy-sin-function","tag-numpy-sin-vs-math-sin","tag-sin-in-python-numpy","tag-sin-python-numpy","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 Sin in Python with Illustrated Examples - Python Pool<\/title>\n<meta name=\"description\" content=\"Numpy sin is a mathematical function, used to calculate the trigonometric sine for all x, where x is an array. numpy.sin(x[, out]) = ufunc \u2018sin\u2019)\" \/>\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-sin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Numpy Sin in Python with Illustrated Examples\" \/>\n<meta property=\"og:description\" content=\"Hello coders!! In this article, we will be learning about NumPy sin in Python. We will be looking into certain examples and will use the function in\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/numpy-sin\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-24T07:03:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T09:38:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.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=\"Prachee Sao\" \/>\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=\"Prachee Sao\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/\"},\"author\":{\"name\":\"Prachee Sao\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47\"},\"headline\":\"Numpy Sin in Python with Illustrated Examples\",\"datePublished\":\"2021-02-24T07:03:28+00:00\",\"dateModified\":\"2021-06-14T09:38:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/\"},\"wordCount\":592,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png\",\"keywords\":[\"numpy generate sin wave plot\",\"numpy sin degrees\",\"numpy sin function\",\"numpy sin vs math sin\",\"sin in python numpy\",\"sin python numpy\"],\"articleSection\":[\"Numpy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/numpy-sin\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/\",\"url\":\"https:\/\/www.pythonpool.com\/numpy-sin\/\",\"name\":\"Numpy Sin in Python with Illustrated Examples - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png\",\"datePublished\":\"2021-02-24T07:03:28+00:00\",\"dateModified\":\"2021-06-14T09:38:31+00:00\",\"description\":\"Numpy sin is a mathematical function, used to calculate the trigonometric sine for all x, where x is an array. numpy.sin(x[, out]) = ufunc \u2018sin\u2019)\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/numpy-sin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png\",\"width\":1350,\"height\":650,\"caption\":\"Python sin\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-sin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Numpy Sin in Python with Illustrated Examples\"}]},{\"@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\/b91d749826b21e606d55cda77d51ef47\",\"name\":\"Prachee Sao\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g\",\"caption\":\"Prachee Sao\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Numpy Sin in Python with Illustrated Examples - Python Pool","description":"Numpy sin is a mathematical function, used to calculate the trigonometric sine for all x, where x is an array. numpy.sin(x[, out]) = ufunc \u2018sin\u2019)","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-sin\/","og_locale":"en_US","og_type":"article","og_title":"Numpy Sin in Python with Illustrated Examples","og_description":"Hello coders!! In this article, we will be learning about NumPy sin in Python. We will be looking into certain examples and will use the function in","og_url":"https:\/\/www.pythonpool.com\/numpy-sin\/","og_site_name":"Python Pool","article_published_time":"2021-02-24T07:03:28+00:00","article_modified_time":"2021-06-14T09:38:31+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png","type":"image\/png"}],"author":"Prachee Sao","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Prachee Sao","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/numpy-sin\/"},"author":{"name":"Prachee Sao","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47"},"headline":"Numpy Sin in Python with Illustrated Examples","datePublished":"2021-02-24T07:03:28+00:00","dateModified":"2021-06-14T09:38:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/numpy-sin\/"},"wordCount":592,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png","keywords":["numpy generate sin wave plot","numpy sin degrees","numpy sin function","numpy sin vs math sin","sin in python numpy","sin python numpy"],"articleSection":["Numpy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/numpy-sin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/numpy-sin\/","url":"https:\/\/www.pythonpool.com\/numpy-sin\/","name":"Numpy Sin in Python with Illustrated Examples - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png","datePublished":"2021-02-24T07:03:28+00:00","dateModified":"2021-06-14T09:38:31+00:00","description":"Numpy sin is a mathematical function, used to calculate the trigonometric sine for all x, where x is an array. numpy.sin(x[, out]) = ufunc \u2018sin\u2019)","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/numpy-sin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Numpy-Sin-in-Python-with-Illustrated-Examples.png","width":1350,"height":650,"caption":"Python sin"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/numpy-sin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Numpy Sin in Python with Illustrated Examples"}]},{"@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\/b91d749826b21e606d55cda77d51ef47","name":"Prachee Sao","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g","caption":"Prachee Sao"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/9416","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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=9416"}],"version-history":[{"count":12,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/9416\/revisions"}],"predecessor-version":[{"id":13500,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/9416\/revisions\/13500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/9438"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=9416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=9416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=9416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}