<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hugo Estrada S.</title>
    <description>The latest articles on DEV Community by Hugo Estrada S. (@hugoestradas).</description>
    <link>https://dev.to/hugoestradas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F336442%2Fb8e7e048-52a4-4373-b755-a9bc19d01cfc.jpg</url>
      <title>DEV Community: Hugo Estrada S.</title>
      <link>https://dev.to/hugoestradas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hugoestradas"/>
    <language>en</language>
    <item>
      <title>Get Certified - Pass the AWS Cloud Practitioner 2022-2023</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Wed, 30 Nov 2022 15:26:40 +0000</pubDate>
      <link>https://dev.to/hugoestradas/get-certified-pass-the-aws-cloud-practitioner-2022-2023-1lin</link>
      <guid>https://dev.to/hugoestradas/get-certified-pass-the-aws-cloud-practitioner-2022-2023-1lin</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F515dvnco1k55d86f5g6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F515dvnco1k55d86f5g6r.png" alt="Image description" width="300" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A certification provides competency, shows commitment, professionalism and most importantly: it motivates you to keep learning and gather knowledge. It's also a great way to get a better job.&lt;/p&gt;

&lt;p&gt;Currently AWS is the number 1 cloud provider, and continues  growing. Amazon constantly improves, changes and adds new services and resources to it's cloud platform. &lt;/p&gt;

&lt;p&gt;Every cloud provider has its pros and cons, but let's focus on the positive side of AWS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; AWS provides very strong and fast PaaS capabilities, which in today’s world is a very important part of any cloud infrastructure.&lt;/li&gt;
&lt;li&gt; AWS brings to the array an integrated environment for deploying cloud apps, development and testing.&lt;/li&gt;
&lt;li&gt; The new design of AWS is intuitive, easy to digest and with a solid security development life-cycle included.&lt;/li&gt;
&lt;li&gt; The developer’s tools are amazing, and with a lot of flavors and colors. From an IoT suite to machine learning.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So with all these cool features, sounds like AWS is a very competitive cloud provider, and it's worth it to get certified.&lt;/p&gt;

&lt;p&gt;The AWS Cloud Practitioner Exam, is a multi-choice, theoretical exam, and covers the foundations upon AWS designed its cloud platform, from standards to cases of use for the services and/or products available on AWS.&lt;/p&gt;

&lt;p&gt;If you're interested in getting the certification, download my  document. This exam covers topics like security, privacy, compliance, general cloud concepts, and basic understanding of pricing and support for several AWS services and resources. Does not matter if you're unfamiliar with AWS, my document will help you out!&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;DOWNLOAD&lt;br&gt;
&lt;a href="https://mega.nz/file/cU1nSJyQ#5bwSdl_VlSbgdHK2oOL7NZU-l9STRmYVQUnTCLMmY2A" rel="noopener noreferrer"&gt;https://mega.nz/file/cU1nSJyQ#5bwSdl_VlSbgdHK2oOL7NZU-l9STRmYVQUnTCLMmY2A&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

</description>
      <category>cloud</category>
      <category>aws</category>
      <category>certification</category>
    </item>
    <item>
      <title>Pandas Skills Pt. 2 🐼📊📚📐</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Wed, 16 Mar 2022 13:40:10 +0000</pubDate>
      <link>https://dev.to/hugoestradas/pandas-skills-pt-2-90d</link>
      <guid>https://dev.to/hugoestradas/pandas-skills-pt-2-90d</guid>
      <description>&lt;p&gt;Before all, &lt;a href="https://github.com/hugoestradas/Advanced-Pandas" rel="noopener noreferrer"&gt;here&lt;/a&gt; is the link with the code of this lecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3f86ftjm6zudggrobo7y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3f86ftjm6zudggrobo7y.jpg" alt="Image description" width="750" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this new installment, I will go over 2 very useful notebooks fully documented.&lt;/p&gt;

&lt;p&gt;I specifically focused on two main, and very important topics: dealing with dates and missing values.&lt;/p&gt;

&lt;p&gt;The two new notebooks are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;missing_values.ipynb&lt;/li&gt;
&lt;li&gt;dealing_with_dates.ipynb&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ENJOY!&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>analytics</category>
      <category>python</category>
      <category>pandas</category>
    </item>
    <item>
      <title>Pandas Skills Pt. 1 🐼📊📚📐</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Mon, 06 Dec 2021 19:01:00 +0000</pubDate>
      <link>https://dev.to/hugoestradas/pandas-skills-pt-1-3mg2</link>
      <guid>https://dev.to/hugoestradas/pandas-skills-pt-1-3mg2</guid>
      <description>&lt;p&gt;Before all, &lt;a href="https://github.com/hugoestradas/Advanced-Pandas" rel="noopener noreferrer"&gt;here&lt;/a&gt; is the link with the code of this lecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3f86ftjm6zudggrobo7y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3f86ftjm6zudggrobo7y.jpg" alt="Image description" width="750" height="484"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 1 - The Pandas DataFrame
&lt;/h2&gt;

&lt;p&gt;The most fundamental aspect of Pandas, is the DataFrame. &lt;br&gt;
This is how your data is stored, and it's a tabular format with rows and columns as you'd find them in a spresheet or a relational database table. So, before I dive into some more advanced Pandas topics, let me review the DataFrame concept.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After importing Pandas as 'pd', I'm going to create a Dictionary called 'scores'. A dictionary, is a Python structure which stores key-value pairs. In this dictionary the keys are 'name', 'city' and 'score', and the values are lists, as denoted by the square brackets, which are mapped to their corresponding key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scores = {'name':['Hugo,', 'David', 'René'],
          'city':['Guatemala', 'Estanzuela', 'Zacapa'],
            'score':[50,70,100]}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, I'm going to transform this dictionary, into a Pandas DataFrame.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df = pd.DataFrame(scores)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the data, just type the name of the DataFrame.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you should see a table with 'name', 'city' and 'scores' as column headers. And three rows of corresponding data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjy7yvtkasyu8c23bdkgy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjy7yvtkasyu8c23bdkgy.png" alt="Image description" width="740" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each columns is a series, and notice the values zero, one, and two to the left. These are the Index of our DataFrame. And are useful for referencing and subsetting our&lt;br&gt;
data.&lt;/p&gt;

&lt;p&gt;If we wanted to just return one column in our Data Frame, the notation is the DataFrame, and then the column name or names in square brackets. Let's take a look at 'score'.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df['score']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqv20tpcrt31v3d4j7d47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqv20tpcrt31v3d4j7d47.png" alt="Image description" width="740" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also call &lt;code&gt;df.score&lt;/code&gt; to return the same result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi29d84iwrnp9mwkish74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi29d84iwrnp9mwkish74.png" alt="Image description" width="740" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similarly, you can also create new columns in your DataFrame by passing a new column name into the square brackets and assigning it.&lt;/p&gt;

&lt;p&gt;Here, I'm creating a new column that combines the 'name' and 'city' columns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df['name_city'] = df['name'] + '_' + df['city']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's say I wanted to subset my data to only show those folks with scores above, say 70. To do that, I can create a boolean expression which returns true for scores greater than 70, and only return those records where this condition is true.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df[df['score']&amp;gt;69]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foza3avzeq6mynriyeeyc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foza3avzeq6mynriyeeyc.png" alt="Image description" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pandas is very flexible, in that you can import data, from a wide variety of data sources, including CSV's, Excel files, JSON files, databases, Parquet files, you name it. &lt;/p&gt;

&lt;p&gt;I'm going to import the Iris dataset, as a DataFrame called 'iris'. This is a common sample dataset for practicing Datascience.&lt;/p&gt;

&lt;p&gt;You can find the link of the dataset from Kaggle, &lt;a href="https://www.kaggle.com/uciml/iris/version/2" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iris = pd.read_csv('iris.csv')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DataFrames have an attribute called 'shape', which tell us the dimensionality of our data. By calling the name of the data frame, followed by the '.shape' I can see the number of rows and columns that the data frame has.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w86in2xm7thjucumusn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w86in2xm7thjucumusn.png" alt="Image description" width="416" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To preview the data, there's the 'head' function will return the top records of the DataFrame.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnxq7ewuvej6iphbu7ibn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnxq7ewuvej6iphbu7ibn.png" alt="Image description" width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similarly, I can see the bottom rows with the 'tail' function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6c9kce6i743qnyrbxral.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6c9kce6i743qnyrbxral.png" alt="Image description" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Working with data in Pandas, datatypes are very important and will influence what operations can be performed. I found Pandas to be pretty intelligent in how it assigns datatypes, but as the Russians say: "trust, but double check".&lt;/p&gt;

&lt;p&gt;To do this, call the dtypes attribute on your data&lt;br&gt;
frames.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumz76hvxbnuro13tvb1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumz76hvxbnuro13tvb1a.png" alt="Image description" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are two datatypes represented in  this DataFrame, float for all the measurement data, and object for the species.&lt;/p&gt;

&lt;p&gt;Often when using pandas, you'll want to subset your data, and 'loc' allows you to subset your data based on index labels, so either the row indexes or column names, 'iloc' subsets by position, so the row number or column order.&lt;/p&gt;

&lt;p&gt;I'm going to subset this DataFrame based on row indexes three, four and five, which are the fourth through sixth rows of our data. Note indexing begins at zero.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkxq57meup7np8wihm1y1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkxq57meup7np8wihm1y1.png" alt="Image description" width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also return a single-cell value, by passing a row and column names separated by a comma.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukhesc5xj2a5dxjm96cr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukhesc5xj2a5dxjm96cr.png" alt="Image description" width="756" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This returns 3.1, which is the measurement for sepal length for the row at index three in our data frame.&lt;/p&gt;

&lt;p&gt;Using 'iloc' I can return the same value by referencing the same row index of three but a column index of zero.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fepzjn1hohi2pntyvvoit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fepzjn1hohi2pntyvvoit.png" alt="Image description" width="524" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Often, after you've done a whole host of data transformation with Pandas, you want to export your DataFrame for analysis or visualization. &lt;br&gt;
A handy way to do this is the 'to_csv' function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iris.to_csv ('iris-output.csv', index=False)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note you may want to include index equal to false, so the index isn't included in your CSV.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2 - Configuring Options in Pandas
&lt;/h2&gt;

&lt;p&gt;Pandas has an option system, which allows you to customize how the package works for you. Most often, this can be useful  to change how results are displayed in Pandas. Here's an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd

emissions = pd.DataFrame \
({"country": ['China', 'United States', 'India'],\
"year": ['2018', '2018', '2018'],\
"co2 emissions": [10060000000.0,5410000000.0,2650000000.0]})

emissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2e1yi5z7g2cum3eaik9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2e1yi5z7g2cum3eaik9h.png" alt="Image description" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will start with this simple DataFrame, the first option which comes in handy is to configure the maximum row size display for a Pandas DataFrame.&lt;/p&gt;

&lt;p&gt;If we set the max row size to two, here's what we get.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pd.set_option('max_rows', 2)
emissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg7xrnpvcst6qt1qa6ibi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg7xrnpvcst6qt1qa6ibi.png" alt="Image description" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you see two rows displayed, separated by an ellipses, that's what this option does.You can either use it to limit the screen space your displayed data frames take up or conversely to expand the row size, to reveal more of your data. Similarly, the max columns display option will&lt;br&gt;
reveal or hide columns. I find this most useful when viewing the head of a data frame that has a lot of columns as Pandas will truncate these by default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqmabiecm2i0ovwx6vxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqmabiecm2i0ovwx6vxq.png" alt="Image description" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By modifying the float format option, you can display values with a lots of decimals, normally, and even add in a comma as 1,000 separator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pd.options.display.float_format = '{:,.2f}'. format
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhk1i3boofabsjwp9d7zb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhk1i3boofabsjwp9d7zb.png" alt="Image description" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3 - Advanced Calculations
&lt;/h2&gt;

&lt;p&gt;One area where you might encounter some hurdles with pandas is dealing with data types. As I said at the beginning of this article, Pandas, generally speaking it's pretty good at assigning proper data types nonetheless, you'll find many instances when you need to convert data types.&lt;/p&gt;

&lt;p&gt;To give you a couple of examples, I'm going to leverage the planets dataset, as it has a good variety of data types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkaqb6gf6yduaehyodk3a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkaqb6gf6yduaehyodk3a.png" alt="Image description" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From looking over the data frame, you can probably infer what the data type assignments will be, but to be sure I can access the types attribute of planets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1s31z75tv4l69i1uhhj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1s31z75tv4l69i1uhhj.png" alt="Image description" width="728" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, the data types varying from an object to integers to floats. How pandas handles your data depends on the data types you've designated. For example, If I use the 'mean' function to return the average for all float and integers in the dataset.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu3mg2l7vcz8gu1e37z6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu3mg2l7vcz8gu1e37z6d.png" alt="Image description" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Aside from some warning, everything looks OK, but you might question whether it really makes sense to take an average of the year as I've done here.&lt;/p&gt;

&lt;p&gt;Let's see how different data types interact.&lt;/p&gt;

