{"id":184716,"date":"2023-02-07T18:00:00","date_gmt":"2023-02-07T23:00:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/traders-insight\/python-fixing-the-random-seed-for-reproducibility\/"},"modified":"2023-02-13T15:16:37","modified_gmt":"2023-02-13T20:16:37","slug":"python-fixing-the-random-seed-for-reproducibility","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/","title":{"rendered":"Python: Fixing the Random Seed for Reproducibility"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This post shows how to fix the random seed to get reproducible results with Keras.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-setting-random-seeds-fixed\">Setting random seeds fixed<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For an illustration, a simple DNN model is implemented in the Jupyter Notebook using a function for fixing the random seed. The function&nbsp;<strong>seed_everything()<\/strong>&nbsp;is borrowed from https:\/\/dacon.io\/codeshare\/2363.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every time we run this code as a whole, the result is always&nbsp;96.562645&nbsp;and is not changed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Import library and define functions\n \n# In&#91;1]:\n_________________________________________________________________\nfrom keras.models import Sequential\nfrom keras.layers import Dense\n \nimport tensorflow as tf\nimport numpy as np\nimport random\nimport os\n \ndef seed_everything(seed: int = 42):\n    random.seed(seed)\n    np.random.seed(seed)\n    os.environ&#91;\"PYTHONHASHSEED\"] = str(seed)\n    tf.random.set_seed(seed)\n_________________________________________________________________\n \n# Simple DNN model with a fixed random seed \n# In&#91;2]:\n_________________________________________________________________\nx = np.array(&#91;&#91;10, 20, 30], &#91;20, 30, 40], &#91;30, 40, 50], &#91;40, 50, 60]])\ny = np.array(&#91;40, 50, 60, 70])\n \nseed_everything(1) # fix the random seed\n \nmodel = Sequential()\nmodel.add(Dense(50, activation='relu', input_dim=3))\nmodel.add(Dense(1))\nmodel.compile(optimizer='adam', loss='mse')\nmodel.fit(x, y, epochs=1000, verbose=0)\n \nx_input = np.array(&#91;60, 70, 80])\nx_input = x_input.reshape((1,3))\npred = model.predict(x_input, verbose=0)\nprint(pred)\n_________________________________________________________________\n \n&#91;&#91;96.562645]]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Robustness checks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">However, when we reuse and rerun some parts of the above code in the same file, we can encounter some unexpected results as follows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># rerun model fit\n# In&#91;3]:\n_________________________________________________________________\nmodel.fit(x, y, epochs=1000, verbose=0)\nx_input = np.array(&#91;60, 70, 80])\nx_input = x_input.reshape((1,3))\npred = model.predict(x_input, verbose=0)\nprint(pred)\n_________________________________________________________________\n&#91;&#91;90.000145]]\n \n# rerun model.fit with a fixed random seed\n# In&#91;4]:\n_________________________________________________________________\nseed_everything(1)\n \nmodel.fit(x, y, epochs=1000, verbose=0)\nx_input = np.array(&#91;60, 70, 80])\nx_input = x_input.reshape((1,3))\npred = model.predict(x_input, verbose=0)\nprint(pred)\n_________________________________________________________________\n&#91;&#91;90.00001]]\n \n \n# rerun model.compile &amp; model.fit with a fixed random seed\n# In&#91;5]:\n_________________________________________________________________\nseed_everything(1)\n \nmodel.compile(optimizer='adam', loss='mse')\nmodel.fit(x, y, epochs=1000, verbose=0)\nx_input = np.array(&#91;60, 70, 80])\nx_input = x_input.reshape((1,3))\npred = model.predict(x_input, verbose=0)\nprint(pred)\n_________________________________________________________________\n&#91;&#91;89.99999]]\n \n# call seed_everything(1) model = Sequential()\n# In&#91;6]:\n_________________________________________________________________\nseed_everything(1)\n \nmodel = Sequential()\nmodel.add(Dense(50, activation='relu', input_dim=3))\nmodel.add(Dense(1))\nmodel.compile(optimizer='adam', loss='mse')\nmodel.fit(x, y, epochs=1000, verbose=0)\nx_input = np.array(&#91;60, 70, 80])\nx_input = x_input.reshape((1,3))\npred = model.predict(x_input, verbose=0)\nprint(pred)\n_________________________________________________________________\n&#91;&#91;96.562645]]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The bottom line is that to reproduce always the same result of the same model several times in one file,&nbsp;<strong>seed_everything()<\/strong>&nbsp;function needs to be located before&nbsp;<strong>model = Sequential()<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally posted on <a href=\"https:\/\/kiandlee.blogspot.com\/2023\/02\/python-fixing-random-seed-for.html\">SH Fintech Modeling Blog<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post shows how to fix the random seed to get reproducible results with Keras.<\/p>\n","protected":false},"author":662,"featured_media":183269,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[339,343,349,338,350,341,344],"tags":[806,827,1225,595,924],"contributors-categories":[13728],"class_list":["post-184716","post","type-post","status-publish","format-standard","has-post-thumbnail","category-data-science","category-programing-languages","category-python-development","category-ibkr-quant-news","category-quant-asia-pacific","category-quant-development","category-quant-regions","tag-data-science","tag-keras","tag-numpy","tag-python","tag-tensorflow","contributors-categories-sh-fintech-modeling"],"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 v28.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python: Fixing the Random Seed for Reproducibility<\/title>\n<meta name=\"description\" content=\"This post shows how to fix the random seed to get reproducible results with Keras.\" \/>\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\/184716\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python: Fixing the Random Seed for Reproducibility\" \/>\n<meta property=\"og:description\" content=\"This post shows how to fix the random seed to get reproducible results with Keras.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-07T23:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-13T20:16:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/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=\"Sang-Heon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Python: Fixing the Random Seed for Reproducibility\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sang-Heon Lee\" \/>\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\\\/python-fixing-the-random-seed-for-reproducibility\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-fixing-the-random-seed-for-reproducibility\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Sang-Heon Lee\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0a959ff9de7f0465a07baa1fe1ae0200\"\n\t            },\n\t            \"headline\": \"Python: Fixing the Random Seed for Reproducibility\",\n\t            \"datePublished\": \"2023-02-07T23:00:00+00:00\",\n\t            \"dateModified\": \"2023-02-13T20:16:37+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-fixing-the-random-seed-for-reproducibility\\\/\"\n\t            },\n\t            \"wordCount\": 145,\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\\\/python-fixing-the-random-seed-for-reproducibility\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/python-hand-blue-background.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Keras\",\n\t                \"NumPy\",\n\t                \"Python\",\n\t                \"TensorFlow\"\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\\\/python-fixing-the-random-seed-for-reproducibility\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-fixing-the-random-seed-for-reproducibility\\\/\",\n\t            \"name\": \"Python: Fixing the Random Seed for Reproducibility\",\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\\\/python-fixing-the-random-seed-for-reproducibility\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/python-fixing-the-random-seed-for-reproducibility\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/python-hand-blue-background.jpg\",\n\t            \"datePublished\": \"2023-02-07T23:00:00+00:00\",\n\t            \"dateModified\": \"2023-02-13T20:16:37+00:00\",\n\t            \"description\": \"This post shows how to fix the random seed to get reproducible results with Keras.\",\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\\\/python-fixing-the-random-seed-for-reproducibility\\\/\"\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\\\/python-fixing-the-random-seed-for-reproducibility\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/python-hand-blue-background.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/02\\\/python-hand-blue-background.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"How To Place Orders Using the IBKR TWS Python API\"\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\\\/0a959ff9de7f0465a07baa1fe1ae0200\",\n\t            \"name\": \"Sang-Heon Lee\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/sang-heonlee\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python: Fixing the Random Seed for Reproducibility","description":"This post shows how to fix the random seed to get reproducible results with Keras.","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\/184716\/","og_locale":"en_US","og_type":"article","og_title":"Python: Fixing the Random Seed for Reproducibility","og_description":"This post shows how to fix the random seed to get reproducible results with Keras.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/","og_site_name":"IBKR Campus US","article_published_time":"2023-02-07T23:00:00+00:00","article_modified_time":"2023-02-13T20:16:37+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/python-hand-blue-background.jpg","type":"image\/jpeg"}],"author":"Sang-Heon Lee","twitter_card":"summary_large_image","twitter_title":"Python: Fixing the Random Seed for Reproducibility","twitter_misc":{"Written by":"Sang-Heon Lee","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/"},"author":{"name":"Sang-Heon Lee","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0a959ff9de7f0465a07baa1fe1ae0200"},"headline":"Python: Fixing the Random Seed for Reproducibility","datePublished":"2023-02-07T23:00:00+00:00","dateModified":"2023-02-13T20:16:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/"},"wordCount":145,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/python-hand-blue-background.jpg","keywords":["Data Science","Keras","NumPy","Python","TensorFlow"],"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\/python-fixing-the-random-seed-for-reproducibility\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/","name":"Python: Fixing the Random Seed for Reproducibility","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/python-hand-blue-background.jpg","datePublished":"2023-02-07T23:00:00+00:00","dateModified":"2023-02-13T20:16:37+00:00","description":"This post shows how to fix the random seed to get reproducible results with Keras.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/python-fixing-the-random-seed-for-reproducibility\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/python-hand-blue-background.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/python-hand-blue-background.jpg","width":1000,"height":563,"caption":"How To Place Orders Using the IBKR TWS Python API"},{"@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\/0a959ff9de7f0465a07baa1fe1ae0200","name":"Sang-Heon Lee","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/sang-heonlee\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/02\/python-hand-blue-background.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/184716","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\/662"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=184716"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/184716\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/183269"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=184716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=184716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=184716"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=184716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}