<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Omorere Idowu on Medium]]></title>
        <description><![CDATA[Stories by Omorere Idowu on Medium]]></description>
        <link>https://medium.com/@idowuomorere?source=rss-78145a7dfefb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8bu0fHbLrxQWi0b8oV1gWQ.jpeg</url>
            <title>Stories by Omorere Idowu on Medium</title>
            <link>https://medium.com/@idowuomorere?source=rss-78145a7dfefb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:34:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@idowuomorere/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Becoming a Microsoft Certified Azure Data Scientist Associate (DP-100): Exam Tips and Study…]]></title>
            <link>https://medium.com/@idowuomorere/becoming-a-microsoft-certified-azure-data-scientist-associate-dp-100-exam-tips-and-study-1114bc95d29c?source=rss-78145a7dfefb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1114bc95d29c</guid>
            <category><![CDATA[dp-100]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[azure-machine-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Omorere Idowu]]></dc:creator>
            <pubDate>Sun, 22 Sep 2024 20:31:26 GMT</pubDate>
            <atom:updated>2024-09-22T20:31:26.086Z</atom:updated>
            <content:encoded><![CDATA[<h3>Becoming a Microsoft Certified Azure Data Scientist Associate (DP-100): Exam Tips and Study Resources</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*JsSb1qedGTw1zTcGQS1ovA.png" /></figure><p>Recently, I took the DP-100 exam, aiming at becoming a Microsoft Certified Azure Data Scientist Associate. It certainly wasn’t easy, but I prepared vigorously for about three weeks and passed the exams. If you’re considering getting this certification as well, or you already have an exam scheduled, this article is for you. I will be sharing my experience taking the exam, along with some tips, study guides and insights which I believe will be helpful in you journey. I also share tips on dealing with network issues for my Nigerians.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R9f_qnIcq6p9b8Xc65lJTQ.png" /></figure><h3>What to Expect in the DP-100 Exam</h3><p>The DP-100 exam tests your ability to design and implement machine learning solutions using Azure’s various services, including Azure Machine Learning (Azure ML), data processing techniques, and model deployment. It covers four key areas:</p><ul><li><strong>Design and prepare a machine learning solution (20–25%)</strong></li><li><strong>Explore data, and train models (35–40%)</strong></li><li><strong>Prepare a model for deployment (20–25%)</strong></li><li><strong>Deploy and retrain a model (10–15%)</strong></li></ul><h3>My Experience</h3><p>The exam was a mix of multiple-choice questions, true/false, drag and drop, and case studies. I found the case studies particularly interesting because they required applying theoretical knowledge to real-world scenarios, which mirrors actual data science work. I’d suggest being well-prepared for questions that test your understanding of end-to-end machine learning workflows and the best way to prepare, is to actually build data science solutions using Azure services.</p><p>A major challenge I had in the exams were questions that tested my experience with Azure services other than Azure ML. I had issues particularly with questions related to Azure Databricks and Azure Synapse Analytics as I only had theoretical knowledge of these tools and had not actually used them before taking the exams. So I must emphasize this, get experience using other Azure services(not just Azure ML), to build data science solutions.</p><h3>Study Resources</h3><h3>1. Microsoft Learn Resources</h3><p>Microsoft offers free learning paths for every certification on the Microsoft Learn platform. This is the place to start if you plan on getting a Microsoft Certification. They cover all exam objectives and offer hands-on exercises that help solidify your understanding. The course is easy to understand and can be taken on your own, however, Microsoft also offers <a href="https://learn.microsoft.com/en-us/training/courses/dp-100t01#browseAllSessionsContainer"><strong>training centers</strong></a> if you prefer to have some guidance while preparing for the exams.</p><ul><li><a href="https://learn.microsoft.com/en-us/training/courses/dp-100t01"><strong>Course DP-100T01-A: Designing and implementing a data science solution on Azure</strong></a></li></ul><p>Microsoft also offers <a href="https://learn.microsoft.com/en-us/credentials/certifications/azure-data-scientist/practice/assessment?assessment-type=practice&amp;assessmentId=62&amp;practice-assessment-type=certification"><strong>practice assessments</strong></a><strong> </strong>which help you test your understanding of the course contents. If you get a score of 80% and above at least 5 times on the practice assessment, you should be good enough to attempt the exams. However, the practice assessment doesn’t contain questions from the actual exams. In fact, the actual exam questions are much tougher, and so after completing the Microsoft Learn Courses, I suggest you look into the other resources in this list.</p><h3>2. Practice Exams</h3><p>While Microsoft Learn offers it’s own practice assessment, you can take other practice assessments as well to get a feel for how the exams will be like. I used <a href="https://www.examtopics.com/exams/microsoft/dp-100/"><strong>ExamTopics</strong></a>, and I greatly recommend them as well, as their practice questions are similar to those that are asked in the actual exams. I suggest you use ExamTopics to gauge your readiness for the exam.</p><p>You can also use <strong>MeasureUp</strong> for practice exams. The questions are structured similarly to the actual exam, and the explanations for the answers can help clarify concepts you are unsure about.</p><h3>3. Azure Machine Learning Hands-On Labs</h3><p>The hands-on labs available via <strong>GitHub</strong> are great for gaining practical experience. They helped me understand how to use Azure ML to create, train, and deploy models. Setting up experiments and managing pipelines in a real environment made all the difference.</p><ul><li><a href="https://github.com/MicrosoftLearning"><strong>Azure ML Hands-on Labs</strong></a></li></ul><h3>4. Exam Reference Books</h3><p>I used the book <strong>“Azure Data Scientist Associate Certification Guide: A hands-on guide to machine learning in Azure and passing the Microsoft Certified DP-100 exam” </strong>by Andreas Botsikas and Michael Hlobil. It dives into each key area in detail and also provides example code files so you can code along and gain real experiance building data science solutions with Azure services.</p><h3>5. YouTube Tutorials</h3><p>This probably was the resource I used the most, while preparing for the dp-100. Watching walkthroughs of the Azure ML Studio was useful for visual learners like me. YouTube has a wealth of content that provides overviews and demos of how to work with Azure’s data science tools. You will also find video walkthroughs on simple projects you can build with Azure ML. A few videos that helped me are</p><ul><li><a href="https://youtu.be/US1Mv00MCgo?si=3eqSvTu9p9OlV6Ta"><strong>Basic Azure ML Project</strong></a></li><li><a href="https://www.youtube.com/watch?v=YLccHH7bS7g&amp;list=PLeWL8zChJ2uuGs-8nvxMdo26XkYGWt7ui&amp;pp=iAQB"><strong>Azure Machine Learning Playlist — Kevin Feasel</strong></a></li></ul><h3>My Top Tips for DP-100 Success</h3><ol><li><strong>Get hands-on experience</strong>: Don’t just study theory; work with Azure Machine Learning Studio. The more you practice, the better you’ll understand the nuances of the platform.</li><li><strong>Get familiar with other Azure services:</strong> While most of the questions are based on your knowledge of Azure ML, your experience with other Azure services are also tested. Get familiar with using tools like Azure Synapse Analytics, MLFlow, Azure Kubernetes Service, and other Azure services to build a data science solution.</li><li><strong>Understand the exam objectives</strong>: Microsoft provides a breakdown of the exam skills measured. Use this as a checklist to ensure you cover everything before sitting for the exam.</li><li><strong>Master pipelines and deployment</strong>: These are critical in both the exam and real-world scenarios. Get familiar with the Azure ML python SDK and CLI for setting up automated workflows.</li><li><strong>Time management during the exam</strong>: The case studies can be time-consuming, so practice managing your time effectively. Start with the sections you’re most comfortable with, and leave enough time for the case studies.</li></ol><h4>Special Tip for Nigerians — or anyone that doesn’t have a strong internet connection.</h4><p>You can choose to take the exams online, or at one of the local test centers available. If you have a local test center close to you, just take the exams there, especially if you do not have a strong internet connection. If there is no local test center close to you though, and you choose to take the exams online, first, get familiar with the <a href="https://learn.microsoft.com/en-us/credentials/certifications/online-exams">rules</a> of the exams. The exams will be proctored, and you’ll communicate with the proctor before the exams start to show your ID, and to ensure that your environment meets the exam standards. Most importantly, you’ll have to run a system pre-check to ensure the system you’ll be using to write the exams meets the requirements before registering. You’ll also run another system check just before the exams. This was were I had issues.</p><p>OnVue seems to have issues with the internet speed requirement, as I didn’t pass it during the pre-check, despite having an internet speed of over 20mbps, while the requirement was 7mbps if I remember correctly. A mentor told me not to worry, that the OnVue platform does that a lot, but as long as I have good internet, I’ll pass the system check on the exam day. Ladies and gentlemen, I did not pass the system check on the exam day. After struggling for up to an hour, I had to reschedule. This time however, I set my exam for 5am, when I knew the network would be at it’s fastest. Still, My system didn’t pass the check. I had to change networks up to three times before it finally passed and I was able to write the exams.</p><p>Now, if you’re confident that your internet speed is good enough, feel free to take the online proctored exams. However, I suggest you use a local test center, to avoid unnecessary delays.</p><h3>Final Thoughts</h3><p>The DP-100 exam is a great way to showcase your expertise in Azure’s data science capabilities. Whether you’re new to data science or already working in the field, I encourage you to invest the time to earn this certification. With the right preparation and mindset, you can achieve it!</p><p>Good luck, and feel free to reach out if this article has helped you achieve your goals!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1114bc95d29c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Statistics with Pandas]]></title>
            <link>https://blog.stackademic.com/introduction-to-statistics-with-pandas-f2f3501f71af?source=rss-78145a7dfefb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2f3501f71af</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Omorere Idowu]]></dc:creator>
            <pubDate>Tue, 28 May 2024 10:17:15 GMT</pubDate>
            <atom:updated>2024-05-28T10:17:15.635Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Statistics is the <strong>science concerned with developing and studying methods for collecting, analyzing</strong>, interpreting and presenting empirical data.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*zMulCPF2k08EITWzh2HN-Q.jpeg" /></figure><p>Statistics is the tool with which we analyse, interpret, and make sense of data. This article will give you an introduction to some basic statistical concepts, and how to apply them using python’s pandas library. Let’s dive in.</p><h3>What is statistics?</h3><p>Statistics, in simple terms, is the practice and study of collecting and analysing data. Let’s first create a sample dataset to work with.</p><pre>install pandas as pd<br><br>data = {<br>    &#39;Name&#39;: [&#39;Adeola&#39;, &#39;Norah&#39;, &#39;Sarah&#39;, &#39;George&#39;, &#39;Gideon&#39;],<br>    &#39;Age&#39;: [24, 27, 22, 32, 29],<br>    &#39;Salary&#39;: [48000, 54000, 50000, 58000, 62000]<br>}<br><br>df = pd.DataFrame(data)<br>print(df)<br></pre><pre>      Name  Age  Salary<br>0   Adeola   24   48000<br>1    Norah   27   54000<br>2    Sarah   22   50000<br>3   George   32   58000<br>4   Gideon   29   62000</pre><h3>Types of Data</h3><p>Before we look at statistical techniques, it is important to first understand the types of data you can work with. There are two types of data: numeric data and categorical data.</p><h4>Numeric Data</h4><p>Numeric data represents values that are measurable and can be quantified. These can be further divided into:</p><ul><li>Discrete Data: Data that can only take specific values, often counts (e.g., number of children, number of cars).</li><li>Continuous Data: Data that can take any value within a range (e.g., height, weight, salary).</li></ul><p>In simpler words, continuous data is measured, while discrete data is counted. In our dataframe, <strong>‘Age’</strong> and <strong>‘Salary’</strong> are examples of numeric data. Specifically, Salary is continuous data and while age is measured, and therefore continuous by nature, it is often treated as discrete because it is usually measured in whole years. You rarely see a person’s age recorded as 24.6 years, it is simply 24 years. Therefore age is treated as discrete in most cases including our dataframe.</p><h4>Categorical Data</h4><p>Categorical data represents values that describe categories or groups. These can be:</p><ul><li>Nominal Data: Categories without any inherent order (e.g., gender, color).</li><li>Ordinal Data: Categories with a meaningful order but no consistent difference between levels (e.g., rankings, education levels).</li></ul><p>In our DataFrame, <strong>&#39;Name’</strong> is an example of categorical data. More specifically, it is an example of nominal data.</p><p>You can check what data types are in a DataFrame using the <strong>‘dtypes’</strong> attribute:</p><pre>print(df.dtypes)</pre><pre>Name      object<br>Age        int64<br>Salary     int64<br>dtype: object</pre><p>Here, <strong>‘object’</strong> represents string (categorical) data, while ‘<strong>int64</strong>’ represents integer (numeric) data.</p><h3>Descriptive vs. Inferential Statistics</h3><p>Statistics is divided into two main branches: descriptive statistics and inferential statistics.</p><h3>Descriptive Statistics</h3><p>Descriptive statistics helps us summarize and describe the main features of a dataset. Common descriptive statistics include:</p><ul><li>Mean: The average of the data.</li><li>Median: The middle value of the data.</li><li>Mode: The most frequent value in the data.</li><li>Standard Deviation: A measure of the dispersion or spread of the data. It is the square root of variance.</li><li>Variance: The average of the squared differences from the mean. It is also a measure of dispersion.</li></ul><p>The mean, median and mode are measures of central tendency. They tell us where the center of the data is. Standard deviation and variance on the other hand are measures of spread or dispersion. They tell us how far out the data points are from the center.</p><p>Let’s look at these in detail:</p><h4>Mean</h4><p>The mean (average) is the sum of all values divided by the number of values. You can calculate the mean of a column using the <strong>‘mean()’</strong> function:</p><pre>mean_age = df[&#39;Age&#39;].mean()<br>mean_salary = df[&#39;Salary&#39;].mean()<br>print(f&quot;Mean Age: {mean_age}&quot;)<br>print(f&quot;Mean Salary: {mean_salary}&quot;)</pre><p>The mean is the most commonly used measure of central tendency, however, it has a major drawback — it is easily swayed by outliers. As a quick example, the mean of 2, 3, 4, 5, and 45 is 11.8. This is misleading though as most of the data is between 2 and 5. The mean was greatly swayed by the 45 entry. In cases like this, other measures of central tendency such as the median are preferred.</p><h4>Median</h4><p>The median is the middle value when the data is sorted in ascending order. If the number of values is even, the median is the average of the two middle numbers. We can calculate this with the <strong>‘median()’</strong> function.</p><pre>median_age = df[&#39;Age&#39;].median()<br>median_salary = df[&#39;Salary&#39;].median()<br>print(f&quot;Median Age: {median_age}&quot;)<br>print(f&quot;Median Salary: {median_salary}&quot;)</pre><p>The median is unaffected by outliers, which makes it a great measure of central tendency. In the previous example, the median would be 4, which is more representative of the dataset than the mean of 11.8.</p><h4>Mode</h4><p>The mode is the most frequently occurring value in a dataset. This is calculated with the <strong>&#39;mode()&#39;</strong> function.</p><pre>mode_age = df[&#39;Age&#39;].mode()<br>mode_salary = df[&#39;Salary&#39;].mode()<br>print(f&quot;Mode Age: {mode_age}&quot;)<br>print(f&quot;Mode Salary: {mode_salary}&quot;)</pre><h4>Variance</h4><p>Variance is the average of the squared differences of each data point from the mean. It provides a measure of how spread out the values are. It can be calculated with pandas using the <strong>‘var()’</strong> function.</p><pre>var_age = df[&#39;Age&#39;].var()<br>var_salary = df[&#39;Salary&#39;].var()<br>print(f&quot;Variance of Age: {var_age}&quot;)<br>print(f&quot;Variance of Salary: {var_salary}&quot;)</pre><h4>Standard Deviation</h4><p>The standard deviation measures the amount of variation or dispersion in a set of values. It is basically the square root of variance. It can be calculated with the <strong>‘std()’</strong> function.</p><pre>std_age = df[&#39;Age&#39;].std()<br>std_salary = df[&#39;Salary&#39;].std()<br>print(f&quot;Standard Deviation of Age: {std_age}&quot;)<br>print(f&quot;Standard Deviation of Salary: {std_salary}&quot;)</pre><p>The standard deviation is preferred by professionals because it is in the same units as the dataset while the variance is in squared units. This allows us to make better conclusions about the spread of the data.</p><h4>Quick Summary Statistics with Pandas</h4><p>Pandas provides a quick way to get a summary of descriptive statistics for numeric columns in a dataset. This is called the <strong>‘describe()’ </strong>method. This method gives you an overview of the data, including the count, mean, standard deviation, minimum, 25th percentile, median, 75th percentile, and maximum values.</p><pre>print(df.describe())</pre><p>This will output:</p><pre>             Age        Salary<br>count   5.000000      5.000000<br>mean   26.800000  54400.000000<br>std     3.633180   5580.502315<br>min    22.000000  48000.000000<br>25%    24.000000  50000.000000<br>50%    27.000000  54000.000000<br>75%    29.000000  58000.000000<br>max    32.000000  62000.000000</pre><h3>Inferential Statistics</h3><p>While descriptive statistics summarize data, inferential statistics allow us to make predictions or inferences about a population based on a sample of data. It involves:</p><ul><li>Hypothesis Testing: Determining if there is enough evidence to support a specific hypothesis about a population.</li><li>Confidence Intervals: Estimating the range within which a population parameter lies, with a certain level of confidence.</li><li>Regression Analysis: Modeling the relationship between a dependent variable and one or more independent variables.</li></ul><p>Inferential statistics often require more advanced techniques and a good understanding of probability theory. For beginners, it’s crucial to first become comfortable with descriptive statistics and the basics of data manipulation.</p><p>In this article, we’ve introduced you to the basics of statistics using the pandas library in Python. We’ve covered the types of data, descriptive and inferential statistics, and how to calculate key descriptive statistics using pandas. We also learned about the <strong>‘df.describe()’</strong> method for quickly generating descriptive statistics.</p><p>These tools are essential for any data analysis task, providing the foundation you need to explore and understand your data. Pandas is a powerful library, and we’ve only scratched the surface of its capabilities. As you continue to work with pandas, you’ll discover many more functions and features that can help you analyze and manipulate data more effectively. Happy coding!</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>Tired of blogging platforms that force you to deal with algorithmic content? Try <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2f3501f71af" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/introduction-to-statistics-with-pandas-f2f3501f71af">Introduction to Statistics with Pandas</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Combining Dataframes with Pandas]]></title>
            <link>https://blog.stackademic.com/a-beginners-guide-to-combining-dataframes-with-pandas-a435a59a36c6?source=rss-78145a7dfefb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a435a59a36c6</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Omorere Idowu]]></dc:creator>
            <pubDate>Sun, 12 May 2024 10:45:47 GMT</pubDate>
            <atom:updated>2024-05-14T16:18:14.939Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A treasure hunt map" src="https://cdn-images-1.medium.com/max/1024/1*St3GJ2rLVKYMxgxOuruyIg.jpeg" /><figcaption>A treasure hunt map</figcaption></figure><p>Imagine you’re on a treasure hunt, but instead of searching for gold coins, you’re hunting down clues scattered across town. Each clue holds a piece of the puzzle, but they’re hidden in different places, waiting for you to find them.</p><p>That’s a bit like working with data. Sometimes, the info you need is spread across different tables, like pieces of a jigsaw puzzle waiting to be put together. But don’t worry, Pandas has a tool that can help you with this.</p><p>In this article, we’ll explore how to use Pandas to merge tables together. It’s a bit like connecting the dots to reveal the bigger picture. We’ll talk about inner joins, outer joins, left joins, and right joins — all important tools in your data detective kit.</p><p>Let’s dive in!</p><p>As a data newbie, you’ve been having fun working with your nicely curated datasets, haven’t you? However, what do you do when the data you’d like to work with is spread across different tables? As a data professional, one of the most common tasks you’ll do is join tables together to analyze or carry out whatever task is required. Pandas has a very handy tool for this called <strong>merge</strong>.</p><p>The merge function is used to join multiple tables together based on a column or columns they share in common. There are four kinds of joins in Pandas: inner join, outer join, left join, and right join.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evpiJUAl0Dw-bHbmjsFziw.png" /><figcaption>The common types of Joins</figcaption></figure><h4>Inner Join</h4><p>The inner join is the most common type of join used. It returns a dataframe with only those rows that have matching values in both dataframes. It is synonymous with an intersection of two sets in set theory. Let’s look at an example.</p><p>Say you work for an online retail store, and you’re asked to find out the products sold online and who purchased them. You’re given two different tables: a customer table containing information about the customers, and a product table containing information about the products. This can be easily solved with an inner join.</p><p>First, let’s create the tables (you can follow along with the notebook <a href="https://github.com/Rere-codes/data-basics">here</a>).</p><pre>import pandas as pd<br><br>product=pd.DataFrame({<br>    &#39;product_id&#39;:[101,102,103,104,105,106,107],<br>    &#39;product_name&#39;:[&#39;Watch&#39;,&#39;Bag&#39;,&#39;Shoes&#39;,&#39;Smartphone&#39;,&#39;Books&#39;,&#39;Oil&#39;,&#39;Laptop&#39;],<br>    &#39;category&#39;:[&#39;Fashion&#39;,&#39;Fashion&#39;,&#39;Fashion&#39;,&#39;Electronics&#39;,&#39;Study&#39;,&#39;Grocery&#39;,&#39;Electronics&#39;],<br>    &#39;price&#39;:[299.0,1350.50,2999.0,14999.0,145.0,110.0,79999.0],<br>})<br><br>customer=pd.DataFrame({<br>    &#39;customer_id&#39;:[1,2,3,4,5,6,7,8,9],<br>    &#39;name&#39;:[&#39;David&#39;,&#39;Temitope&#39;,&#39;Kelicha&#39;,&#39;Ayomide&#39;,&#39;Garba&#39;,&#39;Divine&#39;,&#39;Lawal&#39;,&#39;Ajoke&#39;,&#39;Angel&#39;],<br>    &#39;age&#39;:[20,25,15,10,30,65,35,18,23],<br>    &#39;product_id&#39;:[101,0,106,0,103,104,0,0,107],<br>    &#39;purchased_product&#39;:[&#39;Watch&#39;,&#39;NA&#39;,&#39;Oil&#39;,&#39;NA&#39;,&#39;Shoes&#39;,&#39;Smartphone&#39;,&#39;NA&#39;,&#39;NA&#39;,&#39;Laptop&#39;],<br>    &#39;city_of_residence&#39;:[&#39;Yaba&#39;,&#39;Abeokuta&#39;,&#39;Ikorodu&#39;,&#39;Ibadan&#39;,&#39;Ibadan&#39;,&#39;Abeokuta&#39;,&#39;Lekki&#39;,&#39;Abeokuta&#39;,&#39;Ikeja&#39;]<br>})<br><br>print(product)<br>print(customer)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*hGAxQpDWu5jFbQ-QP0ucKA.jpeg" /><figcaption>The product table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*gib-vV4w0H6hWF3G7Lg3vg.jpeg" /><figcaption>The customer table</figcaption></figure><p>An inner join can be easily achieved using the merge method as seen below</p><pre>product.merge(customer, on=&#39;product_id&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*98RjesxWI6eTVq7r0q6r3g.jpeg" /></figure><p>The merge method takes a series or dataframe object as an argument and merges it with the series or dataframe object it’s called on. In this example, we join the product and customer tables on the column they are related by — <strong>product_id</strong>. The resulting dataframe contains rows that have matching values in both tables!</p><p>What if the columns they are related by have different names? In our example, <strong>product_name</strong> is appears in both tables, but it is named <strong>purchased_product</strong> in the customer table. In this case, we simply specify both column names in the merge function using the <strong>left_on </strong>and <strong>right_on </strong>arguments.</p><pre>product.merge(customer, left_on=&#39;product_name&#39;, right_on=&#39;purchased_product&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*81H9-xnFkKHfcV_86gK65Q.jpeg" /></figure><p>Since the column name <strong>product_id</strong> appears twice in the resulting dataframe, pandas automatically suffixes them with <strong>_x </strong>and <strong>_y</strong> to differentiate them. You can set the suffixes yourself using the <strong>suffixes</strong> argument.</p><pre>product.merge(customer, left_on=&#39;product_name&#39;, right_on=&#39;purchased_product&#39;, suffixes=(&#39;_prd&#39;,&#39;_cst&#39;))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*fYrhj37Ko5VfK58HrJcJZA.jpeg" /></figure><h4>Left Join</h4><p>Let’s say your employers want to have information about all the products but only information about customers that bought something. To do this, you would use a left join! A left join returns all rows of data from the left table and only those rows from the right table where key columns match. The syntax is similar to that of the inner join. However, we introduce an additional argument, <strong>how</strong>. This specifies how pandas should merge the two tables. The default value for the <strong>how</strong> argument is <em>‘</em><strong>inner</strong><em>’</em>, which is why we didn’t need to specify it for the inner join</p><pre>product.merge(customer, on=&#39;product_id&#39;, how=&#39;left&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*B6jSnh2WQqUbc3hFeXhJqw.jpeg" /></figure><p>Notice that all the non-matching rows of the product dataframe contain NaN for the columns in the customer dataframe. It is simply an inner join plus all the non-matching rows of the left dataframe filled with NaN for columns of the right dataframe.</p><h4>Right Join</h4><p>A right join is essentially a mirror image of the left join. In our example, a right join would return information about all the customers, and only information about products that a customer bought. The syntax is similar as well, with the only difference being that the <strong>how</strong> argument is set to ‘right’.</p><pre>product.merge(customer, on=&#39;product_id&#39;, how=&#39;right&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*1Lg-oDaI9DCeuVLnaV5HFQ.jpeg" /></figure><h4>Outer Join</h4><p>Now your employers want to see all customers and all products, on one table. For this, you would use an outer join. Also known as a full join, an outer join returns all the records that have a match in either table. The syntax is similar, but the how argument is set to ‘outer’.</p><pre>product.merge(customer, on=&#39;product_id&#39;, how=&#39;outer&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*mq1zzdAlsF29Zl2yaVGfVQ.jpeg" /></figure><p>Here, all the non-matching rows of both dataframes have NaN values for the columns of other dataframes. But wait — we still don’t know which row belongs to which dataframe.</p><p>For this, Pandas provides us with a fantastic solution. By mentioning the <strong><em>indicator</em></strong><em> </em>argument as <strong><em>True</em></strong><em> </em>in the function, a new column of name <strong><em>_merge</em></strong><em> </em>will be created in the resulting dataframe. This let’s us know which dataframe each row belongs to.</p><pre>product.merge(customer, on=&#39;product_id&#39;, how=&#39;outer&#39;, indicator=True)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*OTX7eo_XDfeyPfc3-dYygw.jpeg" /></figure><h3>Concatenating Dataframes</h3><p>Another useful pandas method for combining data from multiple datasets is the <strong>concat </strong>method. While merge() is used for joining data frames based on a common column or index, concat() is used for concatenating data frames either vertically or horizontally. Let’s look at a brief example.</p><pre>#DataFrame 1<br>data=[[&#39;Cars&#39;,5],[&#39;Motorbikes&#39;,10],[&#39;Trucks&#39;,2],[&#39;Minivans&#39;,1]] <br>df1=pd.DataFrame(data,columns=[&#39;Vehicle&#39;,&#39;Numbers&#39;])<br>print(&#39;DataFrame 1  \n&#39; , df1) <br><br>#DataFrame 2<br>data=[[&#39;Sport Car&#39;,4],[&#39;SUVs&#39;,5]] <br>df2=pd.DataFrame(data,columns=[&#39;Vehicle&#39;,&#39;Numbers&#39;])<br>print(&#39;\n DataFrame 2  \n&#39; ,df2) <br><br>#DataFrame 3<br>data=[[&#39;Wagons&#39;,6],[&#39;Sedans&#39;,10]] <br>df3=pd.DataFrame(data,columns=[&#39;Vehicle&#39;,&#39;Numbers&#39;])<br>print(&#39;\n DataFrame 3  \n&#39; ,df3) <br><br>#concatenation<br>df_result= pd.concat([df1, df2, df3])<br>print(&#39;\n Concatenated Output  \n&#39; ,df_result) </pre><p>The <strong>concat</strong> method takes a list of dataframes as an argument, and concatenates these dataframes vertically, as seen in the output below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*BWqeuKlCzUjDkwRoknQ1NA.jpeg" /></figure><p>Notice how the index is repeated. This is because concat() by default keeps the original indexes of the separate dataframes. To rectify this, we set the <strong>ignore_index</strong> argument to <strong>True</strong></p><pre>pd.concat([df1, df2, df3], ignore_index=True)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*8BnkL0ILEmJ6rMfH0MmM-g.jpeg" /></figure><p>By default, concat() concatenates dataframes vertically, that is, by rows. But what if we want to concatenate the dataframes horizontally? We can achieve this by setting the axis argument to 1. It is set to 0 by default.</p><pre>#DataFrame 1<br>data=[[&#39;Nissan&#39;,5],[&#39;Porsche&#39;,10],[&#39;Toyota&#39;,2],[&#39;Chevrolet&#39;,1]] <br>cars=pd.DataFrame(data,columns=[&#39;Car&#39;,&#39;Numbers&#39;])<br><br>#DataFrame 2<br>data=[[&#39;Mark&#39;],[&#39;David&#39;],[&#39;Sarah&#39;],[&#39;Abiola&#39;]] <br>names=pd.DataFrame(data,columns=[&#39;Names&#39;])</pre><pre>pd.concat([cars, names], axis=1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*aLR13r1mt_Tw4i4Xt1HL9A.jpeg" /></figure><p>And there you have it! In this guide, we’ve learned how to put different pieces of data together using Pandas. We’ve talked about inner joins, outer joins, left joins, and right joins — each one helping us mix data in different ways. Whether we’re figuring out who bought what or combining datasets for a big picture view, Pandas has us covered.</p><p>Now that you’ve got these tricks up your sleeve, you’re ready to dive into your own data adventures. Remember, it’s all about exploring and finding the stories hidden in your data. So, grab your detective hat and start analyzing! Pandas is your trusty sidekick, and together, there’s no mystery you can’t solve. Happy analyzing!</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>Tired of blogging platforms that force you to deal with algorithmic content? Try <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a435a59a36c6" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/a-beginners-guide-to-combining-dataframes-with-pandas-a435a59a36c6">A Beginner’s Guide to Combining Dataframes with Pandas</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>