<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Amin Noor's blog]]></title><description><![CDATA[If you are an engineer and learning how to code, I write about the journey and more!]]></description><link>https://www.aminnoor.blog</link><image><url>https://substackcdn.com/image/fetch/$s_!ksX5!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f175bf-12e5-486c-b0c3-c65261f36d5d_300x300.png</url><title>Amin Noor&apos;s blog</title><link>https://www.aminnoor.blog</link></image><generator>Substack</generator><lastBuildDate>Mon, 06 Apr 2026 10:30:37 GMT</lastBuildDate><atom:link href="https://www.aminnoor.blog/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Amin Noor]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[aedalat@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[aedalat@substack.com]]></itunes:email><itunes:name><![CDATA[Amin]]></itunes:name></itunes:owner><itunes:author><![CDATA[Amin]]></itunes:author><googleplay:owner><![CDATA[aedalat@substack.com]]></googleplay:owner><googleplay:email><![CDATA[aedalat@substack.com]]></googleplay:email><googleplay:author><![CDATA[Amin]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Time Series Visualisation Tutorial For Petroleum Engineers]]></title><description><![CDATA[Most Python Tutorials use examples in the field of health and medicine. Petroleum Engineers work a lot with Time Series, and here using Pandas and Matplotlib we gonna explore some Electricity trends.]]></description><link>https://www.aminnoor.blog/p/time-series-visualisation-tutorial</link><guid isPermaLink="false">https://www.aminnoor.blog/p/time-series-visualisation-tutorial</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Mon, 04 Dec 2023 01:50:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1ee284ec-e69f-47cb-b7a8-2017413e19e7_1024x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://unfccc.int/process/bodies/supreme-bodies/conference-of-the-parties-cop">COP28</a> is in full swing and Climate related news is the headline in many news outlets again. One particular report that got a lot of attention in the lead up to COP28 was an article called &#8220;<a href="https://www.nytimes.com/interactive/2023/11/20/climate/global-power-electricity-fossil-fuels-coal.html">How Electricity Is Changing, Country by Country</a>&#8221; published by The New York Times. The article is a great example on how to use data visualisation for story telling. For a data visualisation wizard there is nothing more fun than finding a clean dataset. For us this dataset has the benefit of being TimeSeries, so our learning can be easily applied to rates, volumes and pressure versus time plots.</p><p>Below, as we explore the dataset together, I will show you how to create some basic plots and look into datasets. The Dataset is called &#8220;Yearly electricity data&#8221; and it has been put together by ember. You can find it <a href="https://ember-climate.org/data-catalogue/yearly-electricity-data/">here</a>. Dataset description reads:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Amin Noor's blog! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><blockquote><p><em>This dataset contains yearly electricity generation, capacity, emissions, import and demand data for over 200 geographies. Data is collected from multi-country datasets (EIA, Eurostat, BP, UN) as well as national sources (e.g China data from the National Bureau of Statistics).</em></p></blockquote><p>I am using Python in an interactive mode (Jupyter in VSCode) for this tutorial. If you want to learn how to use Python before jumping into data visualisation, please read my first two articles <a href="https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">here</a> and <a href="https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum">here</a>. </p><p>I start with Downloading the set, loading the main two libraries and reading the data into a Pandas DataFrame:</p><pre><code>import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv('yearly_full_release_long_format.csv')</code></pre><p>a simple df.head() will help us to read the first 5 rows of the data and see what has been presented to us. This also help to see if the data is read the way we were expecting it:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LG4i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LG4i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 424w, https://substackcdn.com/image/fetch/$s_!LG4i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 848w, https://substackcdn.com/image/fetch/$s_!LG4i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 1272w, https://substackcdn.com/image/fetch/$s_!LG4i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LG4i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png" width="1456" height="277" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:277,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61708,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LG4i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 424w, https://substackcdn.com/image/fetch/$s_!LG4i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 848w, https://substackcdn.com/image/fetch/$s_!LG4i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 1272w, https://substackcdn.com/image/fetch/$s_!LG4i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ac20658-33dd-4313-8e1a-76287c15090d_1620x308.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>This shows us the data consist of Area and Country code followed by the year that data was collected. Area can be country or continent. We also have columns for regions and various groups that the country can be member of. </p><p>If we pause here for a second, you can appreciate how powerful these metadatas are and how these handful of columns can help us to report the values on many different levels. Category, Subcategory, Variable, Unit and Value are all the available electricity generation, capacity, emissions, import and demand data. The last two columns are the change calculations and we are not going to use theme here.</p><p>Let&#8217;s start with some basic exploring. For example, I am interested to know what categories are listed under Subcategory column. A simple way to find this information is to find the unique values in the column, as below:</p><pre><code><code>df['Subcategory'].unique()

&gt;&gt;&gt; array(['Aggregate fuel', 'Fuel', 'Demand', 'Demand per capita', 'Total', 'Electricity imports', 'CO2 intensity'], dtype=object)</code></code></pre><p>Another exploration method is if I want to filter my Subcategory to only shows Demand per capita. I can simple do it as below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tSnb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tSnb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 424w, https://substackcdn.com/image/fetch/$s_!tSnb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 848w, https://substackcdn.com/image/fetch/$s_!tSnb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 1272w, https://substackcdn.com/image/fetch/$s_!tSnb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tSnb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png" width="1456" height="214" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:214,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53851,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tSnb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 424w, https://substackcdn.com/image/fetch/$s_!tSnb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 848w, https://substackcdn.com/image/fetch/$s_!tSnb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 1272w, https://substackcdn.com/image/fetch/$s_!tSnb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28b946b2-c37a-405a-8009-4ea66a760b70_1622x238.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Exploring the data for specific countries are very simple. Just like above, I can see the data related to Australia as below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6iRw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6iRw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 424w, https://substackcdn.com/image/fetch/$s_!6iRw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 848w, https://substackcdn.com/image/fetch/$s_!6iRw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 1272w, https://substackcdn.com/image/fetch/$s_!6iRw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6iRw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png" width="1456" height="210" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:210,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:50819,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6iRw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 424w, https://substackcdn.com/image/fetch/$s_!6iRw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 848w, https://substackcdn.com/image/fetch/$s_!6iRw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 1272w, https://substackcdn.com/image/fetch/$s_!6iRw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb2dab7-eb9b-4c9e-8f93-1d03e7003ff1_1621x234.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In the next step, I am going to explore the Demand per capita and the total demand for each country further. Once I start showing the Demand per capita, it would be obvious why we need both these views to get a better understanding of the data. Since it is an exploratory work, I am going to only create a view to the data for plotting purposes. The two views are created as below:</p><pre><code>df_demand_per_capita_MWh = df[(df['Subcategory']=='Demand per capita') &amp; (df['Area type']=='Country')][['Year', 'Area', 'Value']].reset_index(drop=True)

