{"id":21294,"date":"2019-10-10T11:15:02","date_gmt":"2019-10-10T15:15:02","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=21294"},"modified":"2022-11-21T09:44:23","modified_gmt":"2022-11-21T14:44:23","slug":"k-means-clustering-algo-part-iii","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/","title":{"rendered":"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III"},"content":{"rendered":"\n<p><em>In the previous <a href=\"\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-ii\/\">part<\/a>,  Lamarcus&nbsp;discussed importing Python libraries <code>numpy as np<\/code><br>and <code>pandas as pd<\/code>. Follow the series with today&#8217;s article, which will focus on how to build a <strong>heatmap<\/strong><\/em>.<\/p>\n\n\n\n<p>Now that we have our libraries, let&#8217;s get our data.<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:11px\" class=\"has-background\">#setting start and end dates<br>\nstart=&#8217;2014-01-01&#8242;<br>\nend=&#8217;2916-01-01&#8242;<br>\n#importing Walmart and Target using pandas datareader<br>\nwmt=pdr.get_data_yahoo(&#8216;WMT&#8217;,start,end)<br>\ntgt=pdr.get_data_yahoo(&#8216;TGT&#8217;,start,end)<\/p>\n\n\n\n<p>Before testing our two stocks for cointegration, let&#8217;s take a look at their performance over the period. We&#8217;ll create a plot of Walmart* and Target*.<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:11px\" class=\"has-background\">#Creating a figure to plot on\nplt.figure(figsize=(10,8))<br>\n#Creating WMT and TGT plots<br>\nplt.plot(wmt[&#8220;Close&#8221;],label=&#8217;Walmart&#8217;)<br>\nplt.plot(tgt[\u2018Close&#8217;],label=&#8217;Target&#8217;)<br>\nplt.title(&#8216;Walmart and Target Over 2014-2016&#8217;)<br>\nplt.legend(loc=0)<br>\nplt.show()<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/d1rwhvwstyk9gu.cloudfront.net\/2019\/09\/walmart-graph.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n\n\n\n<p>In the above plot, we can see a slight correlation at the beginning of 2014. But this doesn&#8217;t really give us a clear idea of the relationship between Walmart and Target. To get a definitive idea of the relationship between the two stocks, we&#8217;ll create a correlation heat-map.<\/p>\n\n\n\n<p>To begin creating our correlation&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/creating-heatmap-using-python-seaborn\/\">heatmap<\/a>, we must first place Walmart* and Target* prices in the same dataframe. Let&#8217;s create a new dataframe for our stocks.<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:11px\" class=\"has-background\">#initializing newDF as a pandas dataframe<br>\nnewDF=pd.DataFrame()<br>\n#adding WMT closing prices as a column to the newDF<br>\nnewDF[&#8216;WMT&#8217;]=wmt[&#8216;Close&#8217;]<br>\n#adding TGT closing prices as a column to the newDF<br>\nnewDF[&#8216;TGT&#8217;]=tgt[&#8216;Close&#8217;]<\/p>\n\n\n\n<p>Now that we have created a new dataframe to hold our Walmart and Target stock prices, let&#8217;s take a look at it.<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:11px\" class=\"has-background\">newDF.head()<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/d1rwhvwstyk9gu.cloudfront.net\/2019\/09\/walmart-data.jpg\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n\n\n\n<p>We can see that we have the prices of both our stocks in one place. We are now ready to create a correlation heatmap of our stocks. To this, we will use&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/creating-heatmap-using-python-seaborn\/\">Python&#8217;s Seaborn<\/a>&nbsp;library. Recall that we imported <code>Seaborn <\/code>earlier as sns.<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:11px\" class=\"has-background\">#using seaborn as sns to create a correlation heatmap of WMT and TGT<br>\nsns.heatmap(newDF.corr())<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/d1rwhvwstyk9gu.cloudfront.net\/2019\/09\/heatmap.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n\n\n\n<p>In the above plot, we called the<code> corr()<\/code> method on our <code>newDF <\/code>and passed it into&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/creating-heatmap-using-python-seaborn\/\">Seaborn&#8217;s&nbsp;<\/a>heatmap object. From this visualization, we can see that our two stocks are not that correlated. Let&#8217;s create a final visualization to asses this relationship. We&#8217;ll use a scatter plot for this.<\/p>\n\n\n\n<p><em>*Any trading symbols displayed are for illustrative purposes only and are not intended to portray recommendations.<\/em><\/p>\n\n\n\n<p><em>Disclaimer: All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lamarcus creates a correlation heatmap using Python&#8217;s Seaborn library.<\/p>\n","protected":false},"author":261,"featured_media":21396,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,350,341,344],"tags":[851,806,4582,4581,4124,852,1225,1224,595,4580,2536],"contributors-categories":[13654],"class_list":{"0":"post-21294","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-asia-pacific","12":"category-quant-development","13":"category-quant-regions","14":"tag-algo-trading","15":"tag-data-science","16":"tag-dataframe","17":"tag-heatmap","18":"tag-k-means-clustering","19":"tag-machine-learning","20":"tag-numpy","21":"tag-pandas","22":"tag-python","23":"tag-seaborn","24":"tag-visualization","25":"contributors-categories-quantinsti"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III<\/title>\n<meta name=\"description\" content=\"Lamarcus creates a correlation heatmap using Python&#039;s Seaborn library, and testing two stocks for cointegration.\" \/>\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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/21294\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III\" \/>\n<meta property=\"og:description\" content=\"Lamarcus creates a correlation heatmap using Python&#039;s Seaborn library, and testing two stocks for cointegration.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-10T15:15:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:44:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png\" \/>\n\t<meta property=\"og:image:width\" content=\"657\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Lamarcus Coleman\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lamarcus Coleman\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Lamarcus Coleman\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d25f2d2d80f2efd41c14efd1767f840d\"\n\t            },\n\t            \"headline\": \"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III\",\n\t            \"datePublished\": \"2019-10-10T15:15:02+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:44:23+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/\"\n\t            },\n\t            \"wordCount\": 492,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/QuantInsti-Heatmap-Seaborn.png\",\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"Data Science\",\n\t                \"Dataframe\",\n\t                \"Heatmap\",\n\t                \"K-Means Clustering\",\n\t                \"Machine Learning\",\n\t                \"NumPy\",\n\t                \"Pandas\",\n\t                \"Python\",\n\t                \"Seaborn\",\n\t                \"Visualization\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/\",\n\t            \"name\": \"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/QuantInsti-Heatmap-Seaborn.png\",\n\t            \"datePublished\": \"2019-10-10T15:15:02+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:44:23+00:00\",\n\t            \"description\": \"Lamarcus creates a correlation heatmap using Python's Seaborn library, and testing two stocks for cointegration.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/k-means-clustering-algo-part-iii\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/QuantInsti-Heatmap-Seaborn.png\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/QuantInsti-Heatmap-Seaborn.png\",\n\t            \"width\": 657,\n\t            \"height\": 400,\n\t            \"caption\": \"QuantInsti Heatmap Seaborn\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d25f2d2d80f2efd41c14efd1767f840d\",\n\t            \"name\": \"Lamarcus Coleman\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/lamarcuscoleman\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III","description":"Lamarcus creates a correlation heatmap using Python's Seaborn library, and testing two stocks for cointegration.","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.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/21294\/","og_locale":"en_US","og_type":"article","og_title":"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III","og_description":"Lamarcus creates a correlation heatmap using Python's Seaborn library, and testing two stocks for cointegration.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/","og_site_name":"IBKR Campus US","article_published_time":"2019-10-10T15:15:02+00:00","article_modified_time":"2022-11-21T14:44:23+00:00","og_image":[{"width":657,"height":400,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png","type":"image\/png"}],"author":"Lamarcus Coleman","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lamarcus Coleman","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/"},"author":{"name":"Lamarcus Coleman","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d25f2d2d80f2efd41c14efd1767f840d"},"headline":"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III","datePublished":"2019-10-10T15:15:02+00:00","dateModified":"2022-11-21T14:44:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/"},"wordCount":492,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png","keywords":["Algo Trading","Data Science","Dataframe","Heatmap","K-Means Clustering","Machine Learning","NumPy","Pandas","Python","Seaborn","Visualization"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Asia Pacific","Quant Development","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/","name":"K-Means Clustering Algorithm For Pair Selection In Python \u2013 Part III","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png","datePublished":"2019-10-10T15:15:02+00:00","dateModified":"2022-11-21T14:44:23+00:00","description":"Lamarcus creates a correlation heatmap using Python's Seaborn library, and testing two stocks for cointegration.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/k-means-clustering-algo-part-iii\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png","width":657,"height":400,"caption":"QuantInsti Heatmap Seaborn"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d25f2d2d80f2efd41c14efd1767f840d","name":"Lamarcus Coleman","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/lamarcuscoleman\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/QuantInsti-Heatmap-Seaborn.png","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/21294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/261"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=21294"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/21294\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/21396"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=21294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=21294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=21294"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=21294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}