&lt;p&gt;Here, I'm dividing an integer column by a float.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;planets['number'][0]/planets ['mass'][0]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is a float, great, that's what you'd hope&lt;br&gt;
for.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13iv6bh49wia6li75lq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13iv6bh49wia6li75lq8.png" alt="Image description" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also have the ability to change data types using the 'astype' function. For instance, I can convert the integer value of the 'number' column to a float.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;planets['number'][0].astype(float)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffojqvfhefza97bx1gro9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffojqvfhefza97bx1gro9.png" alt="Image description" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's useful to see what happens when you convert a float to an int. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxofioklaelb9tnl6yipb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxofioklaelb9tnl6yipb.png" alt="Image description" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case, we've lost the decimal point. And &lt;strong&gt;it's worth noting that this approach would effectively round down any floats as you convert to integers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I can also cover the 'year' to an object by calling the 'astype(str)' for string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;planets['year'][0].astype(str)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96ob2pckd3n9khle7w68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96ob2pckd3n9khle7w68.png" alt="Image description" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To take advantage of the date time data type in Pandas I can convert the integer 'year' value to a date time using 'to_datetime' and then specify how the data is currently&lt;br&gt;
formatted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;planets['year_dt'] = pd.to_datetime(planets['year'], format='%Y')
planets['year_dt']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxzu0xtcg179jy21o1qa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxzu0xtcg179jy21o1qa.png" alt="Image description" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>analytics</category>
      <category>data</category>
    </item>
    <item>
      <title>Become a DevOps in 2021 pt. 1</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Sun, 07 Mar 2021 17:48:39 +0000</pubDate>
      <link>https://dev.to/hugoestradas/become-a-devops-in-2021-1k0d</link>
      <guid>https://dev.to/hugoestradas/become-a-devops-in-2021-1k0d</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21v1k3l01ffc2ndgexr7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21v1k3l01ffc2ndgexr7.png" alt="Alt Text" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The DevOps Concept
&lt;/h1&gt;

&lt;p&gt;DevOps is the combination of cultural philosophies, practices, and tools that increases an organization’s ability to deliver applications and services at high velocity: evolving and improving products at a faster pace than organizations using traditional software development and infrastructure management processes. This speed enables organizations to better serve their customers and compete more effectively in the market.&lt;/p&gt;

&lt;h1&gt;
  
  
  How DevOps Works
&lt;/h1&gt;

&lt;p&gt;Under a DevOps model, development and operations teams are no longer “siloed.” Sometimes, these two teams are merged into a single team where the engineers work across the entire application lifecycle, from development and test to deployment to operations, and develop a range of skills not limited to a single function.&lt;/p&gt;

&lt;p&gt;In some DevOps models, quality assurance and security teams may also become more tightly integrated with development and operations and throughout the application lifecycle. When security is the focus of everyone on a DevOps team, this is sometimes referred to as DevSecOps.&lt;br&gt;
These teams use practices to automate processes that historically have been manual and slow. They use a technology stack and tooling which help them operate and evolve applications quickly and reliably. These tools also help engineers independently accomplish tasks (for example, deploying code or provisioning infrastructure) that normally would have required help from other teams, and this further increases a team’s velocity.&lt;/p&gt;

&lt;h1&gt;
  
  
  Benefits of DevOps:
&lt;/h1&gt;

&lt;p&gt;Speed&lt;br&gt;
Rapid delivery&lt;br&gt;
Reliability&lt;br&gt;
Improved collaboration&lt;br&gt;
Security&lt;/p&gt;

&lt;h1&gt;
  
  
  Continuous Integration
&lt;/h1&gt;

&lt;p&gt;Continuous integration is a software development practice where developers regularly merge their code changes into a central repository, after which automated builds and tests are run. The key goals of continuous integration are to find and address bugs quicker, improve software quality, and reduce the time it takes to validate and release new software updates.&lt;/p&gt;

&lt;h1&gt;
  
  
  Continuous Delivery
&lt;/h1&gt;

&lt;p&gt;Continuous delivery is a software development practice where code changes are automatically built, tested, and prepared for a release to production. It expands upon continuous integration by deploying all code changes to a testing environment and/or a production environment after the build stage. When continuous delivery is implemented properly, developers will always have a deployment-ready build artifact that has passed through a standardized test process.&lt;/p&gt;

&lt;h1&gt;
  
  
  Infrastructure as Code
&lt;/h1&gt;

&lt;p&gt;Infrastructure as code is a practice in which infrastructure is provisioned and managed using code and software development techniques, such as version control and continuous integration. The cloud’s API-driven model enables developers and system administrators to interact with infrastructure programmatically, and at scale, instead of needing to manually set up and configure resources. Thus, engineers can interface with infrastructure using code-based tools and treat infrastructure in a manner similar to how they treat application code. Because they are defined by code, infrastructure and servers can quickly be deployed using standardized patterns, updated with the latest patches and versions, or duplicated in repeatable ways.&lt;/p&gt;

&lt;h1&gt;
  
  
  Communication and Collaboration
&lt;/h1&gt;

&lt;p&gt;Increased communication and collaboration in an organization is one of the key cultural aspects of DevOps. The use of DevOps tooling and automation of the software delivery process establishes collaboration by physically bringing together the workflows and responsibilities of development and operations. Building on top of that, these teams set strong cultural norms around information sharing and facilitating communication through the use of chat applications, issue or project tracking systems, and wikis. This helps speed up communication across developers, operations, and even other teams like marketing or sales, allowing all parts of the organization to align more closely on goals and projects.&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn a Programming Language
&lt;/h1&gt;

&lt;p&gt;DevOps teams can choose from many available programming languages. All languages have both strengths and weaknesses -- some inherent to the language itself, and others dependent on a given application or context in which the language is used.&lt;/p&gt;

&lt;p&gt;DevOps explores the intersection between software development and traditional IT operations. While developers work most closely with programming languages, IT ops admins and DevOps engineers still need some level of familiarity with the languages used in their organizations to, for example, handle integrations and develop scripts.&lt;/p&gt;

&lt;p&gt;There are some general tradeoffs to consider when choosing a programming language. For example, many IT operations admins use scripted or interpreted languages, as they enable rapid development. Compared to compiled languages, however, interpreted languages have a slower execution speed.&lt;/p&gt;

&lt;p&gt;In addition, some programming languages are statically typed, while others are dynamically typed. Statically typed languages check data types for errors at compile time -- which results in fewer errors at runtime; dynamically typed languages don't check for errors until runtime. Statically typed languages also require DevOps teams to define variables before use -- something dynamic typing does not require.&lt;/p&gt;

&lt;h1&gt;
  
  
  Go
&lt;/h1&gt;

&lt;p&gt;Golang, also known as “Go,” is a compiled language, fast and high-performance language intended to be simple and is designed to be easy to read and understand. Go was created at Google by Rob Pike, Robert Griesemer, and Ken Thompson, and it first appeared in Nov 2009.&lt;br&gt;
The syntax of Golang is designed to be highly clean and accessible.&lt;/p&gt;

&lt;p&gt;Here is a classic “hello world” example code with Golang:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F296acoxv754s5un03bgr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F296acoxv754s5un03bgr.png" alt="Alt Text" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Python
&lt;/h1&gt;

&lt;p&gt;What’s Python’s role in DevOps? Python is one of the primary technologies used by teams practicing DevOps. Its flexibility and accessibility make Python a great fit for this job, enabling the whole team to build web applications, data visualizations, and to improve their workflow with custom utilities. On top of that, Ansible and other popular DevOps tools are written in Python or can be controlled via Python.&lt;/p&gt;

&lt;p&gt;Unlike Go, Python has been around for a very long time. Python is an interpreted language, which means it is evaluated at runtime, but it supports quick development speeds -- a notable advantage in a fast-moving DevOps environment. Additionally, Python is very flexible, as it's a dynamically typed language; this enables it to interface with a variety of other tools within a DevOps workflow.&lt;/p&gt;

&lt;p&gt;However, because it's an interpreted language, Python has a more complicated prerequisite setup and slower execution speed. The nature of dynamic typing can also introduce runtime errors more easily.&lt;/p&gt;

&lt;p&gt;Here is a classic “hello world” example code with Python.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13k01v9wdtug1oupew4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13k01v9wdtug1oupew4f.png" alt="Alt Text" width="654" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  C and C++
&lt;/h1&gt;

&lt;p&gt;Both the C and C++ languages have a long and storied history. Powerful and developed extensively, these languages offer unparalleled capability across a variety of OSes. Execution speed and low-level access are among the most desirable features. C is a classic low-level procedural language, while C++ is a superset of C that offers object-oriented features on top.&lt;/p&gt;

&lt;p&gt;Disadvantages include the languages' complexity, need for manual memory management, longer build times and the challenge to configure compilers correctly for the organization's needs.&lt;/p&gt;

&lt;p&gt;Here is a classic “hello world” example code with C++:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow614jose3k99xasiu4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow614jose3k99xasiu4c.png" alt="Alt Text" width="672" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Ruby
&lt;/h1&gt;

&lt;p&gt;The biggest advantage of Ruby -- another interpreted language -- is its simplicity, as well as the industry's diverse support for Ruby Gems, or modules. Ruby's simplicity enables the rapid development and implementation of necessary scripts for DevOps processes.&lt;/p&gt;

&lt;p&gt;Ruby, however, often has a slower execution speed, not only in terms of general performance, but also for boot speed in certain circumstances. Finally, if an IT organization uses Ruby for database access, its tight Active Record coupling means that admins might lose necessary flexibility, depending on the requirements.&lt;/p&gt;

&lt;p&gt;Here is a classic “hello world” example code with Ruby:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jbmqvfg0z9n8ipd2pst.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jbmqvfg0z9n8ipd2pst.png" alt="Alt Text" width="620" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Linux Basics
&lt;/h1&gt;

&lt;p&gt;Modern Linux and DevOps have much in common from a philosophy perspective. Both are focused on functionality, scalability, as well as on the constant possibility of growth and improvement. While Windows may still be the most widely used operating system, and by extension the most common for DevOp practitioners, it is not the preferred OS by many. That honor goes to Linux. There are many DevOp practitioners who would like to try Linux for a variety of reasons but do not know exactly which distribution to use. This is a common problem and one that stems from a poor understanding of what each distribution offers. &lt;/p&gt;

&lt;p&gt;No single distribution can be considered the best. One of the core principles behind Linux is customization. Different distributions, or versions, of Linux, can be created depending on the exact needs of a particular individual or group much the same way different cryptocurrencies are based on the same blockchain technology but with minor changes to fulfill specific functions; take Ethereum classic vs Ethereum for example.&lt;/p&gt;

&lt;h1&gt;
  
  
  DevOps and Linux
&lt;/h1&gt;

&lt;p&gt;As previously mentioned, Linux and DevOps share very similar philosophies and perspectives; both are focused on customization and scalability. The customization aspect of Linux is of particular importance for DevOps. It allows for design and security applications specific to a particular development environment or development goals to be created. There is much more freedom over how the operating system functions compared to Windows. Another item of convenience is that most Software delivery pipelines use Linux based servers. If the DevOps team is using a Linux based operating system they can do all testing in house and with extreme ease.&lt;/p&gt;

&lt;p&gt;Because the Linux Kernel can process huge amounts of memory any Linux based system is highly scalable. If the hard drive or other hardware requirements change during the development process these requirements can be added without losing processing power. The same cannot always be said of Windows.&lt;/p&gt;

&lt;p&gt;There are many good reasons why DevOps practitioners should implement Linux distributions in their workplace. The benefits far outweigh the negatives and it can ultimately lead to a smoother, more efficient development environment. This being said, choosing the right distribution is not always easy. One must properly identify what exact requirements need to be fulfilled before making the decision.&lt;/p&gt;

&lt;p&gt;As development requirements become more demanding, especially with the rise in cloud computing software, many more developers will begin turning to Linux not only for its customization and scalability but also because of its efficiency and superior processing capabilities compared to Windows and Apple.&lt;/p&gt;

&lt;h1&gt;
  
  
  Best Linux Distros for DevOps
&lt;/h1&gt;

&lt;p&gt;Ubuntu&lt;br&gt;
CentOS&lt;br&gt;
Fedora&lt;br&gt;
Cloud Linux OS&lt;br&gt;
Debian&lt;/p&gt;

&lt;h1&gt;
  
  
  Shell Commands
&lt;/h1&gt;

&lt;h1&gt;
  
  
  $ ls 
&lt;/h1&gt;

&lt;p&gt;This command lists all the contents in the current working directory.&lt;br&gt;
ls &lt;br&gt;&lt;br&gt;
By specifying the path after ls, the content in that path will be displayed.&lt;br&gt;
ls -l&lt;br&gt;
Using the ‘l’ flag, lists all the contents along with its owner settings, permissions &amp;amp; time.&lt;br&gt;
ls -a&lt;br&gt;
Using ‘a’ flag, lists all the hidden contents in the specified directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  $sudo 
&lt;/h1&gt;

&lt;p&gt;The sudo command allows you to run programs with the security privileges of another user (by default, as the superuser). It prompts you for your personal password and confirms your request to execute a command by checking a file, called sudoers , which the system administrator configures.&lt;br&gt;
sudo useradd &lt;br&gt;
Adding a new user.&lt;br&gt;
sudo passwd &lt;br&gt;
Setting a password for the new user.&lt;br&gt;
sudo userdel &lt;br&gt;
Deleting the user.&lt;br&gt;
sudo groupadd &lt;br&gt;
Adding a new group.&lt;br&gt;
sudo groupdel &lt;br&gt;
Deleting the  group.&lt;br&gt;
sudo usermod -g  &lt;br&gt;
Adding a user to a primary group.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ cat {flag} 
&lt;/h1&gt;

