{"id":140279,"date":"2022-05-25T10:50:27","date_gmt":"2022-05-25T14:50:27","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=140279"},"modified":"2022-11-21T09:54:50","modified_gmt":"2022-11-21T14:54:50","slug":"the-brass-tacks-of-julia-programming-part-ii","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/","title":{"rendered":"The Brass Tacks of Julia Programming &#8211; Part II"},"content":{"rendered":"\n<p><em>See <a href=\"\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-i\/\">Part I<\/a> for instructions on basic arithmetic operations.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"working-with-matrices\">Working with matrices<\/h2>\n\n\n\n<p>A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>matrix_1 = &#91;&#91;1 2 3 ]; &#91;4 5 6]]\n<\/code><\/pre>\n\n\n\n<p>Here\u2019s what it looks like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n2\u00d73 Matrix{Int64}:\n1 2  3\n4 5  6<\/code><\/pre>\n\n\n\n<p>Let\u2019s look at various other operations in a matrix.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Size of a matrix\nprint(\"This size of the matrix is\" , size(matrix_1))\n\n# Matrix\nmatrix_2 = &#91;&#91;2 2 0 ]; &#91;2 7 9]]\n\n#Transpose of a matrix\nmatrix_2'\n\n# Accessing matrix elements\nmatrix_2&#91;2,3]\nmatrix_2&#91;1:4]<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\nThe size of the matrix is (2, 3)\n\n2\u00d73 Matrix{Int64}:\n2 2  0\n2 7  9\n\n9\n\n4-element Vector{Int64}:\n2\n2\n2\n7<\/code><\/pre>\n\n\n\n<p>Let\u2019s add and multiply matrices now.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Adding matrices\nmatrix_2 + matrix_1\nmatrix_3 = &#91;&#91;2 3] ; &#91;5 6] ; &#91;4 5]]\n\n# Multiplying matrices\nmatrix_1 * matrix_3<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>The output of addition is -\n2\u00d73 Matrix{Int64}:\n3 4   3\n6 12  15\n\nThe output of multiplication is -\n2\u00d72 Matrix{Int64}:\n24  30\n57  72<\/code><\/pre>\n\n\n\n<p>Performing the elementwise operation in Julia using the &#8220;.&#8221; symbol. Any operation followed by &#8220;.&#8221; will perform. Here\u2019s an example of taking the log of each element of a matrix. It is equivalent to the map() function in Python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># element wise operation.\n\nlog.(matrix_1)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n2\u00d73 Matrix{Float64}:\n0.0 0.693147  1.09861\n1.38629 1.60944   1.79176<\/code><\/pre>\n\n\n\n<p>Let\u2019s create a matrix with zeros and ones. You can use the function zeros() and ones() to do that.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zero = zeros(3,4)\none = ones(2,3)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n3\u00d74 Matrix{Float64}:\n0.0 0.0  0.0  0.0\n0.0 0.0  0.0  0.0\n0.0 0.0  0.0  0.0\n\n2\u00d73 Matrix{Float64}:\n1.0 1.0  1.0\n1.0 1.0  1.0<\/code><\/pre>\n\n\n\n<p>Let\u2019s see how to generate random values.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rand_1 = rand(5)\n\n# Random values in 2D\nrand_2 = rand(5, 2)\n\n# Random values in 3D\nrand_3 = rand(3, 2, 2)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n5-element Vector{Float64}:\n0.24942793903668203\n0.8454642816997531\n0.8538602946052574\n0.21154126925067507\n0.07873330355017316\n\n5\u00d72 Matrix{Float64}:\n0.706975 0.935989\n0.494324 0.988657\n0.994824 0.943832\n0.44183 0.404011\n0.802337 0.124313\n\n3\u00d72\u00d72 Array{Float64, 3}:\n&#91;:, :, 1] =\n0.443337 0.813706\n0.958816 0.53124\n0.203751 0.951473\n\n&#91;:, :, 2] =\n0.125259 0.761672\n0.440907 0.0505402\n0.161741 0.672215<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"loops\">Loops<\/h2>\n\n\n\n<p>A loop helps in performing the same task repeatedly. &nbsp;There are multiple types of loops used in programming . Mostly, they are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>For loop<\/strong>&nbsp;&#8211; This type of loop is used when the no. of iterations to be run are known beforehand.<\/li><li><strong>While loop<\/strong>&nbsp;&#8211; This type of loop is used when the no. of iterations depends on a condition.<\/li><\/ul>\n\n\n\n<p>Let\u2019s see how to create them in Julia.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>## While loop\n\nvar = 0\nwhile var &lt; 10\nvar += 1\nprintln(var)\nend<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>## For loop\n\n# Method 1\nfor i in 1:10\nprintln(i)\nend\n\n# Method 2\ncolleagues = &#91;\"Vivek\", \"Jay\", \"Mario\", \"Udisha\"]\nfor colleague in colleagues\nprintln(colleague)\nend\n\n# Method 3\nc = &#91;i+j for i in 1:3, j in 1:5]<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\nThe output of method 1 -\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n\nThe output of method 2 -\nVivek\nJay\nMario\nUdisha\n\nThe output of method 3 -\n3\u00d75 Matrix{Int64}:\n2 3  4  5  6\n3 4  5  6  7\n4 5  6  7  8<\/code><\/pre>\n\n\n\n<p>There are multiple methods of performing the same operations in any programming language. Feel free to take your own approach.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conditional-statements\">Conditional statements<\/h2>\n\n\n\n<p>Let\u2019s move on to the conditional statements. These are if-else conditional statements where you want to perform an operation when a certain event occurs. Here\u2019s the control flow.<\/p>\n\n\n\n<p>Here\u2019s the syntax &#8211;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if condition 1\nprintln(\u201cStatements if condition 1 is true\u201d)\nelse\nprintln(\u201cStatements if condition 1 is false\u201d)\nend<\/code><\/pre>\n\n\n\n<p>Here\u2019s how you can do it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var_1 = 31\nvar_2 = 45\n\n# Method 1\nif var_1 &gt; var_2\nprintln(\"$var_1 is larger than $var_2\")\nelseif var_2 &gt; var_1\nprintln(\"$var_2 is larger than $var_1\")\nelse\nprintln(\"None\")\nend\n\n# Method 2\n# condition ? True:False\n(var_1 &gt; var_2) ? var_1 : var_2\n\n# Method 3\n# &amp;&amp; is logical \"and\" operator\n(var_1 &gt; var_2) &amp;&amp; &#91;22] println(\"$var_1 is larger than $var_2\")\n(var_2 &gt; var_1) &amp;&amp; println(\"$var_2 is larger than $var_1\")<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n45 is larger than 31\n\n45\n\nfalse\n\n45 is larger than 31<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"functions\">Functions<\/h2>\n\n\n\n<p>Functions are a set of instructions written together so that they can be used multiple times without writing the code repeatedly.<\/p>\n\n\n\n<p>Creating functions also helps debug the code easily as you can look at individual blocks (functions) and figure out the one with the error.<\/p>\n\n\n\n<p>Here\u2019s how we can write functions in Julia:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Method 1\nfunction power_5(var_1)\nreturn var_1^5\nend\n\n# Calling the function\npower_5(4)\n\n# Method 2\npower_5(x) = x^5\npower_5(4)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Output:\n\n1024\n1024<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><em>Stay tuned for the next installment in which Anshul Tayal will show us how to use R and Python code in Julia<\/em>.<\/p>\n\n\n\n<p><em>Visit QuantInsti for additional insight on this article:&nbsp;<a href=\"https:\/\/blog.quantinsti.com\/julia-syntax\/\">https:\/\/blog.quantinsti.com\/julia-syntax\/<\/a><\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.<\/p>\n","protected":false},"author":726,"featured_media":67374,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,348,343,338,350,341,344],"tags":[11908,806,11844,7560,11848,1006,11909,923,11907,11906,11845,11846,11847],"contributors-categories":[13654],"class_list":{"0":"post-140279","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-julia-development","9":"category-programing-languages","10":"category-ibkr-quant-news","11":"category-quant-asia-pacific","12":"category-quant-development","13":"category-quant-regions","14":"tag-conditional-statements","15":"tag-data-science","16":"tag-data-structures","17":"tag-data-visualization","18":"tag-dictionaries","19":"tag-fintech","20":"tag-functions","21":"tag-julia-programming","22":"tag-loops","23":"tag-matrices","24":"tag-strings","25":"tag-tuples","26":"tag-vectors","27":"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.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>The Brass Tacks of Julia Programming &#8211; Part II<\/title>\n<meta name=\"description\" content=\"A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.\" \/>\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\/140279\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Brass Tacks of Julia Programming - Part II | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-25T14:50:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:54:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Anshul Tayal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anshul Tayal\" \/>\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\\\/the-brass-tacks-of-julia-programming-part-ii\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/the-brass-tacks-of-julia-programming-part-ii\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Anshul Tayal\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0245cc6a849222af1786952c9764fb11\"\n\t            },\n\t            \"headline\": \"The Brass Tacks of Julia Programming &#8211; Part II\",\n\t            \"datePublished\": \"2022-05-25T14:50:27+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:54:50+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/the-brass-tacks-of-julia-programming-part-ii\\\/\"\n\t            },\n\t            \"wordCount\": 358,\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\\\/the-brass-tacks-of-julia-programming-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/11\\\/binary-background-abstract.jpg\",\n\t            \"keywords\": [\n\t                \"Conditional Statements\",\n\t                \"Data Science\",\n\t                \"Data structures\",\n\t                \"Data Visualization\",\n\t                \"Dictionaries\",\n\t                \"fintech\",\n\t                \"Functions\",\n\t                \"Julia programming\",\n\t                \"Loops\",\n\t                \"Matrices\",\n\t                \"Strings\",\n\t                \"Tuples\",\n\t                \"Vectors\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Julia Development\",\n\t                \"Programming Languages\",\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\\\/the-brass-tacks-of-julia-programming-part-ii\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/the-brass-tacks-of-julia-programming-part-ii\\\/\",\n\t            \"name\": \"The Brass Tacks of Julia Programming - Part II | 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\\\/the-brass-tacks-of-julia-programming-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/the-brass-tacks-of-julia-programming-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/11\\\/binary-background-abstract.jpg\",\n\t            \"datePublished\": \"2022-05-25T14:50:27+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:54:50+00:00\",\n\t            \"description\": \"A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.\",\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\\\/the-brass-tacks-of-julia-programming-part-ii\\\/\"\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\\\/the-brass-tacks-of-julia-programming-part-ii\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/11\\\/binary-background-abstract.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2020\\\/11\\\/binary-background-abstract.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\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\\\/0245cc6a849222af1786952c9764fb11\",\n\t            \"name\": \"Anshul Tayal\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/anshultayal\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The Brass Tacks of Julia Programming &#8211; Part II","description":"A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.","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\/140279\/","og_locale":"en_US","og_type":"article","og_title":"The Brass Tacks of Julia Programming - Part II | IBKR Quant Blog","og_description":"A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/","og_site_name":"IBKR Campus US","article_published_time":"2022-05-25T14:50:27+00:00","article_modified_time":"2022-11-21T14:54:50+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg","type":"image\/jpeg"}],"author":"Anshul Tayal","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Anshul Tayal","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/"},"author":{"name":"Anshul Tayal","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0245cc6a849222af1786952c9764fb11"},"headline":"The Brass Tacks of Julia Programming &#8211; Part II","datePublished":"2022-05-25T14:50:27+00:00","dateModified":"2022-11-21T14:54:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/"},"wordCount":358,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg","keywords":["Conditional Statements","Data Science","Data structures","Data Visualization","Dictionaries","fintech","Functions","Julia programming","Loops","Matrices","Strings","Tuples","Vectors"],"articleSection":["Data Science","Julia Development","Programming Languages","Quant","Quant Asia Pacific","Quant Development","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/","name":"The Brass Tacks of Julia Programming - Part II | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg","datePublished":"2022-05-25T14:50:27+00:00","dateModified":"2022-11-21T14:54:50+00:00","description":"A matrix is an array of numbers represented as a vector of vectors. Here\u2019s how you can create a matrix.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/the-brass-tacks-of-julia-programming-part-ii\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg","width":900,"height":550,"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\/0245cc6a849222af1786952c9764fb11","name":"Anshul Tayal","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/anshultayal\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2020\/11\/binary-background-abstract.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/140279","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\/726"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=140279"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/140279\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/67374"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=140279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=140279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=140279"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=140279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}