{"id":7415,"date":"2023-09-11T09:48:39","date_gmt":"2023-09-11T17:48:39","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7415"},"modified":"2025-04-24T17:14:16","modified_gmt":"2025-04-24T17:14:16","slug":"everything-you-need-to-know-about-numpy-for-machine-learning","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/","title":{"rendered":"Everything You Need to Know About NumPy for Machine Learning"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\">\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png\" alt=\"\" width=\"700\" height=\"681\"><\/figure><div class=\"mf mg mh\"><picture><\/picture><\/div>\n<\/div><figcaption class=\"mu mv mw mf mg mx my be b bf z dv\" data-selectable-paragraph=\"\">Photo by <a class=\"af mz\" href=\"https:\/\/unsplash.com\/@jsshotz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener ugc nofollow\">Jorge Salvador<\/a> on <a class=\"af mz\" href=\"https:\/\/unsplash.com\/s\/photos\/grid?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption><\/figure>\n<p id=\"3f28\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">NumPy (Numerical Python) is a linear algebra package for Python. It is a highly significant in that it is used by practically every data science or machine learning Python package, including SciPy, Matplotlib, Scikit-learn, and many others. NumPy can perform mathematical and logical operations on arrays and has a variety of useful capabilities for matrices as well.<\/p>\n<h1 id=\"3d8b\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Why NumPy?<\/strong><\/h1>\n<p id=\"b59b\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">Python lists take a long time to execute and are much less efficient than arrays.<\/p>\n<p id=\"7164\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The power of NumPy rests in its array objects, which are up to 50 times quicker than conventional Python lists. The NumPy array object is referred to as an ndarray, which stands for <em class=\"ow\">n-dimensional array<\/em>. They have a number of supporting methods that make them very convenient.<\/p>\n<p id=\"43f8\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">In this article, we will walk through the fundamentals of NumPy as a novice in machine learning<\/strong>. This involves learning how to make NumPy arrays and how to implement different operations on NumPy arrays.<\/p>\n<h1 id=\"811a\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Creating a NumPy Array<\/strong><\/h1>\n<h2 id=\"8d8a\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Basic ndarray:<\/strong><\/h2>\n<p id=\"18b0\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">A NumPy array can be created in a variety of ways, but one of the most common ways is to create one from a list (or list-like object) by passing it to the <code class=\"cw pp pq pr ps b\">np.array<\/code> function.<\/p>\n<p id=\"4078\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Let us suppose we have a Python list called <code class=\"cw pp pq pr ps b\">listtt<\/code>. Simply build a NumPy array named <code class=\"cw pp pq pr ps b\">arr<\/code> as shown below, and display the result.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*5gbDybJUESwS4Goz\" alt=\"\" width=\"700\" height=\"190\"><\/figure><div class=\"mf mg pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*5gbDybJUESwS4Goz 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*5gbDybJUESwS4Goz 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*5gbDybJUESwS4Goz 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*5gbDybJUESwS4Goz 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*5gbDybJUESwS4Goz 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*5gbDybJUESwS4Goz 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*5gbDybJUESwS4Goz 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*5gbDybJUESwS4Goz 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*5gbDybJUESwS4Goz 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*5gbDybJUESwS4Goz 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*5gbDybJUESwS4Goz 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*5gbDybJUESwS4Goz 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*5gbDybJUESwS4Goz 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*5gbDybJUESwS4Goz 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"6bdc\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">Here, we\u2019ve simply converted a Python list into a one-dimensional array. In order to create a two-dimensional list, we will need to pass a list of lists to the <code class=\"cw pp pq pr ps b\">np.array<\/code> function, as seen below.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*cLNPyEEqdse5wQ9g\" alt=\"\" width=\"700\" height=\"229\"><\/figure><div class=\"mf mg pu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*cLNPyEEqdse5wQ9g 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*cLNPyEEqdse5wQ9g 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*cLNPyEEqdse5wQ9g 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*cLNPyEEqdse5wQ9g 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*cLNPyEEqdse5wQ9g 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*cLNPyEEqdse5wQ9g 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*cLNPyEEqdse5wQ9g 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*cLNPyEEqdse5wQ9g 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*cLNPyEEqdse5wQ9g 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*cLNPyEEqdse5wQ9g 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*cLNPyEEqdse5wQ9g 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*cLNPyEEqdse5wQ9g 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*cLNPyEEqdse5wQ9g 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*cLNPyEEqdse5wQ9g 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"0697\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The main difference between an array and a list is that arrays are built to accommodate vectorized operations, but Python lists are not. That is, when you apply a function, it is applied to each item in the array rather than the entire array object.<\/p>\n<h2 id=\"dcad\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Using the <\/strong><code class=\"cw pp pq pr ps b\"><strong class=\"al\">np.arange( )<\/strong><\/code><strong class=\"al\"> function:<\/strong><\/h2>\n<p id=\"1d7d\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">We can use <code class=\"cw pp pq pr ps b\">np.arange()<\/code> to generate a NumPy array, in a similar way to how the built-in <code class=\"cw pp pq pr ps b\">range()<\/code> method builds a list. Below we generate ten digits in an array.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*LGkmHRfFNn5FONaq\" alt=\"\" width=\"700\" height=\"112\"><\/figure><div class=\"mf mg pv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*LGkmHRfFNn5FONaq 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*LGkmHRfFNn5FONaq 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*LGkmHRfFNn5FONaq 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*LGkmHRfFNn5FONaq 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*LGkmHRfFNn5FONaq 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*LGkmHRfFNn5FONaq 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*LGkmHRfFNn5FONaq 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*LGkmHRfFNn5FONaq 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*LGkmHRfFNn5FONaq 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*LGkmHRfFNn5FONaq 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*LGkmHRfFNn5FONaq 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*LGkmHRfFNn5FONaq 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*LGkmHRfFNn5FONaq 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*LGkmHRfFNn5FONaq 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h2 id=\"d755\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\">Array of zeros:<\/h2>\n<p id=\"9fda\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The <code class=\"cw pp pq pr ps b\">np.zeros()<\/code> function allows you to build an array of all zeros. All you have to do is supply the array\u2019s required shape:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:699\/0*vvn2Hw9MTeesXPSB\" alt=\"\" width=\"699\" height=\"109\"><\/figure><div class=\"mf mg pw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*vvn2Hw9MTeesXPSB 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*vvn2Hw9MTeesXPSB 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*vvn2Hw9MTeesXPSB 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*vvn2Hw9MTeesXPSB 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*vvn2Hw9MTeesXPSB 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*vvn2Hw9MTeesXPSB 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1398\/0*vvn2Hw9MTeesXPSB 1398w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 699px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*vvn2Hw9MTeesXPSB 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*vvn2Hw9MTeesXPSB 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*vvn2Hw9MTeesXPSB 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*vvn2Hw9MTeesXPSB 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*vvn2Hw9MTeesXPSB 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*vvn2Hw9MTeesXPSB 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1398\/0*vvn2Hw9MTeesXPSB 1398w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 699px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"470c\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">The above array is one dimensional, but we can also create a two-dimensional array of zeros, as shown below:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:598\/0*sjIlq-2A9DVW-P0H\" alt=\"\" width=\"598\" height=\"106\"><\/figure><div class=\"mf mg px\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*sjIlq-2A9DVW-P0H 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*sjIlq-2A9DVW-P0H 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*sjIlq-2A9DVW-P0H 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*sjIlq-2A9DVW-P0H 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*sjIlq-2A9DVW-P0H 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*sjIlq-2A9DVW-P0H 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1196\/0*sjIlq-2A9DVW-P0H 1196w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 598px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*sjIlq-2A9DVW-P0H 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*sjIlq-2A9DVW-P0H 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*sjIlq-2A9DVW-P0H 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*sjIlq-2A9DVW-P0H 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*sjIlq-2A9DVW-P0H 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*sjIlq-2A9DVW-P0H 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1196\/0*sjIlq-2A9DVW-P0H 1196w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 598px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<h2 id=\"2650\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Creating an array of random numbers:<\/strong><\/h2>\n<p id=\"f187\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">Using the <code class=\"cw pp pq pr ps b\">rand()<\/code>, <code class=\"cw pp pq pr ps b\">randn()<\/code>, or <code class=\"cw pp pq pr ps b\">randint()<\/code> methods, we can produce an array of random numbers.<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<blockquote class=\"qg\"><p id=\"fdfc\" class=\"qh qi fo be qj qk ql qm qn qo qp nu dv\" data-selectable-paragraph=\"\">Avoid growing pains early by implementing MLOps best practices today. <a class=\"af mz\" href=\"https:\/\/www.comet.com\/site\/ty\/lessons-from-the-field-in-building-your-mlops-strategy\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Learn what to look out for in our notes from the field<\/a>.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<p id=\"65b4\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">We may create an array of random integers with the shape we want from a uniform distribution across 0 to 1 by using the <code class=\"cw pp pq pr ps b\">random.rand()<\/code> function.<\/p>\n<p id=\"72f5\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">For instance, if we want a one-dimensional array of four items dispersed equally from 0 to 1, we may use the code as follows:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*zwErPJkrrfoyd-LW\" alt=\"\" width=\"700\" height=\"132\"><\/figure><div class=\"mf mg qq\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*zwErPJkrrfoyd-LW 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*zwErPJkrrfoyd-LW 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*zwErPJkrrfoyd-LW 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*zwErPJkrrfoyd-LW 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*zwErPJkrrfoyd-LW 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*zwErPJkrrfoyd-LW 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*zwErPJkrrfoyd-LW 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*zwErPJkrrfoyd-LW 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*zwErPJkrrfoyd-LW 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*zwErPJkrrfoyd-LW 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*zwErPJkrrfoyd-LW 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*zwErPJkrrfoyd-LW 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*zwErPJkrrfoyd-LW 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*zwErPJkrrfoyd-LW 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"921a\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">A two-dimensional array with two rows and three columns is also possible:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*RUSPlAt2GEWvXJI8\" alt=\"\" width=\"700\" height=\"134\"><\/figure><div class=\"mf mg qq\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*RUSPlAt2GEWvXJI8 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*RUSPlAt2GEWvXJI8 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*RUSPlAt2GEWvXJI8 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*RUSPlAt2GEWvXJI8 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*RUSPlAt2GEWvXJI8 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*RUSPlAt2GEWvXJI8 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*RUSPlAt2GEWvXJI8 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*RUSPlAt2GEWvXJI8 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*RUSPlAt2GEWvXJI8 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*RUSPlAt2GEWvXJI8 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*RUSPlAt2GEWvXJI8 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*RUSPlAt2GEWvXJI8 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*RUSPlAt2GEWvXJI8 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*RUSPlAt2GEWvXJI8 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h1 id=\"67c8\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\">Creating an identity matrix:<\/h1>\n<p id=\"6d81\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">When working with linear algebras, identity matrices are quite helpful. Typically, is a square matrix with two dimensions. This indicates that the number of rows and columns is equal. Identity matrices have the peculiarity that only the diagonals are 1s while the rest are 0. Identity matrices often only require one parameter.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*lS6V9zby0BZg3ZTD\" alt=\"\" width=\"700\" height=\"176\"><\/figure><div class=\"mf mg qr\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*lS6V9zby0BZg3ZTD 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*lS6V9zby0BZg3ZTD 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*lS6V9zby0BZg3ZTD 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*lS6V9zby0BZg3ZTD 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*lS6V9zby0BZg3ZTD 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*lS6V9zby0BZg3ZTD 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*lS6V9zby0BZg3ZTD 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*lS6V9zby0BZg3ZTD 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*lS6V9zby0BZg3ZTD 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*lS6V9zby0BZg3ZTD 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*lS6V9zby0BZg3ZTD 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*lS6V9zby0BZg3ZTD 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*lS6V9zby0BZg3ZTD 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*lS6V9zby0BZg3ZTD 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h2 id=\"d4a4\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Transposing a NumPy array:<\/strong><\/h2>\n<p id=\"ad73\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The <code class=\"cw pp pq pr ps b\">transpose()<\/code> method (also shortened as <code class=\"cw pp pq pr ps b\">.T()<\/code>) is another useful NumPy reshaping tool. It takes the input array and swaps the row values for the column values:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*Y99KaFgYDm3Xycnc\" alt=\"\" width=\"700\" height=\"191\"><\/figure><div class=\"mf mg qs\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*Y99KaFgYDm3Xycnc 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*Y99KaFgYDm3Xycnc 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*Y99KaFgYDm3Xycnc 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*Y99KaFgYDm3Xycnc 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*Y99KaFgYDm3Xycnc 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*Y99KaFgYDm3Xycnc 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*Y99KaFgYDm3Xycnc 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*Y99KaFgYDm3Xycnc 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*Y99KaFgYDm3Xycnc 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*Y99KaFgYDm3Xycnc 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*Y99KaFgYDm3Xycnc 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*Y99KaFgYDm3Xycnc 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*Y99KaFgYDm3Xycnc 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*Y99KaFgYDm3Xycnc 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h2 id=\"478e\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Shape of NumPy:<\/strong><\/h2>\n<p id=\"61e0\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The shape attribute of a NumPy array indicates the number of rows and columns there are along each dimension.<\/p>\n<h2 id=\"9729\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Size of NumPy array:<\/strong><\/h2>\n<p id=\"f3b1\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The size attribute can be used to identify how many values are in the array. It simply multiplies the number of rows in the ndarray by the number of columns:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*LNuM3lxMCFgrscQt\" alt=\"\" width=\"700\" height=\"179\"><\/figure><div class=\"mf mg qt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*LNuM3lxMCFgrscQt 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*LNuM3lxMCFgrscQt 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*LNuM3lxMCFgrscQt 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*LNuM3lxMCFgrscQt 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*LNuM3lxMCFgrscQt 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*LNuM3lxMCFgrscQt 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*LNuM3lxMCFgrscQt 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*LNuM3lxMCFgrscQt 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*LNuM3lxMCFgrscQt 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*LNuM3lxMCFgrscQt 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*LNuM3lxMCFgrscQt 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*LNuM3lxMCFgrscQt 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*LNuM3lxMCFgrscQt 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*LNuM3lxMCFgrscQt 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h2 id=\"c659\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\">Reshaping a NumPy array:<\/h2>\n<p id=\"083b\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The <code class=\"cw pp pq pr ps b\">np.reshape()<\/code> function can be used to reshape an ndarray:<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:596\/0*ogRDy94mY91Rv3Om\" alt=\"\" width=\"596\" height=\"162\"><\/figure><div class=\"mf mg qu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*ogRDy94mY91Rv3Om 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*ogRDy94mY91Rv3Om 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*ogRDy94mY91Rv3Om 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*ogRDy94mY91Rv3Om 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*ogRDy94mY91Rv3Om 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*ogRDy94mY91Rv3Om 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1192\/0*ogRDy94mY91Rv3Om 1192w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 596px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*ogRDy94mY91Rv3Om 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*ogRDy94mY91Rv3Om 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*ogRDy94mY91Rv3Om 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*ogRDy94mY91Rv3Om 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*ogRDy94mY91Rv3Om 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*ogRDy94mY91Rv3Om 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1192\/0*ogRDy94mY91Rv3Om 1192w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 596px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<h2 id=\"6cbf\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Arithmetic operations of NumPy:<\/strong><\/h2>\n<p id=\"216c\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">The following is a list of all the operations that can be performed on NumPy arrays.<\/p>\n<figure class=\"mi mj mk ml mm mn mf mg paragraph-image\">\n<div class=\"mo mp eb mq bg mr\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ms mt c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*NuZJQ2f7Hb96A2ls\" alt=\"\" width=\"700\" height=\"378\"><\/figure><div class=\"mf mg qv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*NuZJQ2f7Hb96A2ls 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*NuZJQ2f7Hb96A2ls 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*NuZJQ2f7Hb96A2ls 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*NuZJQ2f7Hb96A2ls 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*NuZJQ2f7Hb96A2ls 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*NuZJQ2f7Hb96A2ls 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*NuZJQ2f7Hb96A2ls 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*NuZJQ2f7Hb96A2ls 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*NuZJQ2f7Hb96A2ls 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*NuZJQ2f7Hb96A2ls 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*NuZJQ2f7Hb96A2ls 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*NuZJQ2f7Hb96A2ls 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*NuZJQ2f7Hb96A2ls 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*NuZJQ2f7Hb96A2ls 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"8ff2\" class=\"pw-post-body-paragraph na nb fo be b gm nc nd ne gp nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu fh bj\" data-selectable-paragraph=\"\">For more reference , you can have a look at the official NumPy documentation <a class=\"af mz\" href=\"https:\/\/numpy.org\/doc\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>.<\/p>\n<h2 id=\"3401\" class=\"oy nw fo be nx oz pa pb oa pc pd pe od ni pf pg ph nm pi pj pk nq pl pm pn po bj\" data-selectable-paragraph=\"\">NumPy Applications<\/h2>\n<ul class=\"\">\n<li id=\"5255\" class=\"na nb fo be b gm or nd ne gp os ng nh ni qw nk nl nm qx no np nq qy ns nt nu qz ra rb bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">Mathematical operations:<\/strong> Working with NumPy also offers simple routines for doing mathematical operations on an array data collection. In NumPy, we have several modules for performing fundamental and sophisticated mathematical functions. Linear Algebra, bitwise operations, Fourier transform, arithmetic operations, string operations, and so on are all supported.<\/li>\n<li id=\"893f\" class=\"na nb fo be b gm rc nd ne gp rd ng nh ni re nk nl nm rf no np nq rg ns nt nu qz ra rb bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">For multi-dimensional arrays: <\/strong>NumPy allows us to generate multidimensional arrays. The usage of matrices can make the code more memory efficient. To execute various operations on these matrices, we use a matrix module.<\/li>\n<li id=\"398e\" class=\"na nb fo be b gm rc nd ne gp rd ng nh ni re nk nl nm rf no np nq rg ns nt nu qz ra rb bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">Maintains minimal memory:<\/strong> Memory allocation is much lower for arrays as compared with Python lists, partially because NumPy has features to prevent memory waste in the data buffer. It also has functionality like copying, viewing, and indexing that can save memory. Indexing aids in returning the perspective of the original array, allowing for data reuse. It also identifies the element\u2019s data type, which helps code optimization.<\/li>\n<\/ul>\n<h1 id=\"6259\" class=\"nv nw fo be nx ny nz go oa ob oc gr od oe of og oh oi oj ok ol om on oo op oq bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Conclusion<\/strong>:<\/h1>\n<p id=\"1491\" class=\"pw-post-body-paragraph na nb fo be b gm or nd ne gp os ng nh ni ot nk nl nm ou no np nq ov ns nt nu fh bj\" data-selectable-paragraph=\"\">In this article, we learned how to create a NumPy array and how to perform some simple operations on NumPy arrays. If you like this post, please like and share it.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Photo by Jorge Salvador on Unsplash NumPy (Numerical Python) is a linear algebra package for Python. It is a highly significant in that it is used by practically every data science or machine learning Python package, including SciPy, Matplotlib, Scikit-learn, and many others. NumPy can perform mathematical and logical operations on arrays and has a [&hellip;]<\/p>\n","protected":false},"author":78,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"coauthors":[175],"class_list":["post-7415","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Everything You Need to Know About NumPy for Machine Learning - Comet<\/title>\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.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Everything You Need to Know About NumPy for Machine Learning\" \/>\n<meta property=\"og:description\" content=\"Photo by Jorge Salvador on Unsplash NumPy (Numerical Python) is a linear algebra package for Python. It is a highly significant in that it is used by practically every data science or machine learning Python package, including SciPy, Matplotlib, Scikit-learn, and many others. NumPy can perform mathematical and logical operations on arrays and has a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-11T17:48:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:14:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png\" \/>\n<meta name=\"author\" content=\"Anoop Painuly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anoop Painuly\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Everything You Need to Know About NumPy for Machine Learning - Comet","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.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/","og_locale":"en_US","og_type":"article","og_title":"Everything You Need to Know About NumPy for Machine Learning","og_description":"Photo by Jorge Salvador on Unsplash NumPy (Numerical Python) is a linear algebra package for Python. It is a highly significant in that it is used by practically every data science or machine learning Python package, including SciPy, Matplotlib, Scikit-learn, and many others. NumPy can perform mathematical and logical operations on arrays and has a [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-09-11T17:48:39+00:00","article_modified_time":"2025-04-24T17:14:16+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png","type":"","width":"","height":""}],"author":"Anoop Painuly","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Anoop Painuly","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/"},"author":{"name":"Anoop Painuly","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/789020ef94f9a6d9e9c44a18fc1ab67a"},"headline":"Everything You Need to Know About NumPy for Machine Learning","datePublished":"2023-09-11T17:48:39+00:00","dateModified":"2025-04-24T17:14:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/"},"wordCount":852,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png","articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/","url":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/","name":"Everything You Need to Know About NumPy for Machine Learning - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png","datePublished":"2023-09-11T17:48:39+00:00","dateModified":"2025-04-24T17:14:16+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mCykTVDqUhMbYGe78gVXRg.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/everything-you-need-to-know-about-numpy-for-machine-learning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Everything You Need to Know About NumPy for Machine Learning"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/789020ef94f9a6d9e9c44a18fc1ab67a","name":"Anoop Painuly","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/bfe7fbdf63c8ea01a62e174cb4d07a63","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1646340852140-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1646340852140-96x96.jpg","caption":"Anoop Painuly"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/painulyanoop5gmail-com\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7415"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7415\/revisions"}],"predecessor-version":[{"id":15552,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7415\/revisions\/15552"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7415"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}