{"id":105464,"date":"2021-10-04T12:15:10","date_gmt":"2021-10-04T16:15:10","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=105464"},"modified":"2022-11-21T09:48:09","modified_gmt":"2022-11-21T14:48:09","slug":"stock-market-data-and-analysis-in-python-part-vi","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/","title":{"rendered":"Stock Market Data And Analysis In Python \u2013 Part VI"},"content":{"rendered":"\n<p><em>See&nbsp;<a href=\"\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-i\/\">Part I<\/a>&nbsp;for instructions on how to get&nbsp;<code>pandas_datareader<\/code>&nbsp;or&nbsp;<code>yfinance<\/code>&nbsp;module to retrieve the data, and&nbsp;<a href=\"\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-ii\/\">Part II<\/a>&nbsp;to learn how to get stock market data for different geographies. In&nbsp;<a href=\"\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-iii\/\">Part III<\/a>&nbsp;and&nbsp;<a href=\"\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-iv\/\">Part IV<\/a>, review the tutorial on how to analyse the stock market data for all the stocks which make up the S&amp;P 500.<\/em> <em><a href=\"\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-v\/\">Part V<\/a> explains how to use Quandl to get stock market data.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fundamental-data\">Fundamental&nbsp;<strong>Data<\/strong><\/h2>\n\n\n\n<p>We have used&nbsp;<strong>yfinance&nbsp;<\/strong>to get the fundamental data.<br><br>The first step is to set the ticker and then call the appropriate properties to get the right stock market data.<\/p>\n\n\n\n<p>If yfinance is not installed on your computer, then run the below line of code from your Jupyter Notebook to install yfinance.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install yfinance<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/c568a4e09187a9e62f054747165be54f#file-install-yfinance-py\">install yfinance.py<\/a>&nbsp;hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Import yfinance\nimport yfinance as yf\n\n# Set the ticker as MSFT\nmsft = yf.Ticker(\"MSFT\")<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/42869b654e10c691ddd5d7ae395f3b6d#file-import-yfinance-and-set-the-ticker-py\">Import yfinance and set the ticker.py<\/a>&nbsp;hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"key-ratios\"><strong>Key Ratios<\/strong><\/h3>\n\n\n\n<p>You can fetch the latest price to book ratio and price to earnings ratio as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># get price to book\npb = msft.info&#91;'priceToBook']\npe = msft.info&#91;'regularMarketPrice']\/msft.info&#91;'epsTrailingTwelveMonths']\nprint('Price to Book Ratio is: %.2f' % pb)\nprint('Price to Earnings Ratio is: %.2f' % pe)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/62607b3c7b7352de3b8ac1b4bd069e88#file-get-price-to-book-py\">Get price to book.py<\/a>&nbsp;hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Revenues<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># show revenues\nrevenue = msft.financials.loc&#91;'Total Revenue']\nplt.bar(revenue.index, revenue.values)\nplt.ylabel(\"Total Revenues\")\nplt.show()<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/7877ec0b521d14b7d1608bf8175fcf8d#file-revenue-py\">Revenue.py<\/a>&nbsp;hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"430\" height=\"252\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/total-revenues-quantinsti.png\" alt=\"\" class=\"wp-image-105502 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/total-revenues-quantinsti.png 430w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/total-revenues-quantinsti-300x176.png 300w\" data-sizes=\"(max-width: 430px) 100vw, 430px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 430px; aspect-ratio: 430\/252;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Earnings Before Interest and Taxes (EBIT)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>EBIT = msft.financials.loc&#91;'Earnings Before Interest and Taxes']\nplt.bar(EBIT.index, EBIT.values)\nplt.ylabel(\"EBIT\")\nplt.show()<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/a95ee71a1ba8843f63c22faf1bca08ef#file-ebit-py\">EBIT.py<\/a>&nbsp;hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"424\" height=\"252\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/ebit-quantinsti.png\" alt=\"\" class=\"wp-image-105511 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/ebit-quantinsti.png 424w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/ebit-quantinsti-300x178.png 300w\" data-sizes=\"(max-width: 424px) 100vw, 424px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 424px; aspect-ratio: 424\/252;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Balance sheet, cash flows and other information<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># show income statement\nmsft.financials\n# show balance heet\nmsft.balance_sheet\n# show cashflow\nmsft.cashflow\n# show other info\nmsft.info<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/gist.github.com\/quantra-go-algo\/1efe1bd895445b6687c3b4d5f0e8c687#file-show-information-py\">Show information.py<\/a>&nbsp;hosted with \u2764 by&nbsp;<a href=\"https:\/\/github.com\/\">GitHub<\/a><\/code><\/pre>\n\n\n\n<p><em>Stay tuned for next installment in which Ishan Shah will&nbsp;share a tutorial on Stock Market Data Visualization and Analysis.<\/em><\/p>\n\n\n\n<p><em>See&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/stock-market-data-analysis-python\/\">https:\/\/blog.quantinsti.com\/stock-market-data-analysis-python\/<\/a>&nbsp;for additional insight on this topic.<\/em><\/p>\n\n\n\n<p><em>Past performance is not indicative of future results.<\/em><\/p>\n\n\n\n<p><em>Any stock, options or futures symbols displayed are for illustrative purposes only and are not intended to portray recommendations.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.<\/p>\n","protected":false},"author":517,"featured_media":36684,"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":[10446,10448,10351,865,10449,10352,10053,6614,4659,10104,1224,10054,10056,10055,10354,10103,10280,10447],"contributors-categories":[13654],"class_list":{"0":"post-105464","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-book-py","15":"tag-ebit-py","16":"tag-get_data_quandl-py","17":"tag-github","18":"tag-information-py","19":"tag-install-quandl-py","20":"tag-install-yfinance","21":"tag-jupyter-notebook","22":"tag-matplotlib","23":"tag-multiple_tickers_data-py","24":"tag-pandas","25":"tag-pandas_datareader","26":"tag-plot_amazn_data-py","27":"tag-plot_amzn_data_with_grids-py","28":"tag-quandl","29":"tag-rawplot_multiple_tickers_data-py","30":"tag-resample_data_10-py","31":"tag-revenue-py","32":"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>Stock Market Data And Analysis In Python \u2013 Part VI<\/title>\n<meta name=\"description\" content=\"Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.\" \/>\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\/105464\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stock Market Data And Analysis In Python \u2013 Part VI | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-04T16:15:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:48:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ishan Shah\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ishan Shah\" \/>\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\\\/stock-market-data-and-analysis-in-python-part-vi\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/stock-market-data-and-analysis-in-python-part-vi\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Ishan Shah\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0fd7dbae1e070042c10b53e8bdc551c5\"\n\t            },\n\t            \"headline\": \"Stock Market Data And Analysis In Python \u2013 Part VI\",\n\t            \"datePublished\": \"2021-10-04T16:15:10+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:48:09+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/stock-market-data-and-analysis-in-python-part-vi\\\/\"\n\t            },\n\t            \"wordCount\": 241,\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\\\/stock-market-data-and-analysis-in-python-part-vi\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/02\\\/digits-numbers-tech.jpg\",\n\t            \"keywords\": [\n\t                \"book.py\",\n\t                \"EBIT.py\",\n\t                \"get_data_quandl.py\",\n\t                \"GitHub\",\n\t                \"information.py\",\n\t                \"Install quandl.py\",\n\t                \"install yfinance\",\n\t                \"Jupyter Notebook\",\n\t                \"Matplotlib\",\n\t                \"multiple_tickers_data.py\",\n\t                \"Pandas\",\n\t                \"pandas_datareader\",\n\t                \"plot_amazn_data.py\",\n\t                \"plot_amzn_data_with_grids.py\",\n\t                \"Quandl\",\n\t                \"rawplot_multiple_tickers_data.py\",\n\t                \"resample_data_10.py\",\n\t                \"Revenue.py\"\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\\\/stock-market-data-and-analysis-in-python-part-vi\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/stock-market-data-and-analysis-in-python-part-vi\\\/\",\n\t            \"name\": \"Stock Market Data And Analysis In Python \u2013 Part VI | IBKR Quant Blog\",\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\\\/stock-market-data-and-analysis-in-python-part-vi\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/stock-market-data-and-analysis-in-python-part-vi\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/02\\\/digits-numbers-tech.jpg\",\n\t            \"datePublished\": \"2021-10-04T16:15:10+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:48:09+00:00\",\n\t            \"description\": \"Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.\",\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\\\/stock-market-data-and-analysis-in-python-part-vi\\\/\"\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\\\/stock-market-data-and-analysis-in-python-part-vi\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/02\\\/digits-numbers-tech.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/02\\\/digits-numbers-tech.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 540,\n\t            \"caption\": \"Quant\"\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\\\/0fd7dbae1e070042c10b53e8bdc551c5\",\n\t            \"name\": \"Ishan Shah\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/ishanshah\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Stock Market Data And Analysis In Python \u2013 Part VI","description":"Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.","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\/105464\/","og_locale":"en_US","og_type":"article","og_title":"Stock Market Data And Analysis In Python \u2013 Part VI | IBKR Quant Blog","og_description":"Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/","og_site_name":"IBKR Campus US","article_published_time":"2021-10-04T16:15:10+00:00","article_modified_time":"2022-11-21T14:48:09+00:00","og_image":[{"width":900,"height":540,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg","type":"image\/jpeg"}],"author":"Ishan Shah","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ishan Shah","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/"},"author":{"name":"Ishan Shah","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0fd7dbae1e070042c10b53e8bdc551c5"},"headline":"Stock Market Data And Analysis In Python \u2013 Part VI","datePublished":"2021-10-04T16:15:10+00:00","dateModified":"2022-11-21T14:48:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/"},"wordCount":241,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg","keywords":["book.py","EBIT.py","get_data_quandl.py","GitHub","information.py","Install quandl.py","install yfinance","Jupyter Notebook","Matplotlib","multiple_tickers_data.py","Pandas","pandas_datareader","plot_amazn_data.py","plot_amzn_data_with_grids.py","Quandl","rawplot_multiple_tickers_data.py","resample_data_10.py","Revenue.py"],"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\/stock-market-data-and-analysis-in-python-part-vi\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/","name":"Stock Market Data And Analysis In Python \u2013 Part VI | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg","datePublished":"2021-10-04T16:15:10+00:00","dateModified":"2022-11-21T14:48:09+00:00","description":"Find practical examples on how to fetch the latest price to book ratio and price to earnings ratio with book.py.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/stock-market-data-and-analysis-in-python-part-vi\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg","width":900,"height":540,"caption":"Quant"},{"@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\/0fd7dbae1e070042c10b53e8bdc551c5","name":"Ishan Shah","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/ishanshah\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/02\/digits-numbers-tech.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/105464","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\/517"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=105464"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/105464\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/36684"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=105464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=105464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=105464"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=105464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}