df_demand_TWh = df[(df['Subcategory']=='Demand') &amp; (df['Area type']=='Country')][['Year', 'Area', 'Value']].reset_index(drop=True)</code></pre><p>Here using two conditions I am selecting Demand per capita (or Demand), while only selecting the Country values. From the resulting table I am selecting the Year, Area and the Value. I am also asking Pandas to reset the indexing to make it easier to wrangle this new set.</p><p>We can go ahead and check the head of the data again to make sure the outcome is as expected. Here I use a combination of head and tail to explore rows further down the table:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PyYJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PyYJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 424w, https://substackcdn.com/image/fetch/$s_!PyYJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 848w, https://substackcdn.com/image/fetch/$s_!PyYJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 1272w, https://substackcdn.com/image/fetch/$s_!PyYJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PyYJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png" width="405" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b38ef120-88c0-41de-be8e-f1251ced851b_405x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:405,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27973,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PyYJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 424w, https://substackcdn.com/image/fetch/$s_!PyYJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 848w, https://substackcdn.com/image/fetch/$s_!PyYJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 1272w, https://substackcdn.com/image/fetch/$s_!PyYJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb38ef120-88c0-41de-be8e-f1251ced851b_405x342.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As you can see the name of my DataFrame carries the name of the table and the unit system. I prefer a naming like this The benefits of this naming technique is I can remove columns of units and name from the dataset, making it lighter and easier to wrangle with.</p><p>Now looking at this table we are having a long table which is not the easiest to slice for TimeSeries data. It would be much easier if each Country was a column by itself, with year being the index and values (demand per capita MWh) as the cell values. Pandas have an easy to use Pivot function to help us with that:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0QMh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0QMh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 424w, https://substackcdn.com/image/fetch/$s_!0QMh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 848w, https://substackcdn.com/image/fetch/$s_!0QMh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 1272w, https://substackcdn.com/image/fetch/$s_!0QMh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0QMh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png" width="1456" height="341" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:341,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72717,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0QMh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 424w, https://substackcdn.com/image/fetch/$s_!0QMh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 848w, https://substackcdn.com/image/fetch/$s_!0QMh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 1272w, https://substackcdn.com/image/fetch/$s_!0QMh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5956293-2345-46ab-9a9b-b13648723ec9_1632x382.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Now that we have the data in the shape we are happy with, we can start the plotting journey. Python has plenty of libraries for Visualisation. For this tutorial I chose Matplotlib as it is generally the one that everyone starts on. </p><p>For the demand, let&#8217;s start with plotting the World&#8217;s total demand. For this I sum the demand on each row, which would be the total demand for all the countries for each year. The code and the chart would look like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OsWI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OsWI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 424w, https://substackcdn.com/image/fetch/$s_!OsWI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 848w, https://substackcdn.com/image/fetch/$s_!OsWI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 1272w, https://substackcdn.com/image/fetch/$s_!OsWI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OsWI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png" width="880" height="328" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:328,&quot;width&quot;:880,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:63733,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OsWI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 424w, https://substackcdn.com/image/fetch/$s_!OsWI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 848w, https://substackcdn.com/image/fetch/$s_!OsWI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 1272w, https://substackcdn.com/image/fetch/$s_!OsWI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2037eb0-d65d-4c06-9687-7bf49d9c8ae4_880x328.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JL8Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JL8Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 424w, https://substackcdn.com/image/fetch/$s_!JL8Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 848w, https://substackcdn.com/image/fetch/$s_!JL8Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 1272w, https://substackcdn.com/image/fetch/$s_!JL8Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JL8Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png" width="1456" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78447,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JL8Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 424w, https://substackcdn.com/image/fetch/$s_!JL8Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 848w, https://substackcdn.com/image/fetch/$s_!JL8Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 1272w, https://substackcdn.com/image/fetch/$s_!JL8Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2c74156-1aad-4600-94d1-24de6c452bcb_2090x690.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If my x axis is Year or Data, I generally prefer to not label is as it is obvious to the reader and only take valuable space from my plot area. </p><p>A quick look to the plot and the followings stands out to me: </p><ul><li><p>The overall trend</p></li><li><p>The dip in electricity demand during COVID and GFC</p></li><li><p>The dip at 2022. </p></li></ul><p>The overall growing trend, screams how the demand is soaring.</p><p>Covid and GFC dips are very interesting to me. This just shows how Electricity and by extension, energy, is so fundamental to our lives. Any changes in any aspect of our lives, shows itself in our Energy (Electricity) consumption.</p><p>For the dip at 2022, further exploration shows, the dip is not real. There is a lot of missing data in the year 2022, hence the same dataset next year should give us a more realistic picture for 2022.</p><p>So while simple plots can reveal interesting information, we should be careful to not read too much into any of the plots. We will see another example of this when we explore demand per capita.</p><p>Now that we saw the global demand, It would be interesting to see what countries have the highest demands. To make it easier to make conclusions, I sort the dataset based on the countries with highest demand and plot their demand. In this example, I am not assigning the same Y-axis range for all the countries, so that we can see their trends over the years. If I would have gave all the countries the same range based on the highest demand, the scale made it very difficult to understand any trend in most of countries out of the first handful.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5Osq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5Osq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 424w, https://substackcdn.com/image/fetch/$s_!5Osq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 848w, https://substackcdn.com/image/fetch/$s_!5Osq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 1272w, https://substackcdn.com/image/fetch/$s_!5Osq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5Osq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png" width="790" height="740" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:740,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109963,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5Osq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 424w, https://substackcdn.com/image/fetch/$s_!5Osq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 848w, https://substackcdn.com/image/fetch/$s_!5Osq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 1272w, https://substackcdn.com/image/fetch/$s_!5Osq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F432d6c12-2777-44d2-a8da-9730bae7e866_790x740.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This code yields 215 plots, one for each country. I will only include the first 20 as an example:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rNqR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rNqR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 424w, https://substackcdn.com/image/fetch/$s_!rNqR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 848w, https://substackcdn.com/image/fetch/$s_!rNqR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 1272w, https://substackcdn.com/image/fetch/$s_!rNqR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rNqR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png" width="1456" height="906" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:906,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:136975,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rNqR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 424w, https://substackcdn.com/image/fetch/$s_!rNqR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 848w, https://substackcdn.com/image/fetch/$s_!rNqR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 1272w, https://substackcdn.com/image/fetch/$s_!rNqR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ce75441-6618-4550-8c8a-8c5dc121db42_1491x928.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>What we see here is, China is not only the top spot but also is going through a massive increase in terms of demand. While USA ,at 2nd spot, has a flat demand over the reported period, India, at the 3rd spot, is following Chinese trend. We can see Brazil(8th) and South Korea(10th) are another top 10 countries with increasing demand.</p><p>Chine and India however have huge populations, and this demand make sense if we are talking about &gt;25% of earth&#8217;s population. So what if we plot the same chart but this time adjust it for population. Here is how the top 20 look like for demand per capita:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s4pQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s4pQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 424w, https://substackcdn.com/image/fetch/$s_!s4pQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 848w, https://substackcdn.com/image/fetch/$s_!s4pQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 1272w, https://substackcdn.com/image/fetch/$s_!s4pQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s4pQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png" width="765" height="744" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:744,&quot;width&quot;:765,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:115867,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!s4pQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 424w, https://substackcdn.com/image/fetch/$s_!s4pQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 848w, https://substackcdn.com/image/fetch/$s_!s4pQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 1272w, https://substackcdn.com/image/fetch/$s_!s4pQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85f2f837-dd4f-479a-b79c-081bccba2016_765x744.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cwW_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cwW_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 424w, https://substackcdn.com/image/fetch/$s_!cwW_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 848w, https://substackcdn.com/image/fetch/$s_!cwW_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 1272w, https://substackcdn.com/image/fetch/$s_!cwW_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cwW_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png" width="1456" height="916" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:916,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:133974,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cwW_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 424w, https://substackcdn.com/image/fetch/$s_!cwW_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 848w, https://substackcdn.com/image/fetch/$s_!cwW_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 1272w, https://substackcdn.com/image/fetch/$s_!cwW_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F367747ee-c795-4110-9994-fc4a4a63c81f_1475x928.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At least for me the first time I look at this, the results was very interesting and surprising. However, after a bit of think about it it started to make sense.</p><p>In this charts, Iceland&#8217;s demand is very high and it is twice as big as the next country. Before ruling it out as an outlier that needs elimination, I did a quick search to confirm the validity of the data. The source of this dataset is from Eurostat based on the <a href="https://ember-climate.org/app/uploads/2022/07/Ember-Electricity-Data-Methodology.pdf">methodology document</a>. This article explains these numbers a bit more in <a href="https://icelandmonitor.mbl.is/news/news/2020/12/11/energy_use_per_capita_the_highest_in_iceland/">detail</a>.</p><p>Another interesting trend is the fact that many of the top 20 countries, are those on harsher climates (extreme cold or hot) without huge populations but heavy reliance on Air conditioning. Also, interestingly China in this list is in 77th spot and India is further down at 143th spot, below countries like Palestine(139), Cuba(125) and Argentina(85). </p><p>As you can see we just started to scratch the surface with this dataset. It is has already been a long tutorial and I may come back to it in another post.</p><p>In summary, in this tutorial we saw how to import a CSV dataset, do initial familiarisation with the data, do some basic arithmetic on the data and create some basic plots. If you spent more time with this dataset and have other insights in it, please for share in the comments, or simple reply with an email. Also, if you wish the Notebook carrying all this code, please message me and I will share them with you.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Amin Noor's blog! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[My journey to learn Python as a Petroleum Engineer - part 2]]></title><description><![CDATA[In this part 2, I share my tips on how to stay motivated in learning Python and where to find projects that you can apply your Python skills]]></description><link>https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum</link><guid isPermaLink="false">https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Thu, 17 Aug 2023 01:55:56 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have been a Petroleum Engineer for over 8 years now. I started learning Python 5 years ago, with no prior experience in programming. Since then many have asked me on what are the best resources to learn Python, which I shared through my blog <a href="https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">here</a>.</p><p>Having resources to know how to learn a new skill is a critical first step. It gives you the road map, but as having a treasure map is different to having the treasure in your hands, an excellent road map is not the same as knowing enough Python to apply in your day-to-day work.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading my blog! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Learning Python is easy, there are endless number of resources. Similar to learning a language like French or Farsi, just learning the grammar and vocabulary may seem motivating but eventually you need to be able to practice it and finding the right project can be difficult. The project must be challenging for you but at the same time should not be too challenging that demotivate you. Over the years I develop my own methods on how to go around this challenge and I am sharing those with you today.</p><p>Below I talk about two things, firstly how to find doable projects easily to keep you motivated in your journey and secondly how to measure your progress so you never feel that the time you are spending learning is wasted and can push yourself forward.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5058" height="3372" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3372,&quot;width&quot;:5058,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;two men using computer and laptop&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="two men using computer and laptop" title="two men using computer and laptop" srcset="https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1514996937319-344454492b37?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMHx8cHJvZ3JhbW1pbmclMjBwcm9qZWN0fGVufDB8fHx8MTY5MjE4MjQ0OXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@alvarordesign">Alvaro Reyes</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><h4>How to find doable projects easily</h4><p>This is easier said than done and I am happy to acknowledge that. I can share some scenario which worked out for me and hopefully one or some of them will work out for you as well. The list below is from ideal scenario to the most practical one based on my experience. I used a combination of third and eventually second method as I was not fortunate enough to have a work mentor with Python background. Here is the list:</p><ol><li><p><strong>Learning at work with a mentor</strong></p><p>You may be incredibly lucky, and you are learning Python on the job to work on a specific project with a mentor/coach assigning you a task and can guide you to achieve it.</p><p>This is the best way in learning Python but needs a lot of luck as you need to be in the right place in the right time and a right mentor helping you to build your skills. If you are lucky enough to be in this situation, jump on this opportunity and do not look back and move to the next section so you learn how to keep yourself motivated.</p><p>I was not lucky enough to be in this situation, but I have been mentoring younger engineers on delivering projects using Python and I was envying their situation.</p></li><li><p><strong>Learning at work without a mentor</strong></p><p>This is also a great way to learn Python and apply learning. Sometimes you know something can be done in Python as you have seen it in other workplaces, on the internet, or in a conference. </p><p>Your task here is a simple. Break the complicated task to smaller and doable chunks. Now, apply your Python learning to deliver each chunk. </p><p>My strategy here is to not sure what I am working on with my manager till I have something clear value to business to show. The benefit of this is you do not work towards a hard deadline, and you can spend more time learning and exploring your solution without complexity of giving time estimates, resource requirements, etc.</p></li><li><p><strong>Learning using personal projects</strong></p><p>You want to find a pain point in your daily life and use Python to solve it. </p><ol><li><p>You may be passionate about investing or trading and want to write a small script that suggest a buy or sell based on moving average closed prices of certain stocks.</p></li><li><p>You may enjoy playing around with a Raspberry Pi. (<a href="https://projects.raspberrypi.org/en">Pi website</a>)</p></li><li><p>you may have a solar panel that you can read its daily production. (<a href="https://github.com/a-edalat/Fronius_monitor_Pi3B">example</a>)</p></li><li><p>You may want to write a small script that calculates how much you and your partner spent each month and track your shares. </p></li></ol><p>These are some of everyday script I wrote to practice various python techniques. You can also join different communities (like pi community) and see what type of projects people have worked on and get inspired. If you have done other easy and interesting projects, please comment below.</p></li></ol><h4></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1800" height="1200" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1200,&quot;width&quot;:1800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;person stepping on blue stairs&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="person stepping on blue stairs" title="person stepping on blue stairs" srcset="https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1448387473223-5c37445527e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzfHxwcm9ncmVzc3xlbnwwfHx8fDE2OTIxODI1NDN8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@lindsayhenwood">Lindsay  Henwood</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><h4>How to measure your progress</h4><p>Many start the year with a weight loss resolution. Imagine you are going to the gym and eat healthy to lose weight and meet your resolution. Your motivation comes from seeing your weight going down the next time you step on a scale or when an old pants now fits you well. Same applies in learning Python and other skills.</p><p>The trick here is to find the same quantifying progress check in Python. I found two ways so far to measure this. The easiest is to review my old codes and see how much I can improve them while the second one is how I can teach a new learner the ropes.</p><ul><li><p>For code review path, depending on the pace you are learning and the time you are investing, I suggest reviewing your old codes every few weeks or every few months. It is quite common to not appreciate how much you have learnt and hence getting demotivated as you falsely think you have not made any progress.</p></li><li><p>your ultimate confidence boost will come, when a new learner asks you on how to do certain things and most probably that question is very similar to something you faced before. That can give you the boost of confidence that you were in a right path the whole time and the challenges you faced were all part of the journey.</p></li></ul><h4>Conclusion</h4><p>This is the 2nd part of my original <a href="https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">My journey to learn Python as a Petroleum Engineer</a>. In the original post I shared the resources I recommend to a Petroleum Engineer to start learning Python based on my own experience. In this article, I address a challenge I saw many of my colleagues faced whilst trying to learn Python, losing motivation as they cannot see how far they have come or losing interest as they cannot translate learning to something to apply to their daily work. This article is my attempt to address both of these challenges.</p>]]></content:encoded></item><item><title><![CDATA[Python Tutorial: Expanding ECLIPSE DATA file]]></title><description><![CDATA[Expand macro for ECLIPSE was my go to, when I wanted to troubleshoot ECLIPSE issues. here I share a Python implementation of that macro, which is great example of recursive function implementations.]]></description><link>https://www.aminnoor.blog/p/python-tutorial-expanding-eclipse</link><guid isPermaLink="false">https://www.aminnoor.blog/p/python-tutorial-expanding-eclipse</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Mon, 08 May 2023 02:00:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!unq3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this post, I am going to walk you through an old code that I wrote a couple of years ago. For reservoir engineers ECLIPSE numerical simulator is synonymous to Simulation. </p><p>ECLIPSE (ECL) has a lot of advantages over its competitor that made it industry standard. One simple advantage was the ability to use &#8216;INCLUDE&#8217; files. INCLUDE files simply allow you to reference the input data in the main file, while your actual input can reside in another location. This prevents the main &#8216;deck&#8217; from getting too busy.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Amin Noor's blog! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>That is great on a day-to-day operation, but sometimes you prefer to have all the data in one single file, particularly during troubleshooting an ECLIPSE error. $EXPAND macro that comes with ECLIPSE installation allows you to bring all the INCLUDES input data in to the main &#8216;deck&#8217;.</p><p>One day an admin right issue access meant I could not use the $EXPAND or any other ECL macro anymore, and as I was on my path to develop my Python skills, I tookthat as an opportunity(excuse) for development. I was also excited as the solution seemed benefited from implementing recursive functions.</p><h2><strong>Recursive functions</strong></h2><p>Let&#8217;s briefly review what a recursive function is before reviewing the code. You should be already familiar with a function in the context of programmnig is. A recursive function is special since it can calls itself within its own definition. In other words, a function that refers to itself in its own body.</p><p>When a recursive function is called, it breaks down the problem into smaller sub-problems and solves each of them recursively until a base case is reached. The base case is the condition in which the function does not call itself, and the recursion stops.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!unq3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!unq3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 424w, https://substackcdn.com/image/fetch/$s_!unq3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 848w, https://substackcdn.com/image/fetch/$s_!unq3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!unq3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!unq3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg" width="1456" height="786" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:302354,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!unq3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 424w, https://substackcdn.com/image/fetch/$s_!unq3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 848w, https://substackcdn.com/image/fetch/$s_!unq3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!unq3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe813cc7f-f760-4fe5-8e95-d7ef4ec16c1c_1920x1037.jpeg 1456w" sizes="100vw" loading="lazy" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For example, let's consider the factorial function, which is commonly defined recursively. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. The recursive definition of the factorial function can be written as follows:</p><pre><code><code>def factorial(n):    
    if n==0:
        return 1
    else:
        return n*factorial(n-1)</code></code></pre><p>In this definition, the base case is when n=0, and the function simply returns 1. For all other values of n, the function calls itself with the argument n-1 and multiplies the result by n.</p><p>Recursive functions can be a powerful tool for solving problems that can be broken down into smaller sub-problems. However, it's important to ensure that the recursive function does eventually reach a base case, or else it will continue to call itself indefinitely and cause a stack overflow error.</p><h2>Reviewing the code</h2><p>Now let&#8217;s review the code to expand the whole DATA file and bringing all the include files information to the main deck. You can see the complete code in my GitHub repo, <a href="https://github.com/a-edalat/ResSim-HandyTools/blob/main/ECLIPSE%20DATA%20file%20expander.py">here</a>.</p><p>First, let us initialise the code:</p><pre><code>import os

file_name = 'DATA file name goes here'
path = r'The path to the folder containing DATA file goes here'
final_file = []</code></pre><p>In this section, we import os library and give option to user to provide file_name, and path to the file.</p><p>Next step is not mandatory, but a nice section to have. Here the code checks if the file extension is *.DATA or if the user has provided a file with different extension. We are going to assume the file name is the same as the original DATA file, hence, changing the extension to match. This is a good practice to make the core more robust for different scenarios.</p><p>At the end of this block, file contains the full path to our *.DATA file.</p><pre><code>if file_name[-5:] == '.DATA':
    pass
else:
    ext_ind = file_name.find('.')  # Making sure the DATA file has the correct extension

    if ext_ind &gt; 0:
        file_name = file_name[:ext_ind] + '.DATA'
    else:
        file_name = file_name + '.DATA'

file = os.path.join(path, file_name)</code></pre><p>Now we can create our recursive function as below:</p><pre><code>def expander(data_file):

    flag = 0      # flags where code detects include files
    grid_flag = 0 # if grid files are needed set this number to non-zero
    
    include = os.path.join(path, data_file)
        
    with open(include, 'r') as inc:
        for item in inc:
            
            if item[:7] == 'INCLUDE':
                flag = 1
                continue
                    
            elif flag == 1 and grid_flag != 1 and item[:2] != "--" and item[0] != '\n':
                loc  = item.find('/')     # finding the path to the include
                item = item[:loc].strip() # removing spaces and new lines from the path
                item = item.strip("'")    # removing the qoutations from the path name
                expander(item) # recursive function if there is other includes within this include
                flag = 0       # flag back to zero so the lines can be writtern now
                continue
                        
            elif item[:5] in ['COORD', 'ZCORN'] and grid_flag == 0:
                grid_flag = 1
                continue
                
            elif item.strip() == "/" and grid_flag == 1:
                grid_flag = 0
                continue
            
            elif grid_flag != 1:
                final_file.append(item)
                        
    return final_file</code></pre><p>The code has enough comment that you should be able to follow. but the idea here is we scan the *.DATA file, if we see any include file, we also scan that and attach it to the block of text in memory, with the exception of GRID section (optional) to reduce the volume of the text in the final file. If our include files have their own include files (mostly common in SCHEDULE section), our recursive function will call itself out and read them too.</p><p>Now that our function can read the file, we just need to simply, call our function and write it to a destination text file:</p><pre><code>with open(os.path.join(path, file_name[:-5]) + '_EXPANDED.DATA', 'w+') as output:
    output.writelines(expander(file_name))</code></pre><p>Finally, we can tell the user, the operation has been successful and where they should be able to find the expanded DATA file:</p><pre><code>print('You can check the expanded DATA file in the following path: ')
print(os.path.join(path, file_name[:-5]) + '_EXPANDED.DATA')</code></pre><p>I hope you enjoyed this tutorail. Feel free to drop me an email on hello@aminnoor.blog, or comment below if you have comments or questions.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Amin Noor's blog! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Not every blog post should be perfect]]></title><description><![CDATA[How a professional poker gambler thought me what I should focus in my blog]]></description><link>https://www.aminnoor.blog/p/not-every-blog-post-should-be-perfect</link><guid isPermaLink="false">https://www.aminnoor.blog/p/not-every-blog-post-should-be-perfect</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Wed, 26 Apr 2023 03:00:01 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!SI2A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.aminnoor.blog/subscribe?"><span>Subscribe now</span></a></p><p>One of the best life hacks I learnt was to create a dedicated music playlist for any trip that you go on. Later, when you listen to that music, they are associated with that vacation. My partner and I have made this a habit and expanded on it, we list to Podcast series or an Audiobook in our road trips and it has been great. Driving by and exploring the beautiful nature of Australia while learning about something new or getting entertain by an enjoyable book is a high pleasure that few things can reach that high for me.</p><p>As a reservoir engineer in an exploration team, an investor, and a Data science enthusiast I love dealing with probabilistic and uncertainties. Listening to the story of gamblers, seeing how they mastered the art of both applying probabilistic and using psychology to mark their names is a big attraction to me. In our latest road trip, we listened to season 2 of a great podcast called <a href="https://www.theringer.com/gamblers-podcast">Gamblers</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SI2A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SI2A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SI2A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SI2A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SI2A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SI2A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;gambler playing poker with a view of the poker table with all the chips in front of players&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="gambler playing poker with a view of the poker table with all the chips in front of players" title="gambler playing poker with a view of the poker table with all the chips in front of players" srcset="https://substackcdn.com/image/fetch/$s_!SI2A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SI2A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SI2A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SI2A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7bfc0d3-b351-4dbd-b4c0-3a15ce2ef8eb_1024x1024.jpeg 1456w" sizes="100vw" loading="lazy" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I was introduced to <a href="https://www.youtube.com/user/PokerScenes">Andrew Neeme</a>, the Pied Piper of Poker, in an episode on the second season. Andrew is a professional poker player. He is not a WPT champion, nor is he famous for making hundreds of millions during his lifetime. What he is famous for is the innovative way he used his vlog. He is the first Poker player that took YouTube viewers behind the scenes of the life of a professional poker player. He achieved many things through that humble vlog adventure that you can listen to in the podcast, but what stood with me the most was through his vlog he made the life of a professional poker player accessible to all and that is a huge game changer.</p><p>If you want to take poker seriously as a profession, studying the life of the greatest of all-time may not be helpful to you. Those players are mostly tail events, they are right on the top, due to many exceptional circumstances that made them so special. Based on a normal distribution, you are far more likely to be somewhere in the middle than right on the tails. Hence, a skilled professional player showing you behind the scenes in Poker and showing you all the good, bad and the ugly can be much more relatable and useful when you want to start and decide if the path is the right path for you.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0KsI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0KsI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0KsI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0KsI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0KsI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0KsI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;a bell cruve graph showing the tail end on each end&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="a bell cruve graph showing the tail end on each end" title="a bell cruve graph showing the tail end on each end" srcset="https://substackcdn.com/image/fetch/$s_!0KsI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0KsI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0KsI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0KsI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F145e2074-6f97-44c4-a7f6-9c8831fc9bc4_1024x1024.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And that gave me the confidence to write more here. Instead of trying hard to write the &#8216;ultimate&#8217; article every time, I will try to write more articles centered around my career and how I am building my skillset in Data science and Petroleum engineering. My idea here is, my geeky approach to various things in my career, might be as much fun, interesting and informative to others as it is to me and hopefully you will relate to some of it.</p><p>Going forward, you can expect 1 or 2 articles per month, ranging from how I am going to use Python to automate Reservoir Engineering workflows to how great my new EV is and everything in between. I will share my small discoveries (for the lack of better word). If I have a bright moment, an innovative idea, a new automation method that can scale, I will share it here and you will be the first to see it. I hope to see you in future articles. So, subscribe now if you haven&#8217;t already, so you do not miss my next writings.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.aminnoor.blog/p/not-every-blog-post-should-be-perfect?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.aminnoor.blog/p/not-every-blog-post-should-be-perfect?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Why engineers should treasure Python over Excels of the world]]></title><description><![CDATA[I am exploring three benefits of Python over Excel and similar software and tell a familiar story of how Excel becomes a permanent temporary solution]]></description><link>https://www.aminnoor.blog/p/why-engineers-should-treasure-python-over-excels-of-the-world-239d205e3b99</link><guid isPermaLink="false">https://www.aminnoor.blog/p/why-engineers-should-treasure-python-over-excels-of-the-world-239d205e3b99</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Sat, 11 Jun 2022 11:37:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aCsw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I love Python and I love open-source communities. My love did not start at the first sight. At first, I may have been drawn into the ecosystem due to the hype and curiosity. Nowadays though I can reap the benefits of this beautiful ecosystem and it is easy for me to understand and talk about this love relationship.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aCsw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aCsw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aCsw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aCsw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aCsw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aCsw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/f8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aCsw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aCsw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aCsw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aCsw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8214842-6e6b-4afe-8c56-547378200762_800x640.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">credit: @pakata</figcaption></figure></div><p>Over the last few years, I have tried to encourage my engineering colleagues to add Python scripting to their skillset. (if you want to start your journey I wrote a how-to <a href="https://aedalat.medium.com/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">here</a>). Many of these colleagues and friends have sharpened their skills in Microsoft Excel or other propriety tools (OFM for example in Oil &amp; Gas) for years. The thought of learning scripting in Python has been both exciting and scary for them. Generally, their arguments or their reluctance falls under one of the points below:</p><ul><li><p>Sunken cost argument (different excuses but all cantered around why should I learn a new tool, when I have spent so much time learning the current ones)</p></li><li><p>My challenge/model is too complex for anything that Python can handle</p></li><li><p>General fear of scripting which goes hand to hand with the next argument</p></li><li><p>Anything you can do in python I can do in Excel (replace Excel with the software of your choice with Graphical User Interface (GUI))</p></li></ul><p>In this article I am hoping to show you why basic knowledge of scripting in Python and a working knowledge of some of its libraries such as Pandas should be a must to have in any engineers&#8217; toolbox.</p><h3><strong>Familiar Scenario</strong></h3><p>I have worked in my industry in different roles from an external consultant to the engineer responsible for delivering projects in operating companies and I have seen my share of useful but unreliable solutions developed on Excel and similar tools. The following story should sound familiar to you:</p><ul><li><p>Senior Engineer/Manager (M): We have plenty of data to work with, we need x number of more engineers to be able to create and run all these models</p></li><li><p>Smart junior/grad engineer(E): Hey, it should be alright, I know advanced excel and VBA from my university days, I should be able to automate the model generation piece and we can do this within our team</p></li><li><p>M: great, show me how your tool works, let&#8217;s present it to the higher-up management, we are great</p></li></ul><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/CarlaNotarobot/status/1482106293263425539&quot;,&quot;full_text&quot;:&quot;there is nothing more permanent than a temporary workaround&quot;,&quot;username&quot;:&quot;CarlaNotarobot&quot;,&quot;name&quot;:&quot;Carla Notarobot &#129302;&#128105;&#127995;&#8205;&#128187;&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Fri Jan 14 21:44:11 +0000 2022&quot;,&quot;photos&quot;:[],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:1023,&quot;like_count&quot;:6806,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:false}" data-component-name="Twitter2ToDOM"></div><p>So far it is all great, and it could have been great if the story would have finished here. As many of you may know, it does not. Time passes, and M thinks why not try to capture more complexities into the Excel Macro. As E starts to add more complexities, the Excel file starts to get larger and larger and then crashes start to occur. The file that used to open in a few seconds and run things fast, now takes minutes to open, half the time it is getting corrupted and the other half, it may crash in the middle of running the latest Macros. This part was common, but from this point on, I have seen different scenarios playing out in different companies:</p><ul><li><p>M and E decide to simplify their assumptions (sometimes to the point that they may not be valid, but the justification is we are constrained by the tool)</p></li><li><p>M leverages business continuity argument and complains to the IT that IT should supply a more stable version of Microsoft Excel/Environment</p></li><li><p>E suggests instead of running Microsoft Excel on one machine, why not running multiple instances on many, accepting 50% completion of macros over night as a success</p></li></ul><p>Time goes by, Microsoft/software vendor updates the software and adds some improvements, but things barely get better, going back is not an option and scaling is a challenge no one knew they are going to face.</p><p>One may think the logical conclusion from the scenario above is for the engineering team to conclude they are using Excel in a way that is not suited and it is not the best tool for their problem. But unfortunately, my experience has been quite different, in at least two occasions the conclusion was our problem is so complex that no tool can really handle it!</p><p>The issue is sometimes we tend to focus on our field of expertise the most and forget that many other industries have very similar issues like us and they may have developed solutions that we can borrow from. <a href="https://blog.twitter.com/engineering/en_us/a/2013/new-tweets-per-second-record-and-how">There are on average 1 billion tweets sent every 2 days</a>, if twitter can handle that and do all sort of analytics on it, there should be tools capable of holding 400 simulation models for 1000 wells for 40 years. The great news is, the solution exists, it is free and it has one of the best communities in the world supporting it. It is called <a href="https://www.python.org/">Python</a> and all it requires from you is to spend some time to learn its language.</p><h4>Why YOU should treasure Python over Excels of the&nbsp;world</h4><p>If you have not been convinced yet (which if I know my engineer friends and colleagues, the chances are highly likely that you have not), below I am making a case on why using Python to play with your data is a much more superior tool compared to Excel or any other Proprietary tool.</p><p>It is also worth mentioning that I am a daily user of Microsoft Excel and use many other tools which are not open source or have Graphical User Interfaces (GUI). My arguments here are to persuade you that the initial cost of learning Python can pay many years of dividends and a huge bargain. My mains arguments are:</p><ul><li><p>We should use more Open Source and less Proprietary software</p></li><li><p>Scripts are powerful. They can eat GUI for breakfast any day</p></li><li><p>There are future opportunities unforeseen today if you are not confined by your tools</p></li></ul><p>Let me explain them in a bit more detail:</p><p><strong>1) Use more Open-Source and less Proprietary software</strong></p><p>IBM <a href="https://www.ibm.com/topics/open-source">defines</a> open-source software as:</p><blockquote><p>Open-source software (OSS) is a decentralized development model that distributes source code publicly for open collaboration and peer production known as &#8220;the open-source way.</p></blockquote><p>What that means in day-to-day practice is for the Open-Source Software the source code is open to be seen and changed by anyone. So, if your action causes the software to crash, you can try and find the bug, and fix it for yourself and also share it with the world. The next version of the software has the fix you made.</p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/naval/status/1444366754650656770&quot;,&quot;full_text&quot;:&quot;Open source means each problem only has to be solved once.&quot;,&quot;username&quot;:&quot;naval&quot;,&quot;name&quot;:&quot;Naval&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Sat Oct 02 18:20:44 +0000 2021&quot;,&quot;photos&quot;:[],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:2060,&quot;like_count&quot;:17787,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><p>It may not sound hugely important if you are a beginner in python and you are only going to use Python for automating some mundane tasks, but think about some irritating issues in some of the popular software you use that haven&#8217;t been fixed for years, You can check this <a href="https://old.reddit.com/r/excel/comments/sgde1o/what_are_your_nightmares_when_dealing_with_large/">thread</a> on challenges of working with large Excel datasets that Excel power users are facing or <a href="https://answers.microsoft.com/en-us/msoffice/forum/all/most-annoying-formatting-bug-in-excel/906ae1a1-978e-4171-845b-c21e917e69d6">this</a> issue a user has faced for years. The user request does not get priority because it is not common, but for the user who has the issue, it is an everyday pain. You are dealing with a big corporation like Microsoft with a global user based reach. They have to prioritise their resources on what issue to address, and if your painful issue is not common then tough luck.</p><p><strong>2) Scripts can eat GUI for breakfast</strong></p><p>Here I am going to give you two reasons on the superiority of scripts over GUI:</p><ul><li><p>Engineering work requires a lot of mental power and focus. You cannot get interrupted constantly and still produce quality work. Working with scripts rather than GUIs seems scary at the beginning. As you get more comfortable with writing scripts and navigate your way through things using text commands and scripts, you realise staying in a single environment minimises the distractions. This ability to focus more can lead to generating higher quality work. Using mouse and GUI while visually enticing would cause you to move from one screen to the next which means your eyes glance on various things on screen. They can distract you and keeping yourself focus drains your mental strength.</p></li><li><p>The second importance of the script vs GUI is the reproducibility of your work. There is a learning curve. It may make you slower than the rest at the start.As you get comfortable though, you will spend less time on the preparation and more on analysing and engineering while staying focus for longer. Imagine a simple case of copy/pasting a file. Compare automating or repeating a simple file copy/paste. The movement of the mouse, right clicking and selecting copy, going to the destination to paste the data, vs the following (bash not Python):</p></li></ul><pre><code>                cp SourcePath/file DestinationPath/file</code></pre><p><strong>3) Unlocking Future opportunities unforeseen today</strong></p><p>When Steve jobs introduced iPhone in 2008, Steve Balmer, the Microsoft CEO at the time, not only laughed at the question on iPhone but also <a href="https://www.huffpost.com/entry/steve-ballmer-laughs-at-i_n_378518">described</a> iPhone as &#8220;the most expensive phone in the world&#8221;, one that &#8220;doesn&#8217;t appeal to business customers.&#8221; What many could not see at the time was how iPhone would profoundly change how we interact with the technology and the world. Who could have envisioned we would buy or discuss &#8216;<a href="https://opensea.io/collection/boredapeyachtclub">Bored ape</a>&#8221; pictures (current floor price is $150K USD) in less than 15 years after iPhone launch using our phones. The same goes with Python and our day-to-day engineering challenges. In the current Excel driven mindset, the possibilities are confined with the tools at hand, but with a different toolset and when the possibilities are almost endless, who knows what applications each engineer can think of. I am excited to see those, aren&#8217;t you?</p><h3><strong>Final words</strong></h3><p>In this article I showed general scenarios on how engineers can end up with closed source solutions and run into scalability issue as the challenges are getting more complex and the datasets are getting larger. I offered my solution as adding Python to our toolbox.</p><p>If a task worth doing, it is worth doing it right, and if you think you need to do it more than once, try to think of automating it. One of the best tools to help you in that path is Python and its wonderful community. Python is free, open source, easy to use in automation projects, extremely flexible, has been tried across many industries and disciplines and is constantly evolving.</p><p>If you want to see where to start on your Python journey, I wrote about it <a href="https://aedalat.medium.com/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">here</a>:</p><p><strong><a href="https://aedalat.medium.com/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">My journey to learn Python as a Petroleum Engineer</a></strong><a href="https://aedalat.medium.com/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88"><br></a><em><a href="https://aedalat.medium.com/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">I try to answer 6 commonly asked questions for new users on learning Python</a></em><a href="https://aedalat.medium.com/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88">aedalat.medium.com</a></p>]]></content:encoded></item><item><title><![CDATA[Data Analytics in Reservoir Engineering — Review]]></title><description><![CDATA[Society of Petroleum Engineers (SPE) has published its first book in the PetroBriefs series last Friday, Data Analytics in Reservoir&#8230;]]></description><link>https://www.aminnoor.blog/p/data-analytics-in-reservoir-engineering-review-b0aa3af33d6d</link><guid isPermaLink="false">https://www.aminnoor.blog/p/data-analytics-in-reservoir-engineering-review-b0aa3af33d6d</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Thu, 29 Oct 2020 03:21:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!iuZv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Society of Petroleum Engineers (SPE) has published its first book in the PetroBriefs series last Friday, <a href="https://store.spe.org/Data-Analytics-in-Reservoir-Engineering-eBook-P1166.aspx">Data Analytics in Reservoir Engineering</a>. They have made the ebook available to all SPE members for free.</p><p>SPE&#8217;s intorudction of the <a href="https://store.spe.org/PetroBriefs-C107.aspx">PetroBriefs series</a> is as follow:</p><p>&#8220;it is meant to quickly bring each reader up-to-speed on an emerging technology or specialized topic. At around 100 pages, most are available in both softcover and in popular eBook formats.&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iuZv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iuZv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 424w, https://substackcdn.com/image/fetch/$s_!iuZv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 848w, https://substackcdn.com/image/fetch/$s_!iuZv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 1272w, https://substackcdn.com/image/fetch/$s_!iuZv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iuZv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/f7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iuZv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 424w, https://substackcdn.com/image/fetch/$s_!iuZv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 848w, https://substackcdn.com/image/fetch/$s_!iuZv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 1272w, https://substackcdn.com/image/fetch/$s_!iuZv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7dc2dbe-f917-4c32-b4b9-86dfa7e95cbd_432x649.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption"><a href="https://store.spe.org/Data-Analytics-in-Reservoir-Engineering--P1167.aspx">https://store.spe.org/Data-Analytics-in-Reservoir-Engineering--P1167.aspx</a></figcaption></figure></div><p>I downloaded the book yesterday and read through it using Adobe Digital Edition. (if you have not used Adobe Digital Edition, prepare yourself for a poor user experience). The list of the authors and reviewers of the book is very promising so is the list of the contents. I will try to make my review short and to the point by first quickly mentioning the pros followed by cons.</p><p><em><strong>Pros:</strong></em></p><p><em>The book is brief but covers many of the essential topics.</em> In this regard, the book provides the reader with a very good fundamental understanding of the current challenges and opportunities in data analytics in the Oil and Gas industry. I, for one, learnt that the challenges I am facing in data preparation are more common than I thought they are.</p><p><em>Chapters and sections are independent.</em> Many of the chapters start with some introduction on basic concepts required for the chapter, even though they may have briefly discussed elsewhere in the book. This made it very easy to start reading from the topics/chapters you are interested in without the need to read the rest of the book.</p><p><em>No jargons.</em> If I want to borrow from <a href="https://medium.com/u/2fccb851bb5e">Cassie Kozyrkov</a>, the authors were &#8216;data scientists&#8217; not &#8216;data charlatans&#8217; in a sense that they did not allow the catchy phrases and topics get in the way of their judgment. They were very informative on the current state of analytics in the industry, where the industry is behind and where the industry and Petroleum engineers should head or aim for.</p><p><em>Reference list.</em> There is a great reference list at the end of the book which provides a fantastic opportunity for further reading. We are still at the beginning phases of the adaptation of data analytics in the Oil and Gas industry and there are many avenues for further reading and research.</p><blockquote><p>While data analytics has broad applications in reservoir engineering, the vast number of wells and pace of operations in unconventional allow data to play a critical role in the decisions that create&nbsp;value.</p></blockquote><p><em><strong>Cons:</strong></em></p><p><em>Adobe Digital Edition: </em>It is the only medium the ebook is available on and my experience with the platform is very poor.</p><p><em>Scalability: </em>I understand it is a PetroBrief, but I wish the book would have tied up in a bigger series and would have been used as a stepping stone to reading other books which could expand on its topics. I also understand this can be done by the readers and chapters come with good references for future reading, but I feel it is a missed opportunity for the authors not to provide a suggested path (maybe at the end of each chapter) to suggest further reading material for the enthusiasts among us. Maybe there is room for a more detailed book and this is what I am looking for.</p><p>For those who,like me, are working in unconventional assets, the book has a promising message. &#8220;While data analytics has broad applications in reservoir engineering, the vast number of wells and pace of operations in unconventional allow data to play a critical role in the decisions that create value.&#8221;</p><p>I highly recommend the book for those who want to start their data analytics journey or the managers(decision-makers) in the industry who wish to understand the latest trend and equip themselves with the required knowledge required for decisions of tomorrow!</p>]]></content:encoded></item><item><title><![CDATA[My journey to learn Python as a Petroleum Engineer]]></title><description><![CDATA[I try to answer 6 commonly asked questions for new users on learning Python]]></description><link>https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88</link><guid isPermaLink="false">https://www.aminnoor.blog/p/my-journey-to-learn-python-as-a-petroleum-engineer-dfb5a2bbbe88</guid><dc:creator><![CDATA[Amin]]></dc:creator><pubDate>Sat, 15 Aug 2020 08:58:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7EA4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7EA4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7EA4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7EA4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7EA4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7EA4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7EA4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/bd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7EA4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7EA4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7EA4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7EA4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd6aa45b-a235-45be-81d4-0a508002dfcd_800x533.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@impatrickt?utm_source=medium&amp;utm_medium=referral">Patrick Tomasso</a> on&nbsp;<a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure></div><p>To be called literate in the 2020s there is a good chance you must know how to code. It may seem an exaggeration, but I certainly believe it would be true for engineering roles. I still remember vividly when in 2014 President Obama participated in the &#8216;<a href="https://www.youtube.com/watch?v=AI_dayIQWV4">Hour of Code</a>&#8217; to encourage students to pick up coding. Those students are entering the job market now and in the coming years and I cannot even imagine how much of impact they would have in the way we live and work. One thing I know is learning how to code is fun, liberating and can save you lots of trouble in the long run while makes you look smarter than you are (certainly true in my case).</p><p>Now if you want to start learning Python, you do not have a problem of finding resources, you will have a unique problem of picking the right one. Sometimes it seems to me there are more python tutorials online than the population of earth! (a bit exaggeration but you get my point). My experience in learning new skills over the last few years has taught me one thing, the most time-consuming yet crucial part is mapping the learning path. If I get that part right, things fall in place nicely. I spent a lot of time online and offline discussing with experienced users to map the path for my learning and over the last few years, I have helped many friends and colleagues with where to start Python and how to approach it. In my previous workplace, I advocated for a formal python training to leadership, once I got their approval I researched, picked and tailored the course to suits our Petro-technical engineers and the course was successfully delivered on February 2019.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!omuh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!omuh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 424w, https://substackcdn.com/image/fetch/$s_!omuh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 848w, https://substackcdn.com/image/fetch/$s_!omuh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!omuh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!omuh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/ee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!omuh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 424w, https://substackcdn.com/image/fetch/$s_!omuh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 848w, https://substackcdn.com/image/fetch/$s_!omuh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!omuh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee5771c7-ea10-4c93-aa62-9853f6e0a01f_800x449.jpeg 1456w" sizes="100vw"></picture><div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@dlanor_s?utm_source=medium&amp;utm_medium=referral">Dlanor S</a> on&nbsp;<a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure></div><p>Today I am going to share with you some of the frequent questions I receive and my answers to them. My hope is these questions and answers would ease your way on your journey to learn Python. I share the post on my <a href="https://www.linkedin.com/in/aminnoor/">LinkedIn</a> and my Medium page, and I hope to update it regularly. Please use these as a guideline alongside your research. If you find alternative resources that were helpful please feel free to share them with me or comment them down below for everyone&#8217;s benefit. Also please do not hesitate to ask away your questions in the comment or direct message, I would be happy if I can help.</p><p><em><strong>Question 1: Python or R, which one should I learn?</strong></em></p><p>If you are an engineer or want to code for an engineering solution, my answer is Python. Python is the <a href="https://www.zdnet.com/article/python-now-as-popular-as-java-as-typescript-climbs/">second most popular programming language</a> now while R is 14th and they were in similar rank not long ago. <a href="https://www.educba.com/r-vs-python/">You can read about some of their differences here</a>. As a beginner for at least the first year of learning python, there is a very good chance that any problem you face has an answer ready for you on the internet and that makes the learning process a smoother journey.</p><p><em><strong>Question 2: Python2 or Python3?</strong></em></p><p><a href="https://stackoverflow.blog/2020/04/23/the-final-python-2-release-marks-the-end-of-an-era/">Python 2 is dead.</a> So, if you are about to start learning Python, don&#8217;t even consider this question as part of your research.</p><p><em><strong>Question 3: Where to start learning Python?</strong></em></p><p>I picked up a few different courses, to begin with. As an engineer, I work with excel sheets, PDF files, office documents every day. Why should I pick up a course that teaches python very well, but the projects are about tic-tac-toe and some other random games? This is why &#8220;<a href="https://automatetheboringstuff.com/">Automate Boring Stuff with Python</a>&#8221; is my top recommendation. <a href="https://alsweigart.com/">Al</a>&#8217;s book and delivery are great. More importantly, the course is very practical which allows you to start coding on your small projects very quickly. Those small wins hopefully are going to motivate you and make it easy for you to commit to learning.</p><p><em><strong>Question 4: I finished &#8220;Automate Boring Stuff with Python&#8221;, now what?</strong></em></p><p>If writing scripts is all you want to know from Python, then &#8220;Automate Boring Stuff with Python&#8221; should be enough.</p><p>If you want to learn python more in-depth or you are thinking on developing applications with more complexity than automating scripts and such, then you may want to have a look at a computer science course with a focus on Python. I highly recommend the 2-part series &#8220;Introduction to Computer Science and Programming Using Python&#8221; by MITx which is available through the <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/">MIT website</a> and <a href="https://www.edx.org/course/introduction-to-computer-science-and-programming-7">Edx</a>. What you get out of the course is how to frame your mind to code like a computer scientist. It is invaluable in making you a more efficient programmer and more comfortable with Python and its libraries&#8217; documentation.</p><p><em><strong>Question 5: Is there any other resources to learn from.</strong></em></p><p>Yes, plenty, I list them here and try to explain in a few short sentences why they have been shortlisted and worth your time:</p><p><a href="https://greenteapress.com/wp/think-python/">Think Python</a>:</p><p>Great book for an introduction to Python, available for <a href="http://greenteapress.com/thinkpython/thinkpython.pdf">free</a>. What I liked the most was how each chapter has some exercises to help you to judge your understanding.</p><p><a href="https://jakevdp.github.io/WhirlwindTourOfPython/">A whirlwind Tour of Python</a>:</p><p>It is a fast-paced introduction to Python and it is tailored to those who are new to Python but have programming background in other languages. If you are profieceint with VBA and you want to pick up Python, maybe this would be a good starting point for you. It is available for free from various sources, such as <a href="https://learning.oreilly.com/library/view/a-whirlwind-tour/9781492037859/">here</a> and <a href="https://www.oreilly.com/programming/free/files/a-whirlwind-tour-of-python.pdf">here</a>.</p><p><a href="https://wesmckinney.com/pages/book.html">Python for Data Analysis:</a></p><p>If you are ready to learn pandas, then why not learning it from the person who created it. Wes&#8217;s book is the go-to for learning pandas, combined that with his videos on YouTube and then learning pandas would be fun. <a href="https://www.amazon.com.au/Python-Data-Analysis-Wes-McKinney/dp/1491957662">You can purchase the book here</a>.</p><p><a href="https://medium.com/">Medium</a>:</p><p>I found Medium website and &#8220;<a href="https://towardsdatascience.com/">towards data science</a>&#8221; publishing page particularly useful for finding like-minded people, latest trends and general coding/python tips and tricks that would be handy.</p><p><a href="reddit.com">Reddit:</a></p><p>Reddit needs no introduction. I found <a href="reddit.com/r/learnpython/">learnpython</a> and <a href="reddit.com/r/datascience/">datascience</a> subreddits very useful forums to follow.</p><p><a href="https://stackoverflow.com/">Stackoverflow</a>:</p><p>Last but not least is stackoverflow. There is a very good chance that any python questions that come to your mind have already been answered here. So, you would learn to rely on this very early in your learning journey.</p><p><em><strong>Question 6: How can I practice.</strong></em></p><p>Try to find easy projects around you. I know this is easier said than done. Finding a good personal project would be one the most challenging part to you in this journey as I had a hard time finding a project that worth doing, yet can deduce to simple challenges so it fits in my skill set and I can approach it.</p><p>If you cannot think of any projects early on, don&#8217;t panic, it is as natural as losing breath after running a marathon( in my case around the block). The solution is <a href="https://www.codewars.com/">codewars</a>. I found codewars around 2 years ago and that helped me solidify many of my learnings. It gives you small projects to practice your python skills, try to start from basics and gradually increase the level of difficulties.</p><p>I have developed a few small and big projects with Python over the last few years, I share two of my favourites below to hopefully gives you some motivation and idea.</p><p>The first one is a personal project I did at home using Raspberry Pi and my Solar system. My python code requests the energy output of my solar system every minute, collects it in a database and plots them for me on my command. I can check how many sunny days I had in a month and monitor the quality of my panels over time.</p><p>The second one is work-related and it is a project I did at my current role. My application successfully reduced the time required to generate gas and water type curves from over a week for our big fields to minutes, by automating a lot of calculations which were previously run in Excel.</p>]]></content:encoded></item></channel></rss>