&lt;p&gt;This command can read, modify or concatenate text files. It also displays file contents.&lt;br&gt;
cat -b&lt;br&gt;
This adds line numbers to non-blank lines.&lt;br&gt;
cat -n&lt;br&gt;
This adds line numbers to all lines.&lt;br&gt;
cat -s&lt;br&gt;
This squeezes blank lines into one line.&lt;br&gt;
cat –E&lt;br&gt;
This shows $ at the end of line.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ grep  {filename}
&lt;/h1&gt;

&lt;p&gt;It’s used to search for a string of characters in a specified file. The text search pattern is called a regular expression. When it finds a match, it prints the line with the result. The grep command is handy when searching through large log files.&lt;br&gt;
grep -i&lt;br&gt;
Returns the results for case insensitive strings.&lt;br&gt;
grep -n &lt;br&gt;
Returns the matching strings along with their line number.&lt;br&gt;
grep -v&lt;br&gt;
Returns the result of lines not matching the search string.&lt;br&gt;
grep -c&lt;br&gt;
Returns the number of lines in which the results matched the search string.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ sort  {filename}
&lt;/h1&gt;

&lt;p&gt;It’s used to sort a complete file by arranging the records in a specific order. By default, the sort command sorts files assuming that the contents are ASCII characters. The file is sorted line by line​, and the blank space is used as the field separator.&lt;br&gt;
sort -r&lt;br&gt;
The flag returns the results in reverse order.&lt;br&gt;
sort -f&lt;br&gt;
The flag does case insensitive sorting.&lt;br&gt;
sort -n&lt;br&gt;
The flag returns the results as per numerical order.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ head
&lt;/h1&gt;

&lt;p&gt;The head command is a command-line utility for outputting the first part of files given to it via standard input. It writes results to standard output. By default head returns the first ten lines of each file that it is given.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ tail
&lt;/h1&gt;

&lt;p&gt;It is complementary to head command. The tail command, as the name implies, prints the last N number of data of the given input. By default, it prints the last 10 lines of the specified files. If you give more than one filename, then data from each file precedes by its file name.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ chown
&lt;/h1&gt;

&lt;p&gt;Different users in the operating system have ownership and permission to ensure that the files are secure and put restrictions on who can modify the contents of the files. In Linux there are different users who use the system:&lt;br&gt;
Each user has some properties associated with them, such as a user ID and a home directory. We can add users into a group to make the process of managing users easier.&lt;br&gt;
A group can have zero or more users. A specified user is associated with a “default group”. It can also be a member of other groups on the system as well.&lt;br&gt;
Ownership and Permissions: To protect and secure files and directories in Linux we use permissions to control what a user can do with a file or directory. Linux uses three types of permissions:&lt;br&gt;
Read: This permission allows the user to read files and in directories, it lets the user read directories and subdirectories stores in it.&lt;br&gt;
Write: This permission allows a user to modify and delete a file. Also, it allows a user to modify its contents (create, delete and rename files in it) for the directories. Unless you give the execute permission to directories, changes do not affect them.&lt;br&gt;
Execute: The write permission on a file executes the file. For example, if we have a file named sh so unless we don’t give it execute permission it won’t run.&lt;br&gt;
Types of file Permissions:&lt;br&gt;
User: This type of file permission affects the owner of the file.&lt;br&gt;
Group: This type of file permission affects the group which owns the file. Instead of the group permissions, the user permissions will apply if the owner user is in this group.&lt;br&gt;
Other: This type of file permission affects all other users on the system.&lt;br&gt;
To view the permissions we use:&lt;br&gt;
ls -l&lt;br&gt;
The chown command is used to change the file Owner or group. Whenever you want to change ownership you can use the chown command.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ chmod  {filename}
&lt;/h1&gt;

&lt;p&gt;This command is used to change the access permissions of files and directories.&lt;br&gt;
$ lsof [option] [username]&lt;br&gt;
While working in the Linux/Unix system there might be several files and folders which are being used, some of them would be visible and some not. lsof command stands for List Of Open File. This command provides a list of files that are opened. Basically, it gives the information to find out the files which are opened by which process. With one go it lists out all open files in the output console.&lt;br&gt;
$ id [option]… [user]&lt;br&gt;
It’s used to find out the user and group names and numeric IDs (UID or group ID) of the current user or any other user in the server. This command is useful to find out the following information as listed below:&lt;br&gt;
User name and real user id.&lt;br&gt;
Find out the specific Users UID.&lt;br&gt;
Show the UID and all groups associated with a user.&lt;br&gt;
List out all the groups a user belongs to.&lt;br&gt;
Display security context of the current user.&lt;br&gt;
Options:&lt;br&gt;
-g: Print only the effective group id.&lt;br&gt;
-G: Print all Group IDs.&lt;br&gt;
-n: Prints name instead of a number.&lt;br&gt;
-r: Prints real ID instead of numbers.&lt;br&gt;
-u: Prints only the effective user ID.&lt;br&gt;
–help: Display help messages and exit.&lt;br&gt;
–version: Display the version information and exit.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ cut
&lt;/h1&gt;

&lt;p&gt;It’s used for extracting a portion of a file using columns and delimiters. If you want to list everything in a selected column, use the “-c” flag with the cut command. For example, let's select the first two columns from our demo1.txt file.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ sed
&lt;/h1&gt;

&lt;p&gt;Sed is a text-editor that can perform editing operations in a non-interactive way. The sed command gets its input from standard input or a file to perform the editing operation on a file. Sed is a very powerful utility and you can do a lot of file manipulations using sed. I will explain the important operation you might want to do with a text file.&lt;br&gt;
If you want to replace a text in a file by searching it in a file, you can use the sed command with a substitute “s” flag to search for the specific pattern and change it. For example, lets replace  “mikesh” in test.txt file to “Mukesh”&lt;/p&gt;

&lt;h1&gt;
  
  
  $ diff
&lt;/h1&gt;

&lt;p&gt;It’s used to find the difference between two files. This command analyses the files and prints the lines which are not similar. Let's say we have two files, test and test1. you can find the difference between the two files using the following command.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ history
&lt;/h1&gt;

&lt;p&gt;It’s used to view the previously executed command. This feature was not available in the Bourne shell. Bash and Korn support this feature in which every command executed is treated as the event and is associated with an event number using which they can be recalled and changed if required. These commands are saved in a history file. In Bash shell history command shows the whole list of the command.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ dd
&lt;/h1&gt;

&lt;p&gt;It’s a command-line utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy files.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ find
&lt;/h1&gt;

&lt;p&gt;command in UNIX is a command-line utility for walking a file hierarchy. It can be used to find files and directories and perform subsequent operations on them. It supports searching by file, folder, name, creation date, modification date, owner and permissions. By using the ‘-exec’ other UNIX commands can be executed on files or folders found.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ free [option]
&lt;/h1&gt;

&lt;p&gt;In LINUX, there exists a command-line utility for this and that is free command which displays the total amount of free space available along with the amount of memory used and swap memory in the system, and also the buffers used by the kernel.&lt;br&gt;
Free command without any option shows the used and free space of swap and physical memory in KB.&lt;br&gt;
When no option is used then free command produces the columnar output as shown above where column:&lt;br&gt;
Options for free command:&lt;br&gt;
-b, – -bytes :It displays the memory in bytes.&lt;br&gt;
-k, – -kilo :It displays the amount of memory in kilobytes(default).&lt;br&gt;
-m, – -mega :It displays the amount of memory in megabytes.&lt;br&gt;
-g, – -giga :It displays the amount of memory in gigabytes.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ssh-keygen
&lt;/h1&gt;

&lt;p&gt;Use the ssh-keygen command to generate a public/private authentication key pair. Authentication keys allow a user to connect to a remote system without supplying a password. Keys must be generated for each user separately. If you generate key pairs as the root user, only the root can use the keys.&lt;br&gt;
ip [ OPTIONS ] OBJECT { COMMAND | help }&lt;br&gt;
The ip command in Linux is present in the net-tools which is used for performing several network administration tasks.This command is used to show or manipulate routing, devices, and tunnels. This command is used to perform several tasks like assigning an address to a network interface or configuring network interface parameters. It can perform several other tasks like configuring and modifying the default and static routing, setting up a tunnel over IP, listing IP addresses and property information, modifying the status of the interface, assigning, deleting and setting up IP addresses and routes.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ nslookup [option]
&lt;/h1&gt;

&lt;p&gt;Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from a DNS server. It is a network administration tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or any other specific DNS record. It is also used to troubleshoot DNS related problems.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ curl [options] [URL...]
&lt;/h1&gt;

&lt;p&gt;curl is a command-line tool to transfer data to or from a server, using any of the supported protocols (HTTP, FTP, IMAP, POP3, SCP, SFTP, SMTP, TFTP, TELNET, LDAP or FILE). This command is powered by Libcurl. This tool is preferred for automation since it is designed to work without user interaction. It can transfer multiple files at once.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ps
&lt;/h1&gt;

&lt;p&gt;Every process in Linux has a unique ID and can be seen using the command ps.&lt;br&gt;
Options for the ps command:&lt;br&gt;
-a: show processes for all users.&lt;br&gt;
-u: display the process’s user/owner.&lt;br&gt;
-x: also show processes not attached to a terminal.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ kill
&lt;/h1&gt;

&lt;p&gt;Kill command in Linux (located in /bin/kill), is a built-in command which is used to terminate processes manually. This command sends a signal to a process that terminates the process. If the user doesn’t specify any signal which is to be sent along with the kill command then the default TERM signal is sent that terminates the process.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ df and $ du
&lt;/h1&gt;

&lt;p&gt;The df (disk free) command reports the amount of available disk space being used by file systems. The du (disk usage) command reports the sizes of directory trees inclusive of all of their contents and the sizes of individual files.&lt;br&gt;
The aim is to make sure you are not overshooting the 80% threshold. If you exceed the threshold it’s time to scale or clean-up the mess, because running out of resources you have to change your application shows some fickle behavior.&lt;/p&gt;

&lt;h1&gt;
  
  
  Linux Directory Structure
&lt;/h1&gt;

&lt;p&gt;The directory separator in Linux is the forward slash (/). When talking about directories and speaking directory paths, “forward slash” is abbreviated to “slash.” Often the root of the file system is referred to as “slash” since the full path to it is /. If you hear someone say “look in slash” or “that file is in slash,” they are referring to the root directory.&lt;/p&gt;

&lt;p&gt;/: The directory is called “root.” It is the starting point for the file system hierarchy. Note that this is not related to the root, or superuser, account.&lt;br&gt;
/bin: Binaries and other executable programs.&lt;br&gt;
/etc: System configuration files.&lt;br&gt;
/home: Home directories.&lt;br&gt;
/opt: Optional or third party software.&lt;br&gt;
/tmp: Temporary space, typically cleared on reboot.&lt;br&gt;
/usr: User related programs.&lt;br&gt;
/var: Variable data, most notably log files.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /bin
&lt;/h1&gt;

&lt;p&gt;The /bin directory is where you will find binary or executable files. Programs are written in source code which is human readable text. Source code is then compiled into machine readable binaries. They are called binaries because machine code is a series of zeros and ones. The import thing to know is that commands, programs, and applications that you can use are sometimes located in /bin.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /etc
&lt;/h1&gt;

&lt;p&gt;Configuration files live in the /etc directory. Configuration files control how the operating system or applications behave. For example, there is a file in /etc that tells the operating system whether to boot into a text mode or a graphical mode.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /home
&lt;/h1&gt;

&lt;p&gt;User home directories are located in /home. If your account name is “pat” your home directory will be /home/pat. Linux systems can and often do have multiple user accounts. Home directories allow each user to separate their data from the other users on the system. The pat directory is known as a subdirectory. A subdirectory is simply a directory that resides inside another directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /opt
&lt;/h1&gt;

&lt;p&gt;The /opt directory houses optional or third party software. Software that is not bundled with the operating system will often been installed in /opt. For example, the Google Earth application is not part of the standard Linux operating system and gets installed in the /opt/google/earth directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /tmp
&lt;/h1&gt;

&lt;p&gt;Temporary space is allocated in /tmp. Most Linux distributions clear the contents of /tmp at boot time. Be aware that if you put files in /tmp and the Linux system reboots, your files will more than likely be gone. The /tmp directory is a great place to store temporary files, but do not put anything in /tmp that you want to keep long term.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /usr
&lt;/h1&gt;

&lt;p&gt;The /usr directory is called “user.” You will find user related binary programs and executables in the /usr/bin directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  Directory /var
&lt;/h1&gt;

&lt;p&gt;The /usr directory is called “user.” You will find user related binary programs and executables in the /usr/bin directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  Linux Directory Tree
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiovgvt0s5m9qqooo4xan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiovgvt0s5m9qqooo4xan.png" alt="Alt Text" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  SSH Management
&lt;/h1&gt;

&lt;p&gt;SSH stands for Secure Shell and it is a protocol that is used to securely access a remote server on a local network or internet for configuration, management, monitoring, and troubleshooting, etc.&lt;/p&gt;

&lt;h1&gt;
  
  
  Official SSH Guide
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.ssh.com/ssh/command/" rel="noopener noreferrer"&gt;https://www.ssh.com/ssh/command/&lt;/a&gt; &lt;/p&gt;

&lt;h1&gt;
  
  
  Networking Layers OSI Model
&lt;/h1&gt;

&lt;p&gt;The Open System Interconnection model (OSI) is a seven layer model used to visualize computer networks. The OSI model is often viewed as complicated and many fear having to learn the model. However, the OSI model is an extremely useful tool for development and problem solving. Each of the seven layers goes up in increments of one as it gets closer to the human user. Layer one — the application layer, is closest to the person while layer seven — the physical layer is where the network receives and transmits raw data. The OSI model belongs to the International Organization for Standards (ISO) and is maintained by the identification ISO/IEC 7498–1. In this post, each of the seven layers of the OSI model will be explained in simple terms. The layers will be explained from layer seven to layer one, as this is where the data flow starts.&lt;/p&gt;

&lt;h1&gt;
  
  
  OSI Model Diagram
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrm68y4p9upjy93ig5ed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrm68y4p9upjy93ig5ed.png" alt="Alt Text" width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ip link
&lt;/h1&gt;

&lt;p&gt;It’s for configuring, adding, and deleting network interfaces. Use ip link show command to display all network interfaces on the system.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ip address
&lt;/h1&gt;

&lt;p&gt;Use the ip address command to display addresses, bind new addresses or delete old ones. The man page ipad.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ip route
&lt;/h1&gt;

&lt;p&gt;Use the IP route to print or display the routing table.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ nmap
&lt;/h1&gt;

&lt;p&gt;Nmap (“Network Mapper”) is a powerful utility used for network discovery, security auditing, and administration. Many system admins use it to determine which of their systems are online, and also for OS detection and service detection. &lt;br&gt;
The default Nmap scan shows the ports, their state (open/closed), and protocols. It sends a packet to 1000 most common ports and checks for the response.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ping
&lt;/h1&gt;

&lt;p&gt;Use ping to see if a host is alive. This super simple command helps you check the status of a host or a network segment. Ping command sends an ICMP ECHO_REQUEST packet to the target host and waits to see if it replies.&lt;br&gt;
However, some hosts block ICMP echo requests with a firewall. Some sites on the internet may also do the same.&lt;br&gt;
By default, ping runs in an infinite loop. To send a defined number of packets, use -c flag.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ iperf
&lt;/h1&gt;

&lt;p&gt;While ping verifies the availability of a host, iPerf helps analyze and measure network performance between two hosts. With iPerf, you open a connection between two hosts and send some data. iPerf then shows the bandwidth available between the two hosts.&lt;br&gt;
You can install an iPerf using your distribution package manager. &lt;/p&gt;

&lt;h1&gt;
  
  
  $ traceroute
&lt;/h1&gt;

&lt;p&gt;If ping shows missing packets, you should use traceroute to see what route the packets are taking.  Traceroute shows the sequence of gateways through which the packets travel to reach their destination.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ tcpdump
&lt;/h1&gt;

&lt;p&gt;tcpdump is a packet sniffing tool and can be of great help when resolving network issues. It listens to the network traffic and prints packet information based on the criteria you define.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ netstat
&lt;/h1&gt;

&lt;p&gt;Netstat command is used to examine network connections, routing tables, and various network settings and statistics.&lt;br&gt;
Use -i flag to list the network interfaces on your system.&lt;/p&gt;

&lt;h1&gt;
  
  
  $ ss
&lt;/h1&gt;

&lt;p&gt;Linux installations have a lot of services running by default. These should be disabled or preferably removed, as this helps in reducing the attack surface. You can see what services are running with the netstat command. While netstat is still available, most Linux distributions are transitioning to ss command.&lt;br&gt;
use ss command with -t and -a flags to list all TCP sockets. This displays both listening and non-listening sockets.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloudnative</category>
      <category>cloudskills</category>
    </item>
    <item>
      <title>Data Visualization with Python pt. iii</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Mon, 18 Jan 2021 17:56:06 +0000</pubDate>
      <link>https://dev.to/hugoestradas/data-visualization-with-python-pt-iii-78g</link>
      <guid>https://dev.to/hugoestradas/data-visualization-with-python-pt-iii-78g</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frw2r5tfdokuwvcl7qdrw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frw2r5tfdokuwvcl7qdrw.jpg" alt="Alt Text" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The notebooks of my Data Visualization Series are here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/hugoestradas/Data_Visualisation_with_Python.git" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/Data_Visualisation_with_Python.git&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's talk about time series.&lt;/p&gt;

&lt;p&gt;Anyone interested in data visualization should know and understand time series, but what on earth are time series &amp;lt;?&amp;gt;&lt;/p&gt;

&lt;p&gt;In a nutshell, a time series is any chart that shows a trend over time; and often is a line chart.&lt;/p&gt;

&lt;p&gt;Here's an example of a time series:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4girfsappguc237dhctm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4girfsappguc237dhctm.png" alt="Alt Text" width="601" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Usually times series in Python are built using Matplotlib, as the one shown above; and as you can see it's a combination of a line chart and a scatter plot.&lt;/p&gt;

&lt;p&gt;Part 1: When should you use charts and time series &amp;lt;?&amp;gt;&lt;/p&gt;

&lt;p&gt;Let's suppose you are a marketing manager for an online store.&lt;br&gt;
You started selling some kind of popular product recently, and you want to see what kind of customers are buying this product.&lt;br&gt;
So you started analyzing the sales data, and you found this piece of data:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6dec1nb1sbokql5oy463.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6dec1nb1sbokql5oy463.PNG" alt="Alt Text" width="800" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you looked at the sales volume on a particular Sunday, it turns out that there are more male buyers than female buyers, about 450 units sold for male customers, versus about 300 for female customers.&lt;/p&gt;

&lt;p&gt;You might conclude, this product is more popular with males than females. With this information in mind you might then start targeting male customers in your marketing strategy. But, here's the question: "Using this graph alone, can you actually conclude that this product is more popular with male customers than female customers &amp;lt;?&amp;gt;".&lt;/p&gt;

&lt;p&gt;Short answer: NOT NECESSARILY.&lt;/p&gt;

&lt;p&gt;First of all, there are only about 800 units sold in total here, meaning the sample size is quite small. And even if the difference is statistically significant, it's possible that male customers tend to buy this product more than female customers, only on Sundays.&lt;/p&gt;

&lt;p&gt;In order to make an analysis much more robust, one approach is to plot a line chart over time, and make a time series for male and female customers.&lt;/p&gt;

&lt;p&gt;After doing that, you might see a chart like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1edz6ihkvm04khu52lzy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1edz6ihkvm04khu52lzy.PNG" alt="Alt Text" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After seeing a chart like this and you can be more confident of your conclusion that male customers buy this product more than female customers, because the difference is consistent over time.&lt;/p&gt;

&lt;p&gt;However, it is possible that you ended up with a chart like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzge10ft6i6fxogzlxuif.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzge10ft6i6fxogzlxuif.PNG" alt="Alt Text" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, you wouldn't be able to make the same conclusion anymore.&lt;/p&gt;

&lt;p&gt;Summarizing the main reasons why time series and line charts are so useful:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It's a consistent way to examine the trend over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you have a particular hypothesis that you want to test, or an experiment that you're running; time series and line charts allow you to test it on a variety of conditions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;They make your analysis much more statistically robust, and reduces misinterpretation of your data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Part 2: Creating Line Charts with Matplotlib&lt;/p&gt;

&lt;p&gt;I am going to compare the GDP Per Capita growth in the US and China, using the same 'dataii.csv' file.&lt;/p&gt;

&lt;p&gt;Since I want to compare GDP Per capita's trend over time; I'm going to create a time series with a line chart.&lt;/p&gt;

&lt;p&gt;The important columns for this exercise are: &lt;/p&gt;

&lt;p&gt;country&lt;br&gt;
year&lt;br&gt;
gdpPerCapita&lt;/p&gt;

&lt;p&gt;Also, I'm going to use the iloc syntax to select an item in the Pandas series, and I'll be multiplying and dividing it with a scalar.&lt;/p&gt;

&lt;p&gt;First, lets load the data into a Pandas Dataframe:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhf08cnhfqbs1vmatu9da.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhf08cnhfqbs1vmatu9da.PNG" alt="Alt Text" width="800" height="643"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Time to examin how the GDP Per capita in the US has grown over time:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6cvrunq8254u19eprfn1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6cvrunq8254u19eprfn1.PNG" alt="Alt Text" width="558" height="765"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I'll grab the data for China, and compare it with the US data and plot it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fytlphywzz00ff5ci0940.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fytlphywzz00ff5ci0940.PNG" alt="Alt Text" width="501" height="774"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, for comparing the growth itself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd9kbw0m309l5ur8ssovi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd9kbw0m309l5ur8ssovi.PNG" alt="Alt Text" width="455" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuc0k9d4v4ufvq4rz3xnm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuc0k9d4v4ufvq4rz3xnm.PNG" alt="Alt Text" width="749" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, to plot the final chart, I'm going to call the &lt;br&gt;
'plt.plot()' function twice, by putting US and China growth on the same graph, instead of the raw GDP Per Capita values:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F61x3mqjjqonzl2fqf7na.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F61x3mqjjqonzl2fqf7na.png" alt="Alt Text" width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the final graph is the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd0n1ls2on9qnfwbso3ro.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd0n1ls2on9qnfwbso3ro.PNG" alt="Alt Text" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 3: When to use Scatter Plots&lt;/p&gt;

&lt;p&gt;In a nutshell, scatter plots provide a convenient way to visualize how two numeric variables are related in your data. &lt;/p&gt;

&lt;p&gt;Here's a glimpse to a scatter plot that shows how weights and heights are related in a hundred people:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdlq5od2rj2utalqh1286.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdlq5od2rj2utalqh1286.PNG" alt="Alt Text" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 4: Creating Scatter Plots with Matplotlib&lt;/p&gt;

&lt;p&gt;We're going to examine how to create scatter plots with Matplotlib.&lt;/p&gt;

&lt;p&gt;Suppose as an example, you need to find the GDP Per Capita and life expectancy are related to each other in different countries.&lt;/p&gt;

&lt;p&gt;To do this, in the 'dataii.csv' file, our countries dataset; the columns we'll need to use are lifeExpectancy and gdpPerCapita, as well as year, so we can find the relationship between life expectancy and GDP Per Capita for each given year.&lt;/p&gt;

&lt;p&gt;For this part I'm going to be importing the NumPy library, since I'm going to need the 'log10()' function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F042p0qq8xd923k09st8b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F042p0qq8xd923k09st8b.png" alt="Alt Text" width="590" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's first examine how GDP Per Capita and life expectancy are related in 2007:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5m63jmi5cnopolhfp44j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5m63jmi5cnopolhfp44j.png" alt="Alt Text" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a scatter plot with gdpPerCapita and lifeExpectancy using the data of 'data2007' with plt, just type:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F78vntft3y7kp2hos2gx5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F78vntft3y7kp2hos2gx5.png" alt="Alt Text" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the result plot is the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftwrr1z6qgzyp14bcbd24.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftwrr1z6qgzyp14bcbd24.PNG" alt="Alt Text" width="800" height="787"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Data Visualization with Python pt. ii</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Sat, 16 Jan 2021 18:37:47 +0000</pubDate>
      <link>https://dev.to/hugoestradas/data-visualization-with-python-pt-ii-2nd7</link>
      <guid>https://dev.to/hugoestradas/data-visualization-with-python-pt-ii-2nd7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpdu7d92wki7a07ux3yc9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpdu7d92wki7a07ux3yc9.jpg" alt="Alt Text" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The notebook of this lecture is in my GitHub repo:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/hugoestradas/Data_Visualisation_with_Python.git" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/Data_Visualisation_with_Python.git&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;Part 1: What on earth are "Histograms" &amp;lt;?&amp;gt;&lt;/p&gt;

&lt;p&gt;Suppose you're in charge that a website always load fast and one day the average page loading time in... lets say June is significantly slower than the previous 5 months.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F74j1eoglq79hc8hwnnmt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F74j1eoglq79hc8hwnnmt.png" alt="Alt Text" width="560" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This type of scenarios are where the histograms really shine, because they show a kind of history in their graphs.&lt;/p&gt;

&lt;p&gt;Histograms helps you understand the distribution of a numeric value in a way that cannot with mean or median alone.&lt;/p&gt;

&lt;p&gt;Part 2: Histograms with Matplotlib&lt;/p&gt;

&lt;p&gt;Let's import Pandas and Matplotlib:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fya626dmr0s1cv3gudubi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fya626dmr0s1cv3gudubi.png" alt="Alt Text" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this example I'm going to be using a larger dataset called "dataii.csv", let's import it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2h1blbra20ok90k9f46t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2h1blbra20ok90k9f46t.png" alt="Alt Text" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this part, I'll create histograms using the 'subplot()' function.&lt;/p&gt;

&lt;p&gt;To check which continents are included within the data I'll use the 'set()' function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyjpvou75jivys7pg4sp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyjpvou75jivys7pg4sp1.png" alt="Alt Text" width="606" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this returns the following output, showing all the continents grouped:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu617nhmbri64iufun4l4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu617nhmbri64iufun4l4.PNG" alt="Alt Text" width="529" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, for example, if you need to select the data of Asia and Europe in 2007, first you need to select the data for 2007:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6hmywq48gd87viofclcp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6hmywq48gd87viofclcp.png" alt="Alt Text" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select the data for Asia out of the 'data2007' variable, and then the same procedure for Europe:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqstx1iaer6uq98iu9s16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqstx1iaer6uq98iu9s16.png" alt="Alt Text" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check both 'asia2007' and 'europe2007' with the 'head()' function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6aespmtm76l53e3s358b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6aespmtm76l53e3s358b.PNG" alt="Alt Text" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To check how many countries are in these two newly created datasets let's use the 'set()' function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5dpxtcjb7smayfdvjtv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5dpxtcjb7smayfdvjtv2.png" alt="Alt Text" width="638" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don't want to see the complete list of countries, instead only the number of countries for reach data set, use the 'len()' function combined with the 'set()' function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh8v9qzvdbaa992xqey7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh8v9qzvdbaa992xqey7z.png" alt="Alt Text" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use this combined with the 'print()' function for both datasets, ant this should be the output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F16dfmkpyfyh01m9n4mj1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F16dfmkpyfyh01m9n4mj1.PNG" alt="Alt Text" width="349" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's now find the mean and median of GDP per Capita in Asia and Europe in 2007:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn5sjm7otcu6r8c9pcpme.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn5sjm7otcu6r8c9pcpme.png" alt="Alt Text" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg9eunmp6d1kia31dw80k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg9eunmp6d1kia31dw80k.png" alt="Alt Text" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a histogram of GDP per capita in Asia, type:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi4rg6ojuu3yexxz63q7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi4rg6ojuu3yexxz63q7h.png" alt="Alt Text" width="798" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, to compare this histogram of the GDP Per Capita of Asia with the GDP Per Capita of Europe, both of 2007, lets use the 'suplot()' function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy5n4t40ke3oa9ja43m3s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy5n4t40ke3oa9ja43m3s.png" alt="Alt Text" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the result is the following histogram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvdcpr3webq1l2ea5zf3x.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvdcpr3webq1l2ea5zf3x.PNG" alt="Alt Text" width="531" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 3: Comparing Complex Histograms&lt;/p&gt;

&lt;p&gt;Now, let's compare Europe and America's life expectancy in 1997.&lt;/p&gt;

&lt;p&gt;There are many ways to solve this problem, but my approach is the following:&lt;/p&gt;

&lt;p&gt;First select only the data of 1997:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs43cuiwuwckg7phfwral.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs43cuiwuwckg7phfwral.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, from newly created dataset ('data97') extract America's and Europe's data:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F98bm3h45bl05d7qp40l7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F98bm3h45bl05d7qp40l7.png" alt="Alt Text" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, to check the number of countries in each new dataset:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Futgptfy9xoh2vx718xyg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Futgptfy9xoh2vx718xyg.png" alt="Alt Text" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to get the mean and median life expectancy of each new data set:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fay26g0e6udeluscbja2a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fay26g0e6udeluscbja2a.png" alt="Alt Text" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, finally to compare both datasets in histogram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fswrl0de2fuipm5kcrib4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fswrl0de2fuipm5kcrib4.png" alt="Alt Text" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Being the final chart the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3pxtn0qmsp8oqjbemo1y.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3pxtn0qmsp8oqjbemo1y.PNG" alt="Alt Text" width="731" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Visualization with Python pt. i</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Fri, 15 Jan 2021 16:49:41 +0000</pubDate>
      <link>https://dev.to/hugoestradas/data-visualization-with-python-2cec</link>
      <guid>https://dev.to/hugoestradas/data-visualization-with-python-2cec</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbeibp8ow4r68cp57h5wr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbeibp8ow4r68cp57h5wr.jpg" alt="Alt Text" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First things first, all the code I cover on this lecture it's right here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/hugoestradas/Data_Visualisation_with_Python.git" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/Data_Visualisation_with_Python.git&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;Part 1: Using Matplitlib for the Very First Time&lt;/p&gt;

&lt;p&gt;Matplotlib is a popular data visualization library for Python.&lt;/p&gt;

&lt;p&gt;The reason I'm going to use it, it's because it's fairly easy to use and out of many Python data visualization libraries it's the most commonly used one.&lt;/p&gt;

&lt;p&gt;With Matplotlib you'll be able to create many different types of charts.&lt;/p&gt;

&lt;p&gt;Let's see how to create a line chart with Matplotlib:&lt;/p&gt;

&lt;p&gt;The first thing to do is to import the Matplotlib module:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F45dpmtnwlsjr3pd0ezqx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F45dpmtnwlsjr3pd0ezqx.png" alt="Alt Text" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to start plotting data I'll use the following line:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffkbzqc647ht14f0dgqhm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffkbzqc647ht14f0dgqhm.png" alt="Alt Text" width="798" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This line says "put 1, 2 and 3 in the 'x' axis; and 1, 4 and 9 in the 'y' axis".&lt;br&gt;
To show this plot, it's necessary the following line:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frjeiu89vdhrfscousmi6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frjeiu89vdhrfscousmi6.png" alt="Alt Text" width="462" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is possible to add labels for the 'x' and 'y' axis and a title for the whole plot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fphlte2pt19ziqlsqa85r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fphlte2pt19ziqlsqa85r.png" alt="Alt Text" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The whole cell should look like this, and the end plot should be the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8scfhlgn7miinhbnuhyv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8scfhlgn7miinhbnuhyv.PNG" alt="Alt Text" width="607" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's also possible to plot multiple lines on the same plot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7gx1savv4dinxuq8lkpy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7gx1savv4dinxuq8lkpy.png" alt="Alt Text" width="782" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the plot looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4fxq1ehdwu0re1y95n0s.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4fxq1ehdwu0re1y95n0s.PNG" alt="Alt Text" width="537" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To clarify the values of each line, it is possible to define them by name using the "plt.legend" method:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fio6tosoityx83a3qcagn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fio6tosoityx83a3qcagn.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the plot looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flyowl8h36khj7ar8ai2j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flyowl8h36khj7ar8ai2j.PNG" alt="Alt Text" width="515" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is possible to export the plot as an image as well:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fddcevg0vrcy6rqnc2ukt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fddcevg0vrcy6rqnc2ukt.PNG" alt="Alt Text" width="457" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 2: Using Pandas&lt;/p&gt;

&lt;p&gt;Pandas is a Python library that helps you import, organize and process data, it's familiar to "dataframes" in the R language.&lt;/p&gt;

&lt;p&gt;Let's create a dataframe in Pandas, select data with Boolean indexing and finally plots using the same Pandas dataframe:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8zzoty9ccxinr0ard7oy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8zzoty9ccxinr0ard7oy.png" alt="Alt Text" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the data I'll be using:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuzg7ejls5rrsbsox4ul7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuzg7ejls5rrsbsox4ul7.png" alt="Alt Text" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a dataframe to store this data, I'm going to create a dummy data as dictionary with three attributes: 'year', 'attendees' and 'average age'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk92xjukefcgpe7j8eklc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk92xjukefcgpe7j8eklc.png" alt="Alt Text" width="590" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And after executing the cell, the displayed dataframe should look like this one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg0gq2rywo1vig5drc6z2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg0gq2rywo1vig5drc6z2.PNG" alt="Alt Text" width="486" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can assign this newly created dataframe to a variable called 'df' (the standard variable name for a dataframe in Pandas):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx35qxmjx54i7rt1lzixf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx35qxmjx54i7rt1lzixf.png" alt="Alt Text" width="670" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the result should be the same:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh3eqxfi4de4kqmhfxl7o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh3eqxfi4de4kqmhfxl7o.PNG" alt="Alt Text" width="380" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are three columns in this dummy dataframe, you can select a single column out of this dataframe, for example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fblqnsfp56k8jfc8kmglz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fblqnsfp56k8jfc8kmglz.png" alt="Alt Text" width="462" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The type of this new data is something called a "Pandas Series".&lt;/p&gt;

&lt;p&gt;It's similar to a regular Python list and also to the NumPy array, if you're familiar with the NumPy library.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv9hpccabywt7bic05qey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv9hpccabywt7bic05qey.png" alt="Alt Text" width="558" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Knowing this, you can apply an inequality operation on the series with df['year'] &amp;lt; 2010:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy9818bv91ssyj2k23qyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy9818bv91ssyj2k23qyr.png" alt="Alt Text" width="574" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This returns a series of Boolean values:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs116hrc8nzrqcup31e8l.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs116hrc8nzrqcup31e8l.PNG" alt="Alt Text" width="331" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's store the output into a variable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fabdglxvmakbkbja8qfd7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fabdglxvmakbkbja8qfd7.png" alt="Alt Text" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the Boolean Series you can select only the part of the data where the year is earlier than 2010, this is called "Boolean Indexing":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3j13p48jqslipehezejg.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3j13p48jqslipehezejg.PNG" alt="Alt Text" width="370" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine that you want to examine how the number of attendees has changed for the last three events.&lt;/p&gt;

&lt;p&gt;To best figure this out, you might want to plot the number of attendees against the year:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdyayaau8fr750soyzfuu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdyayaau8fr750soyzfuu.png" alt="Alt Text" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This line of course puts the year on the x axis and the attendees on the y axis, and the result it's the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnja0rdxz20sv4laj8lo8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnja0rdxz20sv4laj8lo8.PNG" alt="Alt Text" width="539" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to plot the number of attendees and average age on the same plot we can just call 'plt.plot()' multiple times:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzu0v9pwlsivhx2mc6hsf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzu0v9pwlsivhx2mc6hsf.PNG" alt="Alt Text" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 3: Importing Data with Pandas&lt;/p&gt;

&lt;p&gt;For this example, the sample data that I'm going to use, is the following .csv file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2y37h8oakijw6f4pcy9w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2y37h8oakijw6f4pcy9w.PNG" alt="Alt Text" width="708" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a list of countries and their basic demographics for each year, years ranging from 1952 to 2007 for every five years.&lt;/p&gt;

&lt;p&gt;To import this .csv file make sure that you ether know the path of the file or the both the notebook and the .csv file are located in the same location within the Jupyter intance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjjz8ppw2hbnf9kjqbux0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjjz8ppw2hbnf9kjqbux0.png" alt="Alt Text" width="782" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This dataset is pretty small, but in real world scenarios if you want to have a glimpse of the data you're dealing with, all you need to to is to use the 'head()' method:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdqfuk3whxs6f0qxu8yww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdqfuk3whxs6f0qxu8yww.png" alt="Alt Text" width="478" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This gives you the first five rows of the dataframe:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0dpejpoqmstbkp0pfxn8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0dpejpoqmstbkp0pfxn8.PNG" alt="Alt Text" width="590" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if you would like to plot how GDP Per Capita has changed over time in Afghanistan.&lt;/p&gt;

&lt;p&gt;To do that, it's necessary to isolate the data bout Afghanistan from the data variable.&lt;br&gt;
To Select the country column you can write:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl17bop0u2h9vamoeqbhh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl17bop0u2h9vamoeqbhh.png" alt="Alt Text" width="542" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhp7gg861laaqa2jnlzq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhp7gg861laaqa2jnlzq0.png" alt="Alt Text" width="494" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Either syntax does exactly the same thing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdangkj90seajab54p9v2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdangkj90seajab54p9v2.PNG" alt="Alt Text" width="422" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using this and Boolean Indexing you can select only the data about Afghanistan with:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4n6j3fk82qi56ka1i914.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4n6j3fk82qi56ka1i914.png" alt="Alt Text" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And to plot it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdx2w1bkzyp7992k30b2z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdx2w1bkzyp7992k30b2z.png" alt="Alt Text" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the final plot is the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F78bnv1ice4cm28cojfxs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F78bnv1ice4cm28cojfxs.PNG" alt="Alt Text" width="524" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Another 5 Cool Python Exercises</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Wed, 11 Nov 2020 03:19:48 +0000</pubDate>
      <link>https://dev.to/hugoestradas/another-5-cool-python-exercises-31a5</link>
      <guid>https://dev.to/hugoestradas/another-5-cool-python-exercises-31a5</guid>
      <description>&lt;p&gt;As usual, if you wanna go straight forward for the code, here it is: &amp;gt;&amp;gt;&amp;gt; &lt;a href="https://github.com/hugoestradas/Python_Basics" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/Python_Basics&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1) Counting unique words.&lt;/p&gt;

&lt;p&gt;Almost every modern word processor software has a counting tool go get the total number of words in a document. I'll take this concept a little bit further, to practice both breaking down text and counting items.&lt;/p&gt;

&lt;p&gt;For this exercise I'll write down a Python function to count the number of unique words and how often each occurs.&lt;/p&gt;

&lt;p&gt;My input would be the path of a text file and the output or result will be the total number of words, the top 10 most frequent words and finally the number of occurrences for the top 10:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb3xwhupd5ykwd0phcf3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb3xwhupd5ykwd0phcf3m.png" alt="Alt Text" width="800" height="593"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This time I'm importing two Python modules: "re" for regular expressions and "Collections" for counting.&lt;br&gt;
My function begins by opening the file, with a given "path" variable which stores the location of the file, then using a regular expression I find all the words within its text.&lt;br&gt;
The search pattern looks for any sequence of one or more letters, numbers, hyphens, and/or apostrophes.&lt;/p&gt;

&lt;p&gt;Then I convert the list of words that it finds into all uppercase and then print out the length of that list, which indicates the total number of words that were found.&lt;/p&gt;

&lt;p&gt;On line 10 I'm creating a new "Counter" object and the use a for loop to iterate through the entire list of words and increment the list entries within the counter's dictionary.&lt;/p&gt;

&lt;p&gt;In the last block of code I use the Counter's "most_common" method&lt;br&gt;
to retrieve a list of the 10 most common words, along with their count values to display:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcxojk2x86seqyhf5lasf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcxojk2x86seqyhf5lasf.PNG" alt="Alt Text" width="633" height="638"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Merging CSV files&lt;/p&gt;

&lt;p&gt;Comma-Separated Values (CSV) files is a file format that stores tabular data in plain text.&lt;/p&gt;

&lt;p&gt;I'm going to write a Python function to merge multiple CSV files into one.&lt;/p&gt;

&lt;p&gt;I'm going to receive as input a list of files in a "path" variable.&lt;/p&gt;

&lt;p&gt;The function should be robust enough to merge files which the headers don't even match.&lt;br&gt;
The fields might be in different order, or a file could have additional fields that the other does not. It'll handle all of these cases, without losing any fields or data:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo0wh46ucypnmdfnmncv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo0wh46ucypnmdfnmncv0.png" alt="Alt Text" width="800" height="614"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first block of code builds up a list of field names, I start by creating an empty list then use a for loop to open up all of the files in the input list of CSV files to merge.&lt;br&gt;
I used the CSV module's "DictReader" on line eight to extract all the field names from each file and then on line nine I add them to the fieldnames list, if they're not already in there from a previous input file.&lt;/p&gt;

&lt;p&gt;The second part of the function, handles the writing of the records to the output file, based on those field names.&lt;br&gt;
I used a context manager to open the output file to write on line 12, and then I created a new "DictWriter" object from the CSV module passing in the list of fields of names I created.&lt;br&gt;
Every record I added using this "DictWriter" method includes all of the field from that list.&lt;br&gt;
On line 14, I write the first header row to the output file and then use the for loop to iterate through all of the input CSV files again.&lt;br&gt;
I open each one up and create a new "DictReader" from it, then I use a for loop to iterate through each record in that input file and write it to the output file.&lt;br&gt;
If that row I just read is missing certain fields, the "DictWriter" will leave them blank or empty in the output.&lt;/p&gt;

&lt;p&gt;These are the CSV files I will be comparing with my function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fndcu0dcz8pvjdvtks9el.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fndcu0dcz8pvjdvtks9el.PNG" alt="Alt Text" width="468" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdc3n87976arc5o3t7esa.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdc3n87976arc5o3t7esa.PNG" alt="Alt Text" width="800" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is the final merged CSV file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe9epx6wp2xfvk5vqc2in.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe9epx6wp2xfvk5vqc2in.PNG" alt="Alt Text" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Save a dictionary.&lt;/p&gt;

&lt;p&gt;Python's dictionaries are very popular among data scientist, data engineers and other data professionals. This is because their are awesome for storing and retrieving information. The only problem is that this data is kept in memory.&lt;/p&gt;

&lt;p&gt;What if you need to use this dictionary later?&lt;/p&gt;

&lt;p&gt;In this exercise I'll write a Python function that stores a dictionary into a file.&lt;/p&gt;

&lt;p&gt;My two inputs are the dictionary to save, and the path for the output file.&lt;/p&gt;

&lt;p&gt;I'll start by importing the "pickle" module, if you're not familiar with this library, I'll leave the official documentation here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://docs.python.org/3/library/pickle.html" rel="noopener noreferrer"&gt;https://docs.python.org/3/library/pickle.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;And here's the code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff8sfq2pwugucvmkg5f1r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff8sfq2pwugucvmkg5f1r.png" alt="Alt Text" width="800" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the execution of this program, I need to create a test dictionary object with the keys, after saving the dictionary into the file I can simply print the content from this file and show you the content remains there:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhwg1qn1ngu32tyccxnug.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhwg1qn1ngu32tyccxnug.PNG" alt="Alt Text" width="800" height="821"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4) Create a ZIP archive&lt;/p&gt;

&lt;p&gt;Okay, straightforward here's my code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkunrwtapbh8kpl8w1a65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkunrwtapbh8kpl8w1a65.png" alt="Alt Text" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see I imported the "os" module to search directories and to manipulate file paths and the "zipfile" module to actually build my zip file.&lt;/p&gt;

&lt;p&gt;My function starts by opening the "output_zip" file using a context manager.&lt;br&gt;
On the next line I use the "os.walk" function to explore and search in the directory.&lt;/p&gt;

&lt;p&gt;As you can see my foor loop is separated as a linux-like directory structure "root", "dirs" and finally "files.&lt;/p&gt;

&lt;p&gt;I need to maintain the relative file path for files in the output archive, but if the user calls the "zip_all" function with an absolute path the root path I get from the "walk" function will also be absolute. That's why on line 7 I use the "os.relpath" function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F51mdop6vaegbe6nlbmnp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F51mdop6vaegbe6nlbmnp.PNG" alt="Alt Text" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5) Find All List Items&lt;/p&gt;

&lt;p&gt;Python's index method finds the index of the first item in a list; &lt;br&gt;
but what if there are multiple instances of that item?&lt;/p&gt;

&lt;p&gt;In this one, I'm writing a Python function to find the indexes for all of the&lt;br&gt;
items in a list that are equal to a given value.&lt;/p&gt;

&lt;p&gt;The inputs are the list to be search and the value to be search for.&lt;/p&gt;

&lt;p&gt;The output should be the list of indices, each represented by a list of numbers.&lt;/p&gt;

&lt;p&gt;It's good to keep in mind that Python lists can also contain other lists.&lt;br&gt;
So, this function should be able traverse multidimensional lists to find all&lt;br&gt;
indices of the given value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fteyhiv80jevggzpoc31p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fteyhiv80jevggzpoc31p.png" alt="Alt Text" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Result&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvch9plgn2ip69w48dpqj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvch9plgn2ip69w48dpqj.PNG" alt="Alt Text" width="800" height="631"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>5 Cool Python Exercises</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Mon, 09 Nov 2020 21:23:02 +0000</pubDate>
      <link>https://dev.to/hugoestradas/5-cool-python-exercises-42gj</link>
      <guid>https://dev.to/hugoestradas/5-cool-python-exercises-42gj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg6mr1p65yc12upt2ehcx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg6mr1p65yc12upt2ehcx.jpg" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First things first, the repo with all the exercises of this lecture is right here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/hugoestradas/Python_Basics" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/Python_Basics&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's begin!&lt;/p&gt;

&lt;p&gt;1) Find prime factors.&lt;/p&gt;

&lt;p&gt;For the very basics, let's start with something unusual: Public Key Encryption. This technique relies on certain really large numbers being computationally hard to factor to keep data secure.&lt;br&gt;
In this first exercise I'll factor some numbers that are easy to deal with; the goal is to create a Python function to find all prime factors, I'll do it by taking an integer value as input and the return or output will be a list of prime factors.&lt;/p&gt;

&lt;p&gt;In this solution I decided to search for factors by dividing the given sequentially larger values (starting from 2) to see which one divide evenly into it, without leaving a remainder behind:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgguflc6uhxagim57hi3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgguflc6uhxagim57hi3u.png" alt="Alt Text" width="800" height="746"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see I'm calling the function with the 500 number, so it  will begin with 2 as the original divisor, then it'll go on keep dividing until the remainder is no longer an even number, in this case resulting in the result of 2, 2, 5, and finally 5:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhj2b5jw0i74ef35vb7se.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhj2b5jw0i74ef35vb7se.PNG" alt="Alt Text" width="388" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Identifying Palindromes.&lt;/p&gt;

&lt;p&gt;This a very usual programming and software engineering exercise, maybe you already did it on colleague, school or watching another tutorial, it's a very cool puzzle to solve because involves pattern recognition, logic and of course coding.&lt;/p&gt;

&lt;p&gt;In case it's your first time dealing with palindromes, a palindrome is a word or text that reads exactly the same, either forwards or backwards.&lt;/p&gt;

&lt;p&gt;Again, I'll write a function to detect palindromes, where my input will be the string I'm checking and the result or output is going to be a boolean value (false/true):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn4ei7nrn43w256y9khhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn4ei7nrn43w256y9khhu.png" alt="Alt Text" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going line by line, first I'm importing the "re" library, which contains regular expressions to extract letters from an input string, then I'm defining a "palindrome" function that receives a "string" parameter.&lt;br&gt;
Then I use the lower operator in the input string to convert all of the letters to lowercase, then I pass the result to the regular expression "findall" function with a pattern that will search for combinations of one or more letters. Tat will produce a list with all of the matched sub-strings that I merged together into a single string using the "join" function.&lt;/p&gt;

&lt;p&gt;Then I slice the entire string, with the stride set to negative one, meaning I'll get a copy of the original string in reverse order.&lt;/p&gt;

&lt;p&gt;Finally, I'm comparing both strings and return it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs3x9sf5iuxcidw18vcxs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs3x9sf5iuxcidw18vcxs.PNG" alt="Alt Text" width="501" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx5j64hmaku5ypesczr6r.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx5j64hmaku5ypesczr6r.PNG" alt="Alt Text" width="466" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Sort a string.&lt;/p&gt;

&lt;p&gt;Another common task in programming is sorting things.&lt;/p&gt;

&lt;p&gt;The goal is to create a Python function that sorts the words within a given string.&lt;/p&gt;

&lt;p&gt;The input will be a list of words separated by spaces, and the result or output will be the same string of words sorted alphabetically:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz9omnkkrd1p8f00cwuk4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz9omnkkrd1p8f00cwuk4.png" alt="Alt Text" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My "sorted" function starts with the "split" method, which breaks apart the input string at each of the spaces and gives me a list of the individual word.&lt;/p&gt;

&lt;p&gt;Then, to ignore the capitalization (if there is any) in the loop I convert each word within the list into lower case, to later on sort the entire list:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj0kxw95kagrhie8l6w5y.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj0kxw95kagrhie8l6w5y.PNG" alt="Alt Text" width="537" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4) The waiting game.&lt;/p&gt;

&lt;p&gt;For this exercise I'll write a Python function, which is when invoked it'll print a message to wait a random amount of time.&lt;/p&gt;

&lt;p&gt;The user press enters, then the timer starts. The user's goal is to wait the specified number of seconds in the message, and then press enter again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr5tn2pfns2gzwv864vpu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr5tn2pfns2gzwv864vpu.png" alt="Alt Text" width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this exercise I used to modules, "time" module to measure the amount of time, &lt;br&gt;
and the "random" module to generate a random number of seconds.&lt;/p&gt;

&lt;p&gt;The input function prompts the user to press enter to begin and then blocks the &lt;br&gt;
execution until the user hits enter again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyqkq6s70sacxwnv4fpgi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyqkq6s70sacxwnv4fpgi.PNG" alt="Alt Text" width="608" height="583"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5) Generate a new password.&lt;/p&gt;

&lt;p&gt;For this final example, I'll implement a function based on the "Diceware" method, which is a method for creating passphrases and passwords using the numbers of an ordinary dice as hardware random  number generator. It involves a list of over 7000 different words.&lt;/p&gt;

&lt;p&gt;Instead of rolling a physical dice, I'll write a Python function that simulates this behavior. &lt;/p&gt;

&lt;p&gt;The input will be a number of words in a passphrase and the output or result will be a string of random words, separated by spaces.&lt;/p&gt;

&lt;p&gt;For this one, I could've used the "random" module, but instead I went for the "secret" module, since the random module is not recommended when dealing with cryptographic procedures:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcnrvpdjez317i5v5lh2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcnrvpdjez317i5v5lh2u.png" alt="Alt Text" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My function begins by getting the number of words, then opening the "diceware.wordlist.asc" file with a context manager and then uses "readlines" function to get a list with each of the lines within the file.&lt;/p&gt;

&lt;p&gt;The top of the file diceware that I used has two extra lines before the word list actually begins, and at the bottom there are also several extra lines for a PGP signature:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkm8x5n9agn37w99u41e6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkm8x5n9agn37w99u41e6.PNG" alt="Alt Text" width="366" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpwrz9ae5omrkl3ay52j5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpwrz9ae5omrkl3ay52j5.PNG" alt="Alt Text" width="529" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I indexed out the 7K (7776) lines from the middle of the file that I actually care about. Remembering that each of these lines contain both a five-digit number and the corresponding word, I used the split method to break them apart, and then build the list containing just the words.&lt;/p&gt;

&lt;p&gt;Then I used the "secrets.choice" function within another list comprehension to build a list with the desired number of random words.&lt;/p&gt;

&lt;p&gt;And finally, I used the join method to combine the random words into a single string with spaces between them:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5diuv6ikyernk1nnewe5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5diuv6ikyernk1nnewe5.PNG" alt="Alt Text" width="510" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Start your Journey with TensorFlow</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Fri, 09 Oct 2020 20:59:03 +0000</pubDate>
      <link>https://dev.to/hugoestradas/start-your-journey-with-tensorflow-1gcm</link>
      <guid>https://dev.to/hugoestradas/start-your-journey-with-tensorflow-1gcm</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8rgkq7tkwv7v0tqgg132.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8rgkq7tkwv7v0tqgg132.jpg" alt="Alt Text" width="800" height="1131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First things first, you can find the notebook with all the content of this lecture in my GitHub repo:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/hugoestradas/DataScience-101" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/DataScience-101&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's find out how to start using TensorFlow from the very entry level.&lt;/p&gt;

&lt;p&gt;For this lecture, use any TensorFlow 2.x version.&lt;br&gt;
I'm going to use the Azure Databricks platform, but feel free of using your preferred notebook solution (Jupyter, Kaggle, Colab, etc).&lt;/p&gt;

&lt;p&gt;Part i: What on earth is a Tensor &amp;lt;?&amp;gt;&lt;/p&gt;

&lt;p&gt;According to Wikipedia: "Is an algebraic object that describes a (multilinear) relationship between sets of algebraic objects related to a vector space."&lt;/p&gt;

&lt;p&gt;Using the previous definition, we can say for our needs that tensors are TensorFlow's multi-dimensional arrays with uniform type. They're very similar to NumPy arrays and they're immutable, meaning once they're created they cannot be modified or altered. You can only create a new copy with the edits.&lt;/p&gt;

&lt;p&gt;Let's go to our environment to see how Tensors behave using a simple coding example.&lt;br&gt;
Before actually making our first tensor, we need to (of course) import the TensorFlow library, and for now I'm importing NumPy as well.&lt;br&gt;
Quick note here, in my Azure Databricks Cluster, I need to manually install TensorFlow before importing it:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F09aju4k7gc9e8z9wgq2f.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F09aju4k7gc9e8z9wgq2f.PNG" alt="Alt Text" width="800" height="352"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Checking, the library was installed without problems:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fby6p7y6tb8ckwafab2he.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fby6p7y6tb8ckwafab2he.PNG" alt="Alt Text" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, opening a fresh notebook I should be able to import TensorFlow without any issues:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flxl5i4o9uhi5lnr8z24b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flxl5i4o9uhi5lnr8z24b.PNG" alt="Alt Text" width="792" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part ii: Creating Tensors&lt;/p&gt;

&lt;p&gt;So far I installed TensorFlow with NumPy and imported both libraries into my notebook, time to work with Tensor Objects.&lt;/p&gt;

&lt;p&gt;There are many ways to create a "tf.Tensor" object.&lt;/p&gt;

&lt;p&gt;Here are a few examples.&lt;/p&gt;

&lt;p&gt;First, you can create a tensor object with several TensorFlow functions.&lt;/p&gt;

&lt;p&gt;Let's create a tensor object using "tf.constant":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faob22cflbv3zpigjvs6k.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faob22cflbv3zpigjvs6k.PNG" alt="Alt Text" width="521" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is possible to create tensor objects only consisting of "1s" with the "tf.ones" function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fha7d0x754yn1tfq4yey3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fha7d0x754yn1tfq4yey3.PNG" alt="Alt Text" width="284" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, you can create tensor objects only consisting of "0s" usnig the "tf.zeros" function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzknbuoyy7cuy9z93kynk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzknbuoyy7cuy9z93kynk.PNG" alt="Alt Text" width="280" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, there's the "tf.range()" function to create tensor objects:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faof991l6wwn85cz27z05.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faof991l6wwn85cz27z05.PNG" alt="Alt Text" width="428" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here's the output of each method I used:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5vjiqk8bl1vdw6o0zh05.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5vjiqk8bl1vdw6o0zh05.PNG" alt="Alt Text" width="767" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are the easiest and most common ways of creating tensor objects in TensorFlow.&lt;/p&gt;

&lt;p&gt;If you were observer, we created tensor objects with the shape (1,5) with three different functions, and a fourth tensor object with shape (5,) using the function "tf.range()".&lt;/p&gt;

&lt;p&gt;The "tf.ones" and "tf.zeros" accept the shape as the required argument, since their element avlues are pre-determined.&lt;/p&gt;

&lt;p&gt;Part iii: Classifying Tensors&lt;/p&gt;

&lt;p&gt;We use "tf.Tensor" in order to create TensorFlow tensor objects, and they have many characteristic features, the main 3 are:&lt;/p&gt;

&lt;p&gt;The first one that is important to understand, is that they have a rank based on the number of dimensions they have.&lt;/p&gt;

&lt;p&gt;The second mort important characteristic of the tensor objects in TensorFlow, is to know that they do have a shape. Which for our understanding means that is a list that consists of the lengths of all their dimensions. All tensors have a size, which represents the total number of elements within a tensor.&lt;/p&gt;

&lt;p&gt;And thirdly, their elements are all recorded in a uniform Dtype (data type).&lt;/p&gt;

&lt;p&gt;Let's dig deeply into these features.&lt;/p&gt;

&lt;p&gt;Tensors can be categorized based on the number of dimension they have:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdie0g7otdqe7m591c6ul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdie0g7otdqe7m591c6ul.png" alt="Alt Text" width="602" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;0-D (Scalar) Tensor: it's a tensor containing a single value and no axis.&lt;/p&gt;

&lt;p&gt;1-D (Rank-1) Tensor: it's a tensor containing a list of values in a single axis.&lt;/p&gt;

&lt;p&gt;2-D (Rank-2) Tensor: it's a tensor containing 2 axis.&lt;/p&gt;

&lt;p&gt;3-D (Rank-n) Tensor: it's a tensor containing n-axis.&lt;/p&gt;

&lt;p&gt;Taking the above image as our source of abstraction for the dimension (axis) of the tensor objects, we can create a 3-D tensor by passing a three-level nested list object to the "tf.constant" function, and we can split the numbers into a 3-level nested list with three element at each level:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2eq0rpt74itmk81f0h2w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2eq0rpt74itmk81f0h2w.PNG" alt="Alt Text" width="697" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The shape feature is another attribute that every tensor has. It represents the size of each dimension in the form of a list to make it easier to understand.&lt;br&gt;
We can view the shape of the "tensor_3d" object we created with &lt;br&gt;
the ".shape" attribute:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvzlcye9kxhxsjnhy7pw0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvzlcye9kxhxsjnhy7pw0.PNG" alt="Alt Text" width="589" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Size is another feature tensor objects have, and it represents the total number of elements a tensor has.&lt;br&gt;
It's not possible to measure the size with an attribute of the tensor object, instead the "tf.size()" function is used, and then it's necessary to convert the output to NumPy with the instance function ".numpy()" to get a human-readable result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqkjnlnr1a2ixzz6qa13u.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqkjnlnr1a2ixzz6qa13u.PNG" alt="Alt Text" width="575" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last, but not least we have the Dtypes, which contain data types such as ints and floats, but ay contain many other data types suc as complex numbers and strings. Each tensor object, however, must store all its elements in a single uniform data type. Therefore, we can also view the type of data selected for a particular tensor object with the ".dtype" attribute:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6t2okj6zv3yhu1nrd6ol.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6t2okj6zv3yhu1nrd6ol.PNG" alt="Alt Text" width="647" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part iv: Operating with Tensors &lt;/p&gt;

&lt;p&gt;Now that we understand the basic properties and features of the tensor objects with TensorFlow, we can play a litte bit with them.&lt;/p&gt;

&lt;p&gt;Let's start with indexing. As you already know if you're reading this, an index represents an item's position in a sequence, and this sequence can refer to many things: a string of characters, a list, a sequence of values, etc.&lt;/p&gt;

&lt;p&gt;Luckily, TensorFlow follows the Ptyhon's standard for indexing, similar to list indexing usign NumPy, the rules are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Indexes start at zero (0).&lt;/li&gt;
&lt;li&gt;Negative indexes ("n") value means backward counting.&lt;/li&gt;
&lt;li&gt;Colons (";") are used for slicing: "start:stop:step".&lt;/li&gt;
&lt;li&gt;Commas (",") are used to reach deeper levels.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Following the rules above, let's create a 1-D tensor object:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4ga2pl3m3n0eg771mmkx.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4ga2pl3m3n0eg771mmkx.PNG" alt="Alt Text" width="651" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I'll apply the 4 rules of indexing:&lt;/p&gt;

&lt;p&gt;Rule #1 - Indexes start @ 0:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx6wknprvs6rlcayonzhs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx6wknprvs6rlcayonzhs.PNG" alt="Alt Text" width="546" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rule #2 - Negative values means backward counting:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm6zo8hnrf9mfisfsrx3b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm6zo8hnrf9mfisfsrx3b.PNG" alt="Alt Text" width="510" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rule #3 - Colons slice:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffbyy0orsqyfcb5cv7l5h.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffbyy0orsqyfcb5cv7l5h.PNG" alt="Alt Text" width="759" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rule #4 - Commas reach deeper levels:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F827hep7wyp8ee3u8k6jd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F827hep7wyp8ee3u8k6jd.PNG" alt="Alt Text" width="774" height="646"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, now that I've showed you the basic indexing techniques with tensor objects, let's make some operations with them.&lt;/p&gt;

&lt;p&gt;First, let's create two tensor objects to interact with later one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3mict0hsldojvbrbw0um.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3mict0hsldojvbrbw0um.PNG" alt="Alt Text" width="562" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's start adding one tensor to another, for this we can use the "tf.add()" function and pass the tensors as arguments:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ku0s2fgqoqqthlpwb72.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ku0s2fgqoqqthlpwb72.PNG" alt="Alt Text" width="361" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following up, now I'll make use of the element-wise multiplication, for this I'll use the "tf.multiply()" function and will pass the tensors as arguments again:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg4j8aaua6ejj956a1l3f.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg4j8aaua6ejj956a1l3f.PNG" alt="Alt Text" width="452" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can even do matrix multiplication with the "tf.matmul()" function... yes! passing the  tensors as arguments:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foku3dqwrnvggzc628is6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foku3dqwrnvggzc628is6.PNG" alt="Alt Text" width="432" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's say we'd like to know the maximum or minimum value within a tensor, well there are the "tf.reduce_max()" and "tf.reduce_min()" functions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fakyv4k5x2sxvwf4s0acl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fakyv4k5x2sxvwf4s0acl.PNG" alt="Alt Text" width="777" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similarly, to find the index of the maximum element is possible using the "tf.argmax()" function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ez695p34enyn5nei2pz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ez695p34enyn5nei2pz.PNG" alt="Alt Text" width="681" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can make operations and play with the shapes of the tensors.&lt;br&gt;
If you're familiar with Pandas DataFrames or NumPy Arrays, then you'll understand the concept of "Reshaping a Tensor".&lt;/p&gt;

&lt;p&gt;The "tf.reshape" operations are very fast, since the data does not need to be duplicated.&lt;br&gt;
Let's see how it works:&lt;/p&gt;

&lt;p&gt;Firstly, create a new tensor object:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhr64g2cfimjwzbla7oki.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhr64g2cfimjwzbla7oki.PNG" alt="Alt Text" width="602" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foim2k55hnm8fb6hp93mc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foim2k55hnm8fb6hp93mc.PNG" alt="Alt Text" width="654" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then a third tensor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftt35ld4sdqa5k6oe11w3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftt35ld4sdqa5k6oe11w3.PNG" alt="Alt Text" width="674" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if we pass -1 in the "shape" reshaped argument, then we flatten our tensor object:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb3x4kby9242x0qbl96ms.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb3x4kby9242x0qbl96ms.PNG" alt="Alt Text" width="800" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reshaping tensor objects with TensorFlow it's ridiculously easy. But it's important to keep in mind that when doing reshape operations, you must be reasonable, otherwise the tensor object might get messed up or can even raise fatal errors. &lt;/p&gt;

&lt;p&gt;Part v: Special Types of Tensors&lt;/p&gt;

&lt;p&gt;So far we've talked about tensors abstracting them into rectangular shapes and store only numerical values on them.&lt;br&gt;
But they are more powerful than tat, tensors support irregular or even specialized data within them. There are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ragged Tensors&lt;/li&gt;
&lt;li&gt;String Tensors&lt;/li&gt;
&lt;li&gt;Sparse Tensors&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvmnedusjqnjncitexeyd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvmnedusjqnjncitexeyd.png" alt="Alt Text" width="800" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Starting with Ragged Tensors, are tensors with different numbers of elements along their size axis:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy6ecdmw2u716jh4dexoo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy6ecdmw2u716jh4dexoo.PNG" alt="Alt Text" width="403" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Moving forward the String Tensors are tensors that store string objects within them, they're created as a normal tensor object, the only difference is how you store the strings:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmeo8n8e7pgmggc39fil8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmeo8n8e7pgmggc39fil8.PNG" alt="Alt Text" width="798" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, we have the Sparse Tensors with are rectangular tensors for sparse data.&lt;br&gt;
These are useful when you have holes, null values or other messy kind of things in your data. Sparse Tensors are to-go objects, hence they're a bit more consuming and should be more mainstream:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2nlmxull1tt34ga1nhvm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2nlmxull1tt34ga1nhvm.PNG" alt="Alt Text" width="717" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tensorflow</category>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Get Certified - Pass the Azure Administrator Exam (AZ-104)</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Sun, 16 Aug 2020 04:42:35 +0000</pubDate>
      <link>https://dev.to/hugoestradas/get-certified-pass-the-azure-administrator-exam-az-104-19j8</link>
      <guid>https://dev.to/hugoestradas/get-certified-pass-the-azure-administrator-exam-az-104-19j8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe2w8x7lidwrvftvroaln.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe2w8x7lidwrvftvroaln.jpg" alt="Alt Text" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A certification provides competency, shows commitment, professionalism and most importantly: it motivates you to keep learning and gather knowledge. It's also a great way to get a better job.&lt;/p&gt;

&lt;p&gt;Currently Microsoft Azure is the number 2 cloud provider behind AWS, and is still growing. Microsoft constantly improves, changes and adds new services and resources to it's cloud platform.&lt;/p&gt;

&lt;p&gt;Right now (Aug. 2020) more than 80% of the Fortune 500 companies are extensively using Microsoft Azure. With those numbers, it's easy to assume the huge demand for Azure skilled professionals.&lt;/p&gt;

&lt;p&gt;The latest Microsoft Azure Administrator Exam, the AZ-104 is aimed for those software and cloud engineers, interested in master the skills needed to operate a Microsoft Azure-based cloud infrastructure. &lt;/p&gt;

&lt;p&gt;In a nutshell, an Azure Administrator is responsible for implementing, monitoring and maintaining Microsoft Azure solutions, including major services related to Compute, Storage, Network and Security. The Azure Administrator will provision, size, monitor, and adjust resources as appropriate.&lt;/p&gt;

&lt;p&gt;The exams is divided in 4 major areas:&lt;/p&gt;

&lt;p&gt;1) Knowledge and Management of Azure Identity and Security.&lt;/p&gt;

&lt;p&gt;2) Management of Azure Storage Services and Solutions.&lt;/p&gt;

&lt;p&gt;3) Knowledge and Management of Azure Networking.&lt;/p&gt;

&lt;p&gt;4) Management of Microsoft Azure Compute Services and Solutions.&lt;/p&gt;

&lt;p&gt;If you're interested in getting the Azure Administrator Certification, download my "AZ-104 Practice and Answers" document. This document covers all the 4 areas of the AZ-104 Exam. &lt;/p&gt;

&lt;p&gt;For this exam, you do need to have a solid background and familiarity with the Azure Portal, Azure Services and Azure Resources, if you already work or feel comfortable with the Azure Ecosystem, then just practice, do some reading and use my document to measure your score in order to pass the exam. &lt;/p&gt;

&lt;p&gt;If you're new into Azure and you're interested in getting the AZ-104 certification, I highly recommend to practice on your own, read the Microsoft Documentation and also get the Azure Fundamentals certification first, take a look at my AZ-900 document: &lt;br&gt;
&lt;a href="https://dev.to/hugoestradas/get-certified-pass-the-azure-fundamentals-exam-az-900-le7"&gt;https://dev.to/hugoestradas/get-certified-pass-the-azure-fundamentals-exam-az-900-le7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A quick disclaimer worth mentioned it, is that Microsoft currently offers two Azure Administrator Exams: AZ-103 and AZ-104. The topics of my document are specifically designed for the AZ-104 exam exclusively. &lt;/p&gt;

&lt;p&gt;The debate on AZ-103 vs AZ-104 is necessary for estimating the suitability of both certification exams for modern Azure Administrator job roles. AZ-104, presents the same second domain, although with an increased focus on the management of data. The second domain dealing with implementation and management of storage in both the AZ-103 and AZ-104 exams shows contrasting differences in both exams.&lt;/p&gt;

&lt;p&gt;While the AZ-103 certification exam deals with topics such as creation and configuration of storage accounts in this domain, the new exam additionally deals with the management of storage accounts. The AZ-103 certification exam included topics only on importing and exporting data to Azure. On the other hand, AZ-104 focuses on the management of data in Azure storage.&lt;/p&gt;

&lt;p&gt;No matter which exam you choose, if you pass you'll get the Azure Administrator Certification, but since the AZ-104 is the latest version, in my personal opinion it's a better choice.&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;DOWNLOAD MY AZ-104 PRACTICE DOCUMENT&lt;br&gt;
&lt;a href="https://mega.nz/file/sA9FDBjA#eRVBcceAT90YaMa3MbC0Ka95ecZqZxO2ph8xM9NYn0Q" rel="noopener noreferrer"&gt;https://mega.nz/file/sA9FDBjA#eRVBcceAT90YaMa3MbC0Ka95ecZqZxO2ph8xM9NYn0Q&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

</description>
      <category>azure</category>
    </item>
    <item>
      <title>Pandas 101 - pt. iii: Data Science Challenges</title>
      <dc:creator>Hugo Estrada S.</dc:creator>
      <pubDate>Tue, 28 Jul 2020 04:19:51 +0000</pubDate>
      <link>https://dev.to/hugoestradas/pandas-101-pt-iii-data-science-challenges-250k</link>
      <guid>https://dev.to/hugoestradas/pandas-101-pt-iii-data-science-challenges-250k</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpb7qczjhu3n0qr93aq69.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpb7qczjhu3n0qr93aq69.jpg" alt="Alt Text" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like always, the repository with all the notebooks and data of this three-part series about Pandas is here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/hugoestradas/Pandas_101" rel="noopener noreferrer"&gt;https://github.com/hugoestradas/Pandas_101&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this final lecture about Pandas, I'm going to show you some practical scenarios that you might face as a Data Scientist in the real world, and some more advance techniques for data analysis.&lt;/p&gt;

&lt;p&gt;Let's start by importing Pandas and Matplotlib (a library for creating static, animated, and interactive visualizations in Python):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzcglwbs58u8dqkr5xnr7.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzcglwbs58u8dqkr5xnr7.JPG" alt="Alt Text" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1) Know your Dataset, (I really mean it)&lt;/p&gt;

&lt;p&gt;Data Science in a nutshell can be defined as the process by which we extra information from data. When doing Data Science, what we’re really trying to do is explain what all of the data actually means in the real-world, beyond the numbers.&lt;/p&gt;

&lt;p&gt;In order to properly explain the information we've been working with, we need to understand what data we've just figured out, and the only way of doing this, is by really getting into the sources, the data-sources: the data set.&lt;/p&gt;

&lt;p&gt;Depending on the needs and circumstances of the project you can always start by answering these 5 questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; What is the question we are trying to answer or problem we are trying to solve? This involves understanding the problem and tasks involved. Do we have the skill and the resources needed?&lt;/li&gt;
&lt;li&gt; What was the process by which the data arrived to us? This means understanding how it was created and transformed.&lt;/li&gt;
&lt;li&gt; What does the data look like? This is exploratory analysis. What dimensions exist, what measures exist, what is the relationship between each measure and other measures and dimensions.&lt;/li&gt;
&lt;li&gt; Are there issues with the data? If yes, how did they appear and can we solve them. This is related with outliers, NAs, NULLs, etc.&lt;/li&gt;
&lt;li&gt; Can we answer the question or solve the problem with these data? If not, why and can I solve it?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2) Dealing with Dates and Times&lt;/p&gt;

&lt;p&gt;A lot of the analysis you will do, might relate to dates and times, for instance: finding the average number of sales over a given period, selecting a list of products to data mine if they were purchased in a given period, or trying to find the period with the most activity in online discussion activity.&lt;/p&gt;

&lt;p&gt;I'll explain some of the basics of working with time series analysis.&lt;/p&gt;

&lt;p&gt;First, you should be aware that date and times can be stored in many different ways. One of the most common legacy methods for storing the date and time in online transactions systems is based on the offset from the epoch, which is January 1, 1970.&lt;br&gt;
There's a lot of historical cruft around this, but it's not uncommon to see systems storing the data of a transaction in seconds or milliseconds since this date. So if you see large numbers where you expect to see date and time, you'll need to convert them to make much sense out of the data.&lt;/p&gt;

&lt;p&gt;In Python, you can get the current time since the epoch using the time module. You can then create a time stamp using the time module:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu326slv2505380yaw42x.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu326slv2505380yaw42x.JPG" alt="Alt Text" width="341" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9p0lry0ucuyhrincpn91.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9p0lry0ucuyhrincpn91.JPG" alt="Alt Text" width="342" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From here, you can create a timestamp, from the timestamp function on the data-time object:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F72s1kkhfj2vehu86bnvj.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F72s1kkhfj2vehu86bnvj.JPG" alt="Alt Text" width="482" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we print this value out, we see that the year, month, day, and so forth are also printed out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3vfr6lrohx0jfwcmf9pk.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3vfr6lrohx0jfwcmf9pk.JPG" alt="Alt Text" width="679" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The date-time object has handy attributes to get the representative hour, day, seconds, etc.&lt;/p&gt;

&lt;p&gt;3) Querying a DataFrame&lt;/p&gt;

&lt;p&gt;Before we talk about how to query data frames, we need to talk about Boolean masking. Boolean masking is the heart of fast and efficient querying in NumPy. It's analogous a bit to masking used in other computational areas.&lt;/p&gt;

&lt;p&gt;A Boolean mask is an array which can be of one dimension like a series, or two dimensions like a data frame, where each of the values in the array are either true or false. This array is essentially overlaid on top of the data structure that we're querying. And any cell aligned with the true value will be admitted into our final result, and any sign aligned with a false value will not.&lt;/p&gt;

&lt;p&gt;Boolean masks are created by applying operators directly to the pandas series or DataFrame objects. For instance, in our Olympics data set, you might be interested in seeing only those countries who have achieved a gold medal at the summer Olympics. &lt;br&gt;
To build a Boolean mask for this query, we project the gold column using the indexing operator and apply the greater than operator with a comparison value of zero. This is essentially broadcasting a comparison operator, greater than, with the results being returned as a Boolean series. The resultant series is indexed where the value of each cell is either true or false depending on whether a country has won at least one gold medal, and the index is the country name:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3ivl32uicmsp94z4mqw9.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3ivl32uicmsp94z4mqw9.JPG" alt="Alt Text" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is essentially broadcasting a comparison operator, greater than, with the results being returned as a Boolean series. The resultant series is indexed where the value of each cell is either true or false depending on whether a country has won at least one gold medal, and the index is the country name:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fer2tkqzrn83rzrgwqihv.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fer2tkqzrn83rzrgwqihv.JPG" alt="Alt Text" width="449" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So this builds us the Boolean mask, which is half the battle. What we want to do next is overlay that mask on the data frame. We can do this using the where function. The where function takes a Boolean mask as a condition, applies it to the data frame or series, and returns a new data frame or series of the same shape. Let's apply this Boolean mask to our Olympics data and create a data frame of only those countries who have won a gold at a summer games:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyqrpux3nio3civwtk8ky.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyqrpux3nio3civwtk8ky.JPG" alt="Alt Text" width="800" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4) Handling Missing Values (Brief intro to Data Cleansing)&lt;/p&gt;

&lt;p&gt;Underneath Pandas does some type conversion, if I create a list of string and we have one element, a "none" type, Pandas inserts it as a none and uses the type object for the underlying array.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr09zz7c0n5pf3k1qbn4e.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr09zz7c0n5pf3k1qbn4e.JPG" alt="Alt Text" width="468" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For further examples, I'm going to load the "log.csv" file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl72d9bxbl4jxt95kq4j0.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl72d9bxbl4jxt95kq4j0.JPG" alt="Alt Text" width="627" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this data the first column is a timestamp in the Unix epoch format. The next column is the user name followed by a web page they're visiting and the video that they're playing.&lt;/p&gt;

&lt;p&gt;Each row of the DataFrame has a playback position. And we can see that as the playback position increases by one, the time stamp increases by about 30 seconds.&lt;/p&gt;

&lt;p&gt;Except for user Bob. It turns out that Bob has paused his playback so as time increases the playback position doesn't change. Note too how difficult it is for us to try and derive this knowledge from the data, because it's not sorted by time stamp as one might expect. This is actually not uncommon on systems which have a high degree of parallelism.&lt;/p&gt;

&lt;p&gt;There are a lot of missing values in the paused and volume columns. It's not efficient to send this information across the network if it hasn't changed. So this particular system just inserts null values into the database if there's no changes.&lt;/p&gt;

&lt;p&gt;One of the handy functions that Pandas has for working with missing values is the filling function, "fillna". &lt;br&gt;
This function takes a number or parameters, for instance, you could pass in a single value which is called a scalar value to change all of the missing data to one value. This isn't really applicable in this case, but it's a pretty common use case. Next up though is the method parameter. The two common fill values are ffill and bfill. ffill is for forward filling and it updates an na value for a particular cell with the value from the previous row. It's important to note that your data needs to be sorted in order for this to have the effect you might want. Data that comes from traditional database management systems usually has no order guarantee, just like this data. So be careful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frnm1frjtyoplelchksfo.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frnm1frjtyoplelchksfo.JPG" alt="Alt Text" width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Pandas we can sort either by index or by values. Here we'll just promote the time stamp to an index then sort on the index.&lt;/p&gt;

&lt;p&gt;If we look closely at the output though we'll notice that the index isn't really unique. Two users seem to be able to use the system at the same time. Again, a very common case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3lm9wem4whroxumb2hc8.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3lm9wem4whroxumb2hc8.JPG" alt="Alt Text" width="520" height="721"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's reset the index, and use some multi-level indexing instead, and promote the user name to a second level of the index to deal with that issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyya9d79wvt6zbpshalqm.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyya9d79wvt6zbpshalqm.JPG" alt="Alt Text" width="488" height="835"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have the data indexed and sorted appropriately, we can fill the missing datas using ffill.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqye3inbzts5hulw9n9az.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqye3inbzts5hulw9n9az.JPG" alt="Alt Text" width="569" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
