{"id":8373,"date":"2021-02-09T10:05:17","date_gmt":"2021-02-09T04:35:17","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=8373"},"modified":"2024-01-01T10:37:05","modified_gmt":"2024-01-01T05:07:05","slug":"python-autocorrelation","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-autocorrelation\/","title":{"rendered":"Cracking The Python Autocorrelation Code"},"content":{"rendered":"\n<p>Hello coders!! In this article, we will be discussing autocorrelation in Python. We use autocorrelation&nbsp;to measure a set of current values against past values to see if they correlate. It is primarily used to do time series analysis and forecasting. Let us learn about this topic in detail.<\/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\/python-autocorrelation\/#What_is_an_autocorrelation_plot_in_Python\" >What is an autocorrelation plot 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\/python-autocorrelation\/#Characteristics_Of_Autocorrelation_Plot_in_Python\" >Characteristics Of Autocorrelation Plot&nbsp;in Python:<\/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\/python-autocorrelation\/#Syntax\" >Syntax:<\/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\/python-autocorrelation\/#Parameters\" >Parameters:<\/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\/python-autocorrelation\/#Example\" >Example:<\/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\/python-autocorrelation\/#Python_autocorrelation_of_time_series\" >Python autocorrelation of time series:<\/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\/python-autocorrelation\/#Fastest_way_to_autocorrelation_large_arrays_Python\" >Fastest way to autocorrelation large arrays 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\/python-autocorrelation\/#Application_of_Python_Autocorrelation\" >Application of Python Autocorrelation:<\/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\/python-autocorrelation\/#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\/python-autocorrelation\/#Conclusion\" >Conclusion:<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-an-autocorrelation-plot-in-python\"><span class=\"ez-toc-section\" id=\"What_is_an_autocorrelation_plot_in_Python\"><\/span>What is an autocorrelation plot in Python?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Autocorrelation plots<\/strong>&nbsp;are a common tool used to check the randomness in a given data set. It is primarily used to do time series analysis and forecasting. It is used to summarize a relationship&#8217;s strength with observation in a time series with observations at prior time steps graphically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-characteristics-of-autocorrelation-plot-in-python\"><span class=\"ez-toc-section\" id=\"Characteristics_Of_Autocorrelation_Plot_in_Python\"><\/span><strong>Characteristics Of Autocorrelation Plot&nbsp;<\/strong>in Python:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Varies from +1 to -1.<\/li>\n\n\n\n<li><strong>+1:<\/strong> if the time series one increases in value the time series 2 also increases <\/li>\n\n\n\n<li><strong>-1:<\/strong> If the time series one increases in value, the time series 2 decreases <\/li>\n<\/ul>\n\n\n\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<pre class=\"wp-block-code\"><code>matplotlib.pyplot.acorr(x, *, data=None, **kwargs)<\/code><\/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\">\n<li><strong>x:&nbsp;<\/strong>a<strong> <\/strong>sequence of scalar.<\/li>\n\n\n\n<li><strong>detrend:<\/strong>\u00a0optional parameter.\n<ul class=\"wp-block-list\">\n<li><strong>Default value:<\/strong> mlab.detrend_none.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>normed:&nbsp;<\/strong>optional parameter having bool value.\n<ul class=\"wp-block-list\">\n<li><strong>Default value: <\/strong>True.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>usevlines:<\/strong>\u00a0optional parameter having bool value.\n<ul class=\"wp-block-list\">\n<li><strong>Default value: <\/strong>True.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>maxlags:<\/strong>\u00a0optional parameter having an integer value.\n<ul class=\"wp-block-list\">\n<li><strong>Default value: <\/strong>10<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>linestyle:<\/strong>&nbsp;optional parameter used to plot the data points when usevlines is False.<\/li>\n\n\n\n<li><strong>marker:<\/strong>\u00a0optional parameter having string value.\n<ul class=\"wp-block-list\">\n<li><strong>Default value:<\/strong> &#8216;o&#8217;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-example\"><span class=\"ez-toc-section\" id=\"Example\"><\/span>Example:<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 \nimport numpy as np \n \ndata = np.array(&#x5B;1.0,20,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0]) \n \nplt.title(&quot;Autocorrelation Plot&quot;) \nplt.xlabel(&quot;Lags&quot;) \nplt.acorr(data, maxlags = 10) \n\nplt.show()\n<\/pre><\/div>\n\n\n<p id=\"h-output\"><strong>Output:<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"372\" height=\"278\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/01\/download-1.png\" alt=\"Python autocorrelation output\" class=\"wp-image-8389\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/01\/download-1.png 372w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/01\/download-1-300x224.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><figcaption class=\"wp-element-caption\"><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n<p>In this example, we have first created our data as an array of elements using the NumPy module of Python. We then specified the title and the label of our graph. Lastly, we used the acorr() method of the matplotlib module to draw the Python autocorrelation plot of the defined data.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt \nimport numpy as np \n\nnp.random.seed(30) \n \ndata = np.random.randn(20) \nplt.title(&quot;Autocorrelation Plot&quot;) \nplt.xlabel(&quot;Lags&quot;) \nplt.acorr(data, maxlags = 10) \n\nplt.show() \n<\/pre><\/div>\n\n\n<p id=\"h-output-1\"><strong>Output:<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"380\" height=\"278\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/01\/download-2.png\" alt=\"Python autocorrelation\" class=\"wp-image-8388\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/01\/download-2.png 380w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/01\/download-2-300x219.png 300w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><figcaption class=\"wp-element-caption\"><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n<p>In this example, we used the random function to get the data and used that data to plot our autocorrelation plot in Python. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-autocorrelation-of-time-series\"><span class=\"ez-toc-section\" id=\"Python_autocorrelation_of_time_series\"><\/span>Python autocorrelation of time series:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For this, we will be using the <a href=\"https:\/\/raw.githubusercontent.com\/jbrownlee\/Datasets\/master\/daily-min-temperatures.csv\" target=\"_blank\" rel=\"noreferrer noopener\">minimum daily temperatures dataset<\/a>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom pandas import read_csv\nfrom matplotlib import pyplot\ndata = read_csv('data.csv', header=0, index_col=0)\ndata.plot()\npyplot.show()\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"393\" height=\"262\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image.png\" alt=\"Python autocorrelation of time series\" class=\"wp-image-8696\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image.png 393w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-300x200.png 300w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><figcaption class=\"wp-element-caption\"><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n<p>When we execute the above code, it creates a line plot of the time series.<\/p>\n\n\n\n<p>Now, we will use the plot_acf() to calculate and plot the autocorrelation plot for the Minimum Daily Temperature.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom statsmodels.graphics.tsaplots import plot_acf\nplot_acf(data)\npyplot.show()\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"380\" height=\"264\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-1.png\" alt=\"plot_acf\" class=\"wp-image-8697\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-1.png 380w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/image-1-300x208.png 300w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><figcaption class=\"wp-element-caption\"><strong><em>Output<\/em><\/strong><\/figcaption><\/figure><\/div>\n\n\n<p>Executing the above code will create a 2D plot showing the lag value along the x-axis and the correlation on the y-axis between -1 and 1.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-fastest-way-to-autocorrelation-large-arrays-python\"><span class=\"ez-toc-section\" id=\"Fastest_way_to_autocorrelation_large_arrays_Python\"><\/span>Fastest way to autocorrelation large arrays Python:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong><code>numpy.correlate()<\/code><\/strong> can be used to determine the cross-correlation between two 1D sequences. <\/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.correlate(a, v, mode = \u2018valid\u2019)<\/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\">\n<li><strong>a,v: <\/strong>Input sequences<\/li>\n\n\n\n<li><strong>mode: <\/strong>convolve docstring<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-return-value\">Return Value:<\/h4>\n\n\n\n<p>&nbsp;Discrete cross-correlation of a and v<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\n\na = &#x5B;1,2,3] \nv = &#x5B;4,5,6] \n\nprint(np.correlate(a, v, &quot;same&quot;))\n<\/pre><\/div>\n\n\n<p id=\"h-output-2\"><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>[17 32 23]<\/strong><\/pre>\n\n\n\n<p>In this example, we have used the correlate() method to compute the correlation, which is generally defined in signal processing texts:<strong> c_{av}[k] = sum_n a[n+k] * conj(v[n])<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-application-of-python-autocorrelation\"><span class=\"ez-toc-section\" id=\"Application_of_Python_Autocorrelation\"><\/span>Application of Python Autocorrelation:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pattern recognition<\/li>\n\n\n\n<li>Estimating pitch<\/li>\n\n\n\n<li>Signal detection<\/li>\n\n\n\n<li>Technical analysis of stocks<\/li>\n\n\n\n<li>Signal processing<\/li>\n<\/ul>\n\n\n\n<h2 class=\"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-list\">\n<li><a href=\"http:\/\/www.pythonpool.com\/fibonacci-series-in-python\/\" rel=\"noreferrer noopener\" target=\"_blank\">Fibonacci series in Python<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/pandas-to-csv\/\" rel=\"noreferrer noopener\" target=\"_blank\">Using Pandas to CSV() with Perfection<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/sep-in-python\/\" rel=\"noreferrer noopener\" target=\"_blank\">Sep in Python<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/cpickle\/\" rel=\"noreferrer noopener\" target=\"_blank\">cPickle in Python Explained With Examples<\/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>With this, we come to an end with this article. We learned about the Python autocorrelation plot in detail. We learned its requirements, syntax, and also its applications.<\/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 discussing autocorrelation in Python. We use autocorrelation&nbsp;to measure a set of current values against past values to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Cracking The Python Autocorrelation Code\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#more-8373\" aria-label=\"More on Cracking The Python Autocorrelation Code\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":9057,"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":[3558,2071,1495],"tags":[3577,3579,3580,3578,3576],"class_list":["post-8373","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-matplotlib","category-numpy","tag-autocorrelation-function-python","tag-autocorrelation-in-python","tag-autocorrelation-plot-python","tag-autocorrelation-python","tag-python-autocorrelation-plot","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>Cracking The Python Autocorrelation Code - Python Pool<\/title>\n<meta name=\"description\" content=\"Python autocorrelation plots are a common tool used to check the randomness in a given data set, primarily used to do time series analysis and forecasting.\" \/>\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\/python-autocorrelation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cracking The Python Autocorrelation Code\" \/>\n<meta property=\"og:description\" content=\"Hello coders!! In this article, we will be discussing autocorrelation in Python. We use autocorrelation&nbsp;to measure a set of current values against\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-autocorrelation\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-09T04:35:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T05:07:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.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\/python-autocorrelation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/\"},\"author\":{\"name\":\"Prachee Sao\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47\"},\"headline\":\"Cracking The Python Autocorrelation Code\",\"datePublished\":\"2021-02-09T04:35:17+00:00\",\"dateModified\":\"2024-01-01T05:07:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/\"},\"wordCount\":535,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png\",\"keywords\":[\"autocorrelation function python\",\"autocorrelation in python\",\"autocorrelation plot python\",\"autocorrelation python\",\"python autocorrelation plot\"],\"articleSection\":[\"Machine Learning\",\"Matplotlib\",\"Numpy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/\",\"name\":\"Cracking The Python Autocorrelation Code - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png\",\"datePublished\":\"2021-02-09T04:35:17+00:00\",\"dateModified\":\"2024-01-01T05:07:05+00:00\",\"description\":\"Python autocorrelation plots are a common tool used to check the randomness in a given data set, primarily used to do time series analysis and forecasting.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-autocorrelation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png\",\"width\":1350,\"height\":650,\"caption\":\"Python Autocorrelation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-autocorrelation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cracking The Python Autocorrelation Code\"}]},{\"@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":"Cracking The Python Autocorrelation Code - Python Pool","description":"Python autocorrelation plots are a common tool used to check the randomness in a given data set, primarily used to do time series analysis and forecasting.","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\/python-autocorrelation\/","og_locale":"en_US","og_type":"article","og_title":"Cracking The Python Autocorrelation Code","og_description":"Hello coders!! In this article, we will be discussing autocorrelation in Python. We use autocorrelation&nbsp;to measure a set of current values against","og_url":"https:\/\/www.pythonpool.com\/python-autocorrelation\/","og_site_name":"Python Pool","article_published_time":"2021-02-09T04:35:17+00:00","article_modified_time":"2024-01-01T05:07:05+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.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\/python-autocorrelation\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/"},"author":{"name":"Prachee Sao","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47"},"headline":"Cracking The Python Autocorrelation Code","datePublished":"2021-02-09T04:35:17+00:00","dateModified":"2024-01-01T05:07:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/"},"wordCount":535,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png","keywords":["autocorrelation function python","autocorrelation in python","autocorrelation plot python","autocorrelation python","python autocorrelation plot"],"articleSection":["Machine Learning","Matplotlib","Numpy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-autocorrelation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/","url":"https:\/\/www.pythonpool.com\/python-autocorrelation\/","name":"Cracking The Python Autocorrelation Code - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png","datePublished":"2021-02-09T04:35:17+00:00","dateModified":"2024-01-01T05:07:05+00:00","description":"Python autocorrelation plots are a common tool used to check the randomness in a given data set, primarily used to do time series analysis and forecasting.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-autocorrelation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/02\/Theatre-Actor-Portfolio-Website-12.png","width":1350,"height":650,"caption":"Python Autocorrelation"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-autocorrelation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Cracking The Python Autocorrelation Code"}]},{"@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\/8373","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=8373"}],"version-history":[{"count":15,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/8373\/revisions"}],"predecessor-version":[{"id":31433,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/8373\/revisions\/31433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/9057"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=8373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=8373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=8373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}