{"id":161380,"date":"2022-10-12T09:52:00","date_gmt":"2022-10-12T13:52:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=161380"},"modified":"2022-11-21T09:58:59","modified_gmt":"2022-11-21T14:58:59","slug":"how-to-create-a-progress-bar-in-python","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/","title":{"rendered":"How to Create a Progress Bar in Python"},"content":{"rendered":"\n<p>Creating a progress bar is really useful if you have a long-running task and you\u2019d like to know how far along you are. In this post we\u2019ll talk about two packages for creating progress bars in&nbsp;<a href=\"https:\/\/theautomatic.net\/category\/python\/\">Python<\/a>:&nbsp;<strong>tqdm<\/strong>&nbsp;and&nbsp;<strong>progressbar2<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-creating-a-progress-bar-with-python-s-tqdm-package\"><strong>Creating a progress bar with Python\u2019s tqdm package<\/strong><\/h2>\n\n\n\n<p>Let\u2019s get started by installing&nbsp;<strong>tqdm<\/strong>. We can do that using pip:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install tqdm<\/code><\/pre>\n\n\n\n<p>Once we have&nbsp;<strong>tqdm<\/strong>&nbsp;installed, it\u2019s straightforward to use. Essentially, we just need to wrap whatever object we\u2019re looping over (i.e. any object that is iterable) inside&nbsp;<em>tqdm<\/em>. Then, when the code runs, Python will print out a progress bar so that you can know how far along you are.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from tqdm import tqdm\n \nresult = 0\nfor i in tqdm(range(10000000)):\n    result += i<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"48\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-tqdm-package-the-automatic-net.jpg\" alt=\"\" class=\"wp-image-161388 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-tqdm-package-the-automatic-net.jpg 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-tqdm-package-the-automatic-net-300x23.jpg 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/48;\" \/><\/figure>\n\n\n\n<p><strong>tqdm<\/strong>&nbsp;can also be used in list or dictionary comprehensions, like below. In this case, we use&nbsp;<strong>tqdm<\/strong>&nbsp;to give us the progress status of&nbsp;<a href=\"https:\/\/theautomatic.net\/yahoo_fin-documentation\/\">scraping price data for a collection of stocks<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import yahoo_fin.stock_info as si\n \ntickers = si.tickers_dow()\n \nstocks = &#91;si.get_data(ticker) for ticker in tqdm(tickers)]<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"166\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-create-progress-bar-the-automatic-net.jpg\" alt=\"\" class=\"wp-image-161389 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-create-progress-bar-the-automatic-net.jpg 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-create-progress-bar-the-automatic-net-300x78.jpg 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/166;\" \/><\/figure>\n\n\n\n<p><strong>tqdm<\/strong>&nbsp;can also be utilized in asynchronous processes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from tqdm.asyncio import trange, tqdm\nasync for i in trange(100):\n    print(i)<\/code><\/pre>\n\n\n\n<p>You can learn more about&nbsp;<strong>tqdm<\/strong>&nbsp;by checking out its documentation&nbsp;<a href=\"https:\/\/tqdm.github.io\/\">here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The progressbar2 package<\/strong><\/h3>\n\n\n\n<p>Another option is to use the&nbsp;<strong>progressbar2<\/strong>&nbsp;package. Similar to above, we can install&nbsp;<strong>progressbar2<\/strong>&nbsp;using pip:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install progressbar2<\/code><\/pre>\n\n\n\n<p>We can replicate our example above using&nbsp;<strong>progressbar2<\/strong>&nbsp;instead of&nbsp;<strong>tqdm<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import progressbar\n \ntickers = si.tickers_dow()\n \ndata = {ticker : si.get_data(ticker) for ticker in tickers}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"48\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-progressbar2-the-automatic-net.jpg\" alt=\"\" class=\"wp-image-161391 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-progressbar2-the-automatic-net.jpg 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-progressbar2-the-automatic-net-300x23.jpg 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/48;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Creating progress bars on unknown length<\/strong><\/h3>\n\n\n\n<p><strong>progessbar2<\/strong>&nbsp;also handles progress bars with unknown length. For example, let\u2019s take a look at the below code. Here, we have a while loop that runs continuously until the seconds of the current time equals 30. This can be useful at letting you know how much time has elapsed while a piece of code is running.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bar = progressbar.ProgressBar(max_value=progressbar.UnknownLength)\ni = 0\nwhile True:\n    i += 1\n    if time.localtime().tm_sec == 30:\n        break\n    bar.update(i)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"144\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/progress-bar-unknown-length-python-the-automatic-net.jpg\" alt=\"\" class=\"wp-image-161392 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/progress-bar-unknown-length-python-the-automatic-net.jpg 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/progress-bar-unknown-length-python-the-automatic-net-300x68.jpg 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/144;\" \/><\/figure>\n\n\n\n<p><strong>Other types of progress bars<\/strong><\/p>\n\n\n\n<p>The&nbsp;<strong>progressbar2<\/strong>&nbsp;package offers a collection of other progress bar types. For example, we can generate a minimalistic bar that shows just the percentage of how far the process has gone along.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bar = progressbar.ProgressBar(\n    widgets=&#91;\n        progressbar.Percentage()\n    ])\n \n     \nfor i in bar(range(1000)):\n    time.sleep(0.1)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"429\" height=\"191\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-percentage-progress-bar-the-automatic-net.jpg\" alt=\"\" class=\"wp-image-161393 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-percentage-progress-bar-the-automatic-net.jpg 429w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-percentage-progress-bar-the-automatic-net-300x134.jpg 300w\" data-sizes=\"(max-width: 429px) 100vw, 429px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 429px; aspect-ratio: 429\/191;\" \/><\/figure>\n\n\n\n<p>Here\u2019s another example, where the progress bar slides back and forth until the loop is finished.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bar = progressbar.ProgressBar(\n    widgets=&#91;\n        progressbar.BouncingBar()\n    ])\n \n     \nfor i in bar(range(1000)):\n    time.sleep(0.1)<\/code><\/pre>\n\n\n\n<p>To learn more about&nbsp;<strong>progressbar2<\/strong>,&nbsp;<a href=\"https:\/\/pypi.org\/project\/progressbar2\/\">see this link<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><\/strong><\/h2>\n\n\n\n<p>That\u2019s all for now! If you liked learning how to create a progress bar with Python, please share this post with your friends. Learn more about Python \/ R \/ data science by&nbsp;<a href=\"https:\/\/365datascience.teachable.com\/courses\/data-scientist-career-track?affcode=130400_ubcdm-g4\">checking out 365 Data Science\u2019s great platform here<\/a>, which includes my course on web scraping and APIs!<\/p>\n\n\n\n<p><em>Visit <a href=\"https:\/\/theautomatic.net\/2020\/10\/12\/how-to-create-a-progress-bar-in-python\/\">TheAutomatic.net<\/a> for additional insight on this topic and to download the Python scripts.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.<\/p>\n","protected":false},"author":388,"featured_media":161387,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,341,352,344],"tags":[806,595,12384],"contributors-categories":[13695],"class_list":{"0":"post-161380","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-development","12":"category-quant-north-america","13":"category-quant-regions","14":"tag-data-science","15":"tag-python","16":"tag-yahoo-finance-library","17":"contributors-categories-theautomatic-net"},"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.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Create a Progress Bar in Python | IBKR Quant<\/title>\n<meta name=\"description\" content=\"In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.\" \/>\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\/161380\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Progress Bar in Python | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-12T13:52:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:58:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrew Treadway\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Treadway\" \/>\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\">{\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\\\/how-to-create-a-progress-bar-in-python\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-create-a-progress-bar-in-python\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Andrew Treadway\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\"\n\t            },\n\t            \"headline\": \"How to Create a Progress Bar in Python\",\n\t            \"datePublished\": \"2022-10-12T13:52:00+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:58:59+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-create-a-progress-bar-in-python\\\/\"\n\t            },\n\t            \"wordCount\": 426,\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\\\/how-to-create-a-progress-bar-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/10\\\/python-hand-blue-background.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Python\",\n\t                \"Yahoo finance library\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"Quant North America\",\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\\\/how-to-create-a-progress-bar-in-python\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-create-a-progress-bar-in-python\\\/\",\n\t            \"name\": \"How to Create a Progress Bar in Python | 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\\\/how-to-create-a-progress-bar-in-python\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-create-a-progress-bar-in-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/10\\\/python-hand-blue-background.jpg\",\n\t            \"datePublished\": \"2022-10-12T13:52:00+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:58:59+00:00\",\n\t            \"description\": \"In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.\",\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\\\/how-to-create-a-progress-bar-in-python\\\/\"\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\\\/how-to-create-a-progress-bar-in-python\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/10\\\/python-hand-blue-background.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/10\\\/python-hand-blue-background.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant Python\"\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\\\/d4018570a16fb867f1c08412fc9c64bc\",\n\t            \"name\": \"Andrew Treadway\",\n\t            \"description\": \"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \\\/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\\\/\\\/www.linkedin.com\\\/in\\\/andrew-treadway-a3b19b103\\\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.\",\n\t            \"sameAs\": [\n\t                \"https:\\\/\\\/theautomatic.net\\\/about-me\\\/\"\n\t            ],\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/andrewtreadway\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Create a Progress Bar in Python | IBKR Quant","description":"In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.","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\/161380\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Progress Bar in Python | IBKR Quant Blog","og_description":"In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/","og_site_name":"IBKR Campus US","article_published_time":"2022-10-12T13:52:00+00:00","article_modified_time":"2022-11-21T14:58:59+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg","type":"image\/jpeg"}],"author":"Andrew Treadway","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Treadway","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/"},"author":{"name":"Andrew Treadway","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc"},"headline":"How to Create a Progress Bar in Python","datePublished":"2022-10-12T13:52:00+00:00","dateModified":"2022-11-21T14:58:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/"},"wordCount":426,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg","keywords":["Data Science","Python","Yahoo finance library"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development","Quant North America","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/","name":"How to Create a Progress Bar in Python | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg","datePublished":"2022-10-12T13:52:00+00:00","dateModified":"2022-11-21T14:58:59+00:00","description":"In this post we\u2019ll talk about two packages for creating progress bars in\u00a0Python:\u00a0tqdm\u00a0and\u00a0progressbar2.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-create-a-progress-bar-in-python\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg","width":1000,"height":563,"caption":"Quant Python"},{"@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\/d4018570a16fb867f1c08412fc9c64bc","name":"Andrew Treadway","description":"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\/\/www.linkedin.com\/in\/andrew-treadway-a3b19b103\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.","sameAs":["https:\/\/theautomatic.net\/about-me\/"],"url":"https:\/\/www.interactivebrokers.com\/campus\/author\/andrewtreadway\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2022\/10\/python-hand-blue-background.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/161380","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\/388"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=161380"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/161380\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/161387"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=161380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=161380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=161380"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=161380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}