	{"id":67771,"date":"2022-07-20T13:17:20","date_gmt":"2022-07-20T12:17:20","guid":{"rendered":"https:\/\/www.artefact.com\/?post_type=blog&#038;p=67771"},"modified":"2024-09-20T17:45:50","modified_gmt":"2024-09-20T16:45:50","slug":"measuring-the-co2eq-impact-of-your-python-notebook-azure-ml","status":"publish","type":"blog","link":"https:\/\/www.artefact.com\/nl\/blog\/measuring-the-co2eq-impact-of-your-python-notebook-azure-ml\/","title":{"rendered":"De CO2eq impact van uw Python Notebook meten (Azure ML)"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling article-author\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-background-color:#ffffff;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_2 1_2 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:50%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:50%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-1 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Auteur<\/h2><\/div><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27150%27%20height%3D%270%27%20viewBox%3D%270%200%20150%200%27%3E%3Crect%20width%3D%27150%27%20height%3D%270%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/03\/mae\u0308l-deschamps.jpeg\" alt=\"Image\" class=\"lazyload artefact-elegant-image align-left article-author-image\" style=\"width: 150px; border-radius: 54% 46% 77% 23% \/ 74% 40% 60% 26%; overflow: hidden;\" width=\"150\" height=\"auto\" \/><div class=\"fusion-title title fusion-title-2 fusion-sep-none fusion-title-text fusion-title-size-three article-author-name-title\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Ma\u00ebl Deschamps<\/h3><\/div><div class=\"fusion-text fusion-text-1 article-author-description\" style=\"--awb-text-transform:none;\"><p>Senior Machine Learning Ingenieur<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-margin-top:40px;--awb-margin-bottom:40px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-center fusion-flex-justify-content-center fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column fusion-flex-align-self-center fusion-column-inner-bg-wrapper\" style=\"--awb-padding-top:20px;--awb-padding-right:20px;--awb-padding-bottom:20px;--awb-padding-left:20px;--awb-overflow:hidden;--awb-inner-bg-size:cover;--awb-border-color:rgba(10,17,40,0.1);--awb-border-top:1px;--awb-border-right:1px;--awb-border-bottom:1px;--awb-border-left:1px;--awb-border-style:solid;--awb-border-radius:4px 4px 4px 4px;--awb-inner-bg-border-radius:4px 4px 4px 4px;--awb-inner-bg-overflow:hidden;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><span class=\"fusion-column-inner-bg hover-type-none\"><a class=\"fusion-column-anchor\" href=\"https:\/\/medium.com\/artefact-engineering-and-data-science\/measure-the-co2eq-impact-of-your-python-notebook-azure-ml-8cbaa01530af\" rel=\"noopener noreferrer\" target=\"_blank\"><span class=\"fusion-column-inner-bg-image\"><\/span><\/a><\/span><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-center fusion-content-layout-row fusion-flex-align-items-center\"><div class=\"fusion-text fusion-text-2\"><p><u>Lees ons artikel over<\/u><\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-margin-right:20px;--awb-margin-left:20px;--awb-max-width:150px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img decoding=\"async\" width=\"4000\" height=\"992\" title=\"Medium Blog\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog.png\" alt class=\"lazyload img-responsive wp-image-60582\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%274000%27%20height%3D%27992%27%20viewBox%3D%270%200%204000%20992%27%3E%3Crect%20width%3D%274000%27%20height%3D%27992%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-200x50.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-400x99.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-600x149.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-800x198.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog-1200x298.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/04\/Medium-Blog.png 4000w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 4000px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-3\"><p>.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-3 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-4 description\" style=\"--awb-text-transform:none;\"><p>Nadat ik in mijn eerste verhaal tijd had besteed aan codeoptimalisatie om mijn rekentijd met 90% te verminderen, was ik ge\u00efnteresseerd in het CO2-equivalent dat ik bespaarde door mijn wijzigingen. Ge\u00efnspireerd door de Microsoft DevBlog, besloot ik mijn eigen methode te ontwikkelen op basis van het artikel van Sara Bergman.<\/p>\n<\/div><\/div><\/div><\/div><\/div><article class=\"fusion-fullwidth fullwidth-box fusion-builder-row-4 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-justify-content-center fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-3 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-5\" style=\"--awb-text-transform:none;\"><p>In dit artikel doorlopen we elke fase van het proces, dat in drie verschillende delen kan worden opgesplitst:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-2 hover-type-none\"><img decoding=\"async\" width=\"1131\" height=\"264\" title=\"1Meten van de CO2eq impact van uw Python Notebook\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook.png\" alt class=\"lazyload img-responsive wp-image-67772\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271131%27%20height%3D%27264%27%20viewBox%3D%270%200%201131%20264%27%3E%3Crect%20width%3D%271131%27%20height%3D%27264%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook-200x47.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook-400x93.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook-600x140.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook-800x187.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/1Measuring-the-CO2eq-impact-of-your-Python-Notebook.png 1131w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1131px\" \/><\/span><\/div><ul style=\"--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;\" class=\"fusion-checklist fusion-checklist-1 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">De\u00a0<strong>Profilering<\/strong>, waar we data zullen verzamelen over het brongebruik van onze code<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">De <strong>Berekening<\/strong>, waar we deze bronnen zullen omzetten in energieverbruik<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">\n<p>De\u00a0<strong>Beoordeling<\/strong>, waar we dit energieverbruik zullen omzetten in impact op het milieu<\/p>\n<\/div><\/li><\/ul><div class=\"fusion-text fusion-text-6\" style=\"--awb-text-transform:none;\"><p>Elk onderdeel zal vergezeld gaan van de daadwerkelijke implementatie ervan op een notebook in Azure ML Studio.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-3 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Stap 1: De code profileren<\/h2><\/div><div class=\"fusion-text fusion-text-7\" style=\"--awb-text-transform:none;\"><p>Het doel van deze eerste stap is vrij eenvoudig: het vinden van het geheugen- en CPU-verbruik van uw code. In het geval van onze machine wordt er rekening gehouden met drie belangrijke parameters:<\/p>\n<\/div><ul style=\"--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;\" class=\"fusion-checklist fusion-checklist-2 fusion-checklist-default type-icons paddingList dark-text\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">de energie die wordt verbruikt door de CPU\/GPU<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">de energie die wordt verbruikt door het geheugengebruik<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-no\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">de energie die door het koelsysteem wordt gebruikt (Power Usage Effectiveness factor)<\/div><\/li><\/ul><div class=\"fusion-text fusion-text-8\" style=\"--awb-text-transform:none;\"><p>We kunnen online gemakkelijk informatie vinden om de Power Usage Effectiveness (PUE) te schatten, maar het meten van het CPU- \/ Geheugenverbruik van onze Python-notebook is niet zo eenvoudig. Er bestaan veel oplossingen (timeit, cProfile, psutil), maar die zijn meer gericht op tijdsprofilering dan op CPU- en geheugenverbruik.<\/p>\n<p>Omwille van eigendom en eenvoud besloot ik mijn eigen profileringsscript in Bash te coderen en het verbruik van mijn machine in een oneindige lus te meten, aangezien de code die ik moest beoordelen zich op een JupyterLab-instance bevond die op Linux (18.04.1-Ubuntu SMP) draaide.<\/p>\n<p>Het eerste script, dat werd gebruikt om elke seconde het exacte geheugengebruik te meten, werd opgeslagen als\u00a0<strong>geheugen_profiler.sh<\/strong>\u00a0:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-3 hover-type-none\"><img decoding=\"async\" width=\"1378\" height=\"700\" alt=\"Measuring the CO2eq impact of your Python Notebook (Azure ML)\" title=\"artikel De CO2eq impact van uw Python Notebook meten (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17.png\" class=\"lazyload img-responsive wp-image-67775\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271378%27%20height%3D%27700%27%20viewBox%3D%270%200%201378%20700%27%3E%3Crect%20width%3D%271378%27%20height%3D%27700%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17-200x102.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17-400x203.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17-600x305.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17-800x406.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17-1200x610.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.53.17.png 1378w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1378px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-9\" style=\"--awb-text-transform:none;\"><p>Het tweede script, dat werd gebruikt om elke seconde het gemiddelde CPU-verbruik tijdens de laatste minuut te meten, werd opgeslagen als\u00a0<strong>cpu_profiler.sh<\/strong>\u00a0:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-4 hover-type-none\"><img decoding=\"async\" width=\"1376\" height=\"482\" title=\"Beeldschermafdruk 2022-07-20 \u00e0 14.54.04\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04.png\" alt class=\"lazyload img-responsive wp-image-67776\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271376%27%20height%3D%27482%27%20viewBox%3D%270%200%201376%20482%27%3E%3Crect%20width%3D%271376%27%20height%3D%27482%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04-200x70.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04-400x140.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04-600x210.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04-800x280.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04-1200x420.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.04.png 1376w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1376px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-10\" style=\"--awb-text-transform:none;\"><p>Maar het was niet genoeg om deze twee scripts te hebben, want ik moest ook precies weten wanneer mijn code werd uitgevoerd. Hiervoor voegde ik een cel toe bovenaan mijn notitieblok:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-5 hover-type-none\"><img decoding=\"async\" width=\"1380\" height=\"328\" title=\"Beeldschermafdruk 2022-07-20 \u00e0 14.54.08\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08.png\" alt class=\"lazyload img-responsive wp-image-67777\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271380%27%20height%3D%27328%27%20viewBox%3D%270%200%201380%20328%27%3E%3Crect%20width%3D%271380%27%20height%3D%27328%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08-200x48.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08-400x95.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08-600x143.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08-800x190.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08-1200x285.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.08.png 1380w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1380px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-11\" style=\"--awb-text-transform:none;\"><p>En nog een cel, onderaan mijn notitieblok:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-6 hover-type-none\"><img decoding=\"async\" width=\"1364\" height=\"258\" title=\"Beeldschermafdruk 2022-07-20 \u00e0 14.54.13\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13.png\" alt class=\"lazyload img-responsive wp-image-67778\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271364%27%20height%3D%27258%27%20viewBox%3D%270%200%201364%20258%27%3E%3Crect%20width%3D%271364%27%20height%3D%27258%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13-200x38.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13-400x76.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13-600x113.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13-800x151.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13-1200x227.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/Capture-de\u0301cran-2022-07-20-a\u0300-14.54.13.png 1364w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1364px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-12\" style=\"--awb-text-transform:none;\"><p id=\"fdd8\" data-selectable-paragraph=\"\">Nu alles klaar was, hoefde ik alleen nog maar :<\/p>\n<p id=\"eafd\" data-selectable-paragraph=\"\">1. Zorg ervoor dat mijn omgeving niet vervuild is met andere taken die op de achtergrond draaien en sluit alle lopende instanties door op de knop Shut Down All (Alles afsluiten) te klikken.<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-7 hover-type-none\"><img decoding=\"async\" width=\"986\" height=\"218\" title=\"4Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67779\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27986%27%20height%3D%27218%27%20viewBox%3D%270%200%20986%20218%27%3E%3Crect%20width%3D%27986%27%20height%3D%27218%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x44.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x88.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x133.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x177.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/4Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 986w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 986px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-13\" style=\"--awb-text-transform:none;\"><p>2. Open een terminalinstantie om het script memory_log.sh op de achtergrond uit te voeren<\/p>\n<pre class=\"mn mo mp mq gy nf bt ng\"><strong><span id=\"a605\" class=\"gb nh km iz ni b dn nj nk l nl\" data-selectable-paragraph=\"\">.\/geheugen_log.sh<\/span><\/strong><\/pre>\n<p>3. Open een andere terminalinstantie om het script cpu_log.sh op de achtergrond uit te voeren<\/p>\n<pre class=\"mn mo mp mq gy nf bt ng\"><strong><span id=\"d386\" class=\"gb nh km iz ni b dn nj nk l nl\" data-selectable-paragraph=\"\">.\/cpu_log.sh<\/span><\/strong><\/pre>\n<p>4. Instanti\u00ebren en uitvoeren van al mijn notebookcellen<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-8 hover-type-none\"><img decoding=\"async\" width=\"1088\" height=\"138\" title=\"5Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67780\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271088%27%20height%3D%27138%27%20viewBox%3D%270%200%201088%20138%27%3E%3Crect%20width%3D%271088%27%20height%3D%27138%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x25.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x51.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x76.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x101.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/5Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1088w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1088px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-14\" style=\"--awb-text-transform:none;\"><p>Zodra het hele notitieboek is uitgevoerd, kan ik beide Linux scripts stoppen door CTRL + C in elke terminal in te drukken, controleren of mijn memory.log en cpu.log bestanden met succes zijn aangemaakt, en de begintijd en eindtijd van de uitvoering van mijn notitieboek noteren door gebruik te maken van de twee toegevoegde cellen met datetime.now().<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-9 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"207\" title=\"6Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67781\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27207%27%20viewBox%3D%270%200%201400%20207%27%3E%3Crect%20width%3D%271400%27%20height%3D%27207%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x30.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x59.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x89.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x118.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x177.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/6Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-15\" style=\"--awb-text-transform:none;\"><p>Ik had nu alles wat ik nodig had voor de volgende rekenfase.<\/p>\n<\/div><div class=\"fusion-title title fusion-title-4 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Stap 2: Omrekenen naar energie<\/h2><\/div><div class=\"fusion-text fusion-text-16\" style=\"--awb-text-transform:none;\"><p>Nu we alle data over het grondstofverbruik hebben verzameld, kunnen we beginnen met alles om te zetten in kWh, een maat voor het energieverbruik.<br \/>\nOm dat te bereiken, zullen we de volgende vergelijking gebruiken:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-10 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"640\" title=\"7Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67782\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27640%27%20viewBox%3D%270%200%201400%20640%27%3E%3Crect%20width%3D%271400%27%20height%3D%27640%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x91.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x183.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x274.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x366.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x549.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/7Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-17\" style=\"--awb-text-transform:none;\"><p><strong>Laten we eerst beginnen met de CPU-gerelateerde statistieken.<\/strong><br \/>\nAls eerste stap kopieer ik de inhoud van het cpu.log-bestand in een Google Spreadsheet die ik later zal gebruiken om mijn gemiddelde CPU-verbruik te krijgen:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-11 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"452\" title=\"8Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67783\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27452%27%20viewBox%3D%270%200%201400%20452%27%3E%3Crect%20width%3D%271400%27%20height%3D%27452%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x65.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x129.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x194.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x258.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x387.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/8Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-18\" style=\"--awb-text-transform:none;\"><p>Ik doe een paar manipulaties op mijn Sheet (Tekst naar kolom splitsen, Ongebruikte kolommen verwijderen, Kolomnamen toevoegen) om iets handigers te krijgen om te gebruiken:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-12 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"452\" title=\"9Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67784\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27452%27%20viewBox%3D%270%200%201400%20452%27%3E%3Crect%20width%3D%271400%27%20height%3D%27452%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x65.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x129.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x194.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x258.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x387.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/9Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-19\" style=\"--awb-text-transform:none;\"><p>Mijn notebook liep van 12:33:20 tot 13:14:09, dus ik kan gewoon een formule toevoegen om het gemiddelde van cpu_1 tussen die tijden weer te geven, en dat gemiddelde delen door het aantal CPU's van mijn machine:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-13 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"381\" title=\"10Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67785\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27381%27%20viewBox%3D%270%200%201400%20381%27%3E%3Crect%20width%3D%271400%27%20height%3D%27381%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x54.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x109.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x163.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x218.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x327.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/10Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-20\" style=\"--awb-text-transform:none;\"><p>Ik begrijp nu dat mijn Notebook gemiddeld het volgende gebruikt\u00a0<strong>8.038 CPU's<\/strong>\u00a0tijdens de 40 minuten van uitvoering die overeenkomen met\u00a0<strong>100,47% gemiddeld CPU-gebruik.<\/strong><br \/>\n<strong>Maar wat is het verbruik van mijn CPU?<\/strong><br \/>\nDit hangt af van het model CPU dat wordt gebruikt, ik heb meer informatie over de CPU die door mijn machine wordt gebruikt gevonden in de\u00a0<a class=\"au kk\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/virtual-machines\/sizes-general\" target=\"_blank\" rel=\"noopener ugc nofollow\">Azure Microsoft Documentatie<\/a>. Op het moment van mijn experimenten (oktober 2021) gebruikte mijn machine een van de 4 verschillende types Intel Xeon CPU:<br \/>\n- Intel Xeon Platinum 8270<br \/>\n- Intel Xeon Platinum 8171M<br \/>\n- Intel Xeon-processor E5-2697 v4<br \/>\n- Intel Xeon E5-2673 v3 @ 2,40 GHz<\/p>\n<p>Nadat ik online op de website van Intel had gekeken, kon ik CPU-modellen vergelijken met hun stroomverbruik, door gebruik te maken van het Thermal Design Power (TDP), dat staat voor het gemiddelde vermogen, in watt, dat de processor afgeeft wanneer deze op basisfrequentie werkt met alle kernen actief.<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-14 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"189\" title=\"11Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67786\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27189%27%20viewBox%3D%270%200%201400%20189%27%3E%3Crect%20width%3D%271400%27%20height%3D%27189%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x27.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x54.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x81.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x108.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x162.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/11Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-21\" style=\"--awb-text-transform:none;\"><p>Aangezien de gebruikte CPU bij elke uitvoering van mijn code kan veranderen, heb ik besloten om de gemiddelde TDP van deze vier CPU's te nemen, namelijk\u00a0<strong>158.75<\/strong>\u00a0in dat geval.<br \/>\nIk heb nu beide gevonden\u00a0<strong>Pc<\/strong>\u00a0(=1,0047) en\u00a0<strong>Cc<\/strong>\u00a0(=158.75)<\/p>\n<\/div><div class=\"fusion-text fusion-text-22\" style=\"--awb-text-transform:none;\"><p><strong>Laten we nu eens kijken naar het bestand memory.log<\/strong><\/p>\n<p>Volgens dezelfde processen als voorheen kopieer ik de inhoud van mijn bestand naar een Google Sheet, verdeel de tekst in kolommen en rangschik ze om het volgende formaat te krijgen:<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-15 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"376\" title=\"12Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67787\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27376%27%20viewBox%3D%270%200%201400%20376%27%3E%3Crect%20width%3D%271400%27%20height%3D%27376%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x54.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x107.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x161.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x215.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x322.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/12Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-23\" style=\"--awb-text-transform:none;\"><p>Vervolgens pas ik een gemiddeldeformule toe op kolom C, om de\u00a0<strong>gemiddeld geheugengebruik<\/strong>\u00a0tussen 12:33:20 en 13:14:09 in MB. Ik deel dit getal door 1024 om het om te zetten in GB.<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-16 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"376\" title=\"13Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67788\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27376%27%20viewBox%3D%270%200%201400%20376%27%3E%3Crect%20width%3D%271400%27%20height%3D%27376%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x54.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x107.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x161.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x215.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x322.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/13Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-24\" style=\"--awb-text-transform:none;\"><p>Om het stroomverbruik van \u00e9\u00e9n GB data te schatten, zal ik een vuistregel volgen die gevonden is\u00a0<a class=\"au kk\" href=\"https:\/\/www.crucial.com\/support\/articles-faq-memory\/how-much-power-does-memory-use#:~:text=As%20a%20rule%20of%20thumb,the%20voltage%20beyond%20XMP%20settings.\" target=\"_blank\" rel=\"noopener ugc nofollow\">hier<\/a>\u00a0: 3W per 8GB dus 0,375W\/GB en\u00a0<strong>1.88W<\/strong>\u00a0in totaal voor mijn geheugengebruik van 5.015GB.<\/p>\n<p>Ik heb nu het volgende gevonden\u00a0<strong>Pm<\/strong>\u00a0(=1.88). Merk op dat het vermogen dat wordt verbruikt door mijn geheugen 85 keer minder belangrijk lijkt te zijn dan het vermogen dat wordt verbruikt door mijn CPU en kan worden overgeslagen om een iets minder nauwkeurige maar snellere beoordeling te krijgen.<\/p>\n<p>Aangezien ik geen GPU gebruik, kan ik direct overgaan naar de laatste ontbrekende term: de Power Usage Effectiveness. PUE is een verhouding die bepaalt hoeveel energie het data centrum gebruikt voor iets anders dan het hosten van cloud diensten zoals koeling, compensatie van reactief vermogen, verlichting ...<\/p>\n<p>Kijken naar de\u00a0<a class=\"au kk\" href=\"http:\/\/download.microsoft.com\/download\/8\/2\/9\/8297f7c7-ae81-4e99-b1db-d65a01f7a8ef\/microsoft_cloud_infrastructure_datacenter_and_network_fact_sheet.pdf\" target=\"_blank\" rel=\"noopener ugc nofollow\">Microsoft Datacenter Factsheet van 2015<\/a>, was de gemiddelde PUE in zijn nieuwe datacenter\u00a0<strong>1.125<\/strong>. Dit is het getal dat we voor dit voorbeeld zullen gebruiken, maar een meer gedisciplineerde aanpak zal zijn om de werkelijke PUE van het data center te vinden dat we voor onze berekeningen gebruiken.<\/p>\n<p>We hebben nu alle termen van onze vergelijking, laten we gaan rekenen!<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-17 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"243\" title=\"14Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67789\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27243%27%20viewBox%3D%270%200%201400%20243%27%3E%3Crect%20width%3D%271400%27%20height%3D%27243%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x35.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x69.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x104.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x139.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x208.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/14Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-25\" style=\"--awb-text-transform:none;\"><p>Aangezien onze code werd uitgevoerd tussen 12:33:20 en 13:14:09, duurde het 40 minuten en 49 seconden om uit te voeren (wat gelijk is aan 0,68 uur). Dit betekent dat het in totaal verbruikt : 0.182 * 0.68 =\u00a0<strong>0,1238 kW<\/strong><\/p>\n<\/div><div class=\"fusion-title title fusion-title-5 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Stap 3: De impact beoordelen<\/h2><\/div><div class=\"fusion-text fusion-text-26\" style=\"--awb-text-transform:none;\"><p>Als laatste stap van onze koolstofmeetreis moeten we nu de impact van dit elektriciteitsverbruik beoordelen, die sterk afhangt van de plaats waar de energie is verbruikt. Om dit te berekenen gebruiken we de Carbon Intensity factor die we gemakkelijk kunnen vinden in\u00a0<a class=\"au kk\" href=\"https:\/\/app.electricitymap.org\/map\" target=\"_blank\" rel=\"noopener ugc nofollow\">Elektriciteitskaart website<\/a>, een project om openbare elektriciteit data uit 150 landen te verzamelen, voorbewerken en verenigen.<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-18 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"798\" title=\"15Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67790\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27798%27%20viewBox%3D%270%200%201400%20798%27%3E%3Crect%20width%3D%271400%27%20height%3D%27798%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x114.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x228.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x342.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x456.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x684.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/15Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-27\" style=\"--awb-text-transform:none;\"><p>Toen ik de CO2eq impact van mijn in Nederland draaiende code berekende, was de Carbon Impact waarde 487 gram per kW. Dat brengt de impact van mijn code op 487 * 0,1238 =\u00a0<strong>60,3 gCO2eq.<\/strong><\/p>\n<p>Deze waarde lijkt misschien laag, maar wetende dat mijn stukje code elke dag en het hele jaar draaide, werd de impact gebracht op 60,3 * 365,25 =\u00a0<strong>22,0 kgCO2eq per jaar.<\/strong><br \/>\n<strong>Maar wat stelt het voor in vergelijking met andere activiteiten?<\/strong>\u00a0Als we het bijvoorbeeld vergelijken met het gebruik van een auto en de\u00a0<a class=\"au kk\" href=\"https:\/\/www.eea.europa.eu\/ims\/co2-performance-of-new-passenger\" target=\"_blank\" rel=\"noopener ugc nofollow\">2019 gemiddelde C02-uitstoot voor alle nieuwe auto's<\/a>, is gelijk aan de voetafdruk van een reis van 180 km.<\/p>\n<p>Gebruik\u00a0<a class=\"au kk\" href=\"https:\/\/monconvertisseurco2.fr\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">monconvertisseurco2.fr<\/a>\u00a0Ik kan meer equivalente activiteiten krijgen door \u201cBase Carbon\u201d open data te gebruiken, verzameld door een organisatie van de Franse staat: het \u201cNationaal Agentschap voor Milieu en Energiebeheer\u201d of ADEME.<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-19 hover-type-none\"><img decoding=\"async\" width=\"1400\" height=\"708\" title=\"17Meten van de CO2eq impact van uw Python Notebook (Azure ML)\" src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png\" alt class=\"lazyload img-responsive wp-image-67791\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271400%27%20height%3D%27708%27%20viewBox%3D%270%200%201400%20708%27%3E%3Crect%20width%3D%271400%27%20height%3D%27708%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-200x101.png 200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-400x202.png 400w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-600x303.png 600w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-800x405.png 800w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML-1200x607.png 1200w, https:\/\/www.artefact.com\/\/wp-content\/uploads\/2022\/07\/17Measuring-the-CO2eq-impact-of-your-Python-Notebook-Azure-ML.png 1400w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 640px) 100vw, 1400px\" \/><\/span><\/div><div class=\"fusion-title title fusion-title-6 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-margin-bottom-small:8px;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:50;line-height:1.2;\">Conclusie<\/h2><\/div><div class=\"fusion-title title fusion-title-7 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Het is ons gelukt!<\/h3><\/div><div class=\"fusion-text fusion-text-28\" style=\"--awb-text-transform:none;\"><p>Na het profileren van onze code om het geheugen- en cpu-gebruik te achterhalen, het omrekenen van deze getallen naar elektriciteitsverbruik en het beoordelen van de impact in CO2eq, zijn we erin geslaagd om de CO2-voetafdruk van onze code beter te begrijpen. Dit is een belangrijke mijlpaal om een stap terug te doen wat betreft de impact van onze code op het milieu, en om het belang van codeoptimalisaties te benadrukken.<\/p>\n<p>In dit specifieke geval, zoals vermeld\u00a0<a href=\"https:\/\/www.artefact.com\/nl\/blog\/string-filters-in-pandas-youre-doing-it-wrong\/\">in het eerste deel over het opsporen en vermijden van prestatieproblemen in Jupiter Lab<\/a>, Door slechts \u00e9\u00e9n regel code te optimaliseren, kon ik 90% van mijn rekentijd en 92% van mijn CO2eq-impact besparen, waardoor ik van 22kgCO2eq naar minder dan 2kgCO2eq per jaar ging.<\/p>\n<p>Tegenwoordig beloven de meeste cloud providerplatformen, inclusief Azure, het volgende<a class=\"au kk\" href=\"https:\/\/azure.microsoft.com\/en-gb\/global-infrastructure\/sustainability\/#energy-innovations\" target=\"_blank\" rel=\"noopener ugc nofollow\">\u00a0een neutraal effect op het milieu hebben<\/a>\u00a0dankzij koolstofcompensatieprojecten. Milieudeskundigen zijn het er echter over eens dat, hoewel effectief en belangrijk,\u00a0<strong>koolstofcompensatieprojecten alleen zijn niet genoeg om de impact van onze activiteiten op de planeet te beheersen<\/strong>, en dat de\u00a0<a class=\"au kk\" href=\"https:\/\/impactful.ninja\/how-effective-is-carbon-offsetting\/#:~:text=Carbon%20offsetting%20is%20effective%20if,the%20source%20is%20more%20effective.\" target=\"_blank\" rel=\"noopener ugc nofollow\"><strong>de beste oplossing is nog steeds om de uitstoot bij de bron te verminderen<\/strong><\/a>, zoals in dit optimalisatieproject.<br \/>\nDit is wat we bij Artefact proberen te promoten door middel van onze verschillende milieu-initiatieven!<\/p>\n<\/div><\/div><\/div><\/div><\/article><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-5 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-margin-top:40px;--awb-margin-bottom:40px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-center fusion-flex-justify-content-center fusion-flex-content-wrap\" style=\"max-width:calc( 1440px + 20px );margin-left: calc(-20px \/ 2 );margin-right: calc(-20px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-4 fusion_builder_column_1_1 1_1 fusion-flex-column fusion-flex-align-self-center\" style=\"--awb-padding-top:40px;--awb-padding-right:40px;--awb-padding-bottom:40px;--awb-padding-left:40px;--awb-overflow:hidden;--awb-bg-position:left center;--awb-bg-size:cover;--awb-border-color:rgba(10,17,40,0.1);--awb-border-style:solid;--awb-border-radius:4px 4px 4px 4px;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:10px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:10px;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:10px;--awb-spacing-left-medium:10px;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:10px;--awb-spacing-left-small:10px;\"><div class=\"fusion-column-wrapper lazyload fusion-column-has-shadow fusion-flex-justify-content-center fusion-content-layout-column fusion-column-has-bg-image\" data-bg-url=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/03\/background.jpg\" data-bg=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/03\/background.jpg\"><div class=\"fusion-image-element\" style=\"text-align:center;--awb-margin-right:20px;--awb-margin-left:20px;--awb-max-width:150px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\"fusion-imageframe imageframe-none imageframe-20 hover-type-none\"><img decoding=\"async\" width=\"72\" height=\"41\" title=\"middelgrote\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2772%27%20height%3D%2741%27%20viewBox%3D%270%200%2072%2041%27%3E%3Crect%20width%3D%2772%27%20height%3D%2741%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/www.artefact.com\/\/wp-content\/uploads\/2021\/03\/medium.png\" alt class=\"lazyload img-responsive wp-image-60927\"\/><\/span><\/div><div class=\"fusion-title title fusion-title-8 fusion-sep-none fusion-title-center fusion-title-text fusion-title-size-three\" style=\"--awb-margin-top:20px;--awb-margin-bottom:0px;--awb-margin-bottom-small:8px;\"><h3 class=\"fusion-title-heading title-heading-center fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:20;line-height:1.2;\">Medium Blog bij Artefact.<\/h3><\/div><div class=\"fusion-text fusion-text-29\" style=\"--awb-content-alignment:center;\"><p>Dit artikel werd oorspronkelijk gepubliceerd op <strong>Medium.com<\/strong>.<br \/>\nVolg ons op ons medium Blog !<\/p>\n<\/div><div style=\"text-align:center;\"><a class=\"fusion-button button-flat button-medium button-default fusion-button-default button-1 fusion-button-default-span fusion-button-default-type\" target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/medium.com\/artefact-engineering-and-data-science\/measure-the-co2eq-impact-of-your-python-notebook-azure-ml-8cbaa01530af\"><span class=\"fusion-button-text awb-button__text awb-button__text--default\">Lees ons artikel<\/span><\/a><\/div><\/div><\/div><\/div><\/div><\/p>","protected":false},"excerpt":{"rendered":"<p>Na mijn eerste verhaal over codeoptimalisatie om mijn rekentijd met 90% te verminderen, was ik ge\u00efnteresseerd in de CO2eq-impact die mijn wijzigingen hadden bespaard.<\/p>","protected":false},"featured_media":68678,"parent":0,"template":"","meta":{"_acf_changed":false,"ep_exclude_from_search":false},"blog-category":[21939],"blog-language":[2991],"class_list":["post-67771","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog-category-medium","blog-language-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog\/67771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/types\/blog"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/media\/68678"}],"wp:attachment":[{"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/media?parent=67771"}],"wp:term":[{"taxonomy":"blog-category","embeddable":true,"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog-category?post=67771"},{"taxonomy":"blog-language","embeddable":true,"href":"https:\/\/www.artefact.com\/nl\/wp-json\/wp\/v2\/blog-language?post=67771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}