<?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 Reshma Dharmakumar on Medium]]></title>
        <description><![CDATA[Stories by Reshma Dharmakumar on Medium]]></description>
        <link>https://medium.com/@reshma.dharmakumar?source=rss-2fc8359ef1bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*21PbTxRou5dqG2yA2WqAyA.jpeg</url>
            <title>Stories by Reshma Dharmakumar on Medium</title>
            <link>https://medium.com/@reshma.dharmakumar?source=rss-2fc8359ef1bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:11:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@reshma.dharmakumar/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[Mastering SQL: From Theory to Practice — Day 2 (Understanding Joins Through Transaction Data)]]></title>
            <link>https://medium.com/@reshma.dharmakumar/mastering-sql-from-theory-to-practice-day-2-understanding-joins-through-transaction-data-525113146bde?source=rss-2fc8359ef1bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/525113146bde</guid>
            <category><![CDATA[sql-interview-questions]]></category>
            <category><![CDATA[sql-joins]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Reshma Dharmakumar]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 13:03:33 GMT</pubDate>
            <atom:updated>2026-11-22T13:03:33.995Z</atom:updated>
            <content:encoded><![CDATA[<p>In <strong>Day 1</strong>, we looked at how SQL talks to a single table — filtering rows, sorting results, and summarizing metrics. That works fine when all your answers live in one place.</p><p>In real-world systems, data never lives in one place.</p><p>If you work with banking, e-commerce, or payments data, customer details sit in one table, account profiles in another, and millions of daily transactions in a third. You cannot spot a suspicious transfer, calculate customer lifetime value, or investigate a failed payment by looking at one table in isolation. You have to connect the dots.</p><p>In SQL, connecting those dots happens through <strong>Joins</strong>.</p><h3>The Core Intuition: Why Do We Split Tables in the First Place?</h3><p>Imagine you run a digital payments app. Every time a customer buys a ₹50 coffee, you record the transaction. If you stored the customer’s full name, email, KYC status, city, and account creation date inside <em>every single coffee transaction row</em>, your database would bloat with duplicate information — and updating one customer’s address would mean rewriting thousands of rows.</p><p>Instead, databases split information into specialized tables:</p><ol><li>customers<strong> (Entity Table):</strong> Who the person is (customer_id, full_name, city, risk_tier).</li><li>transactions<strong> (Event Table):</strong> What they did (txn_id, customer_id, amount, txn_type, txn_date).</li></ol><p>Notice the bridge between them: customer_id. In customers, it uniquely identifies each person (Primary Key). In transactions, it tells us who made the transfer (Foreign Key). A <strong>Join</strong> simply uses this shared key to stitch the two tables together temporarily while you run your analysis.</p><h3>Our Sample Dataset</h3><p>To keep things concrete, let’s work with two small tables from a banking ledger.</p><p><strong>Table 1: </strong>customers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*NED0VFUQHjg_hcEt6jAPrw.png" /></figure><p><strong>Table 2: </strong>transactions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*0q8kTALVxsE0PzTJQ3-HNQ.png" /></figure><p>Look closely at two details in this data — they will matter in a second:</p><ul><li><strong>Vikram (</strong>C104<strong>)</strong> has an account, but <strong>zero transactions</strong>.</li><li>Transaction T905 belongs to C999, an ID that doesn&#39;t exist in our customers table (an orphaned record or unmapped account).</li></ul><p>Now let’s see how each Join treats these two edge cases.</p><h3>1. INNER JOIN: Only the Exact Matches</h3><p>Think of an <strong>INNER JOIN</strong> as a strict security checkpoint. A row only makes it into your final output if its customer_id exists in <strong>both</strong> tables.</p><p><strong>Scenario:</strong> You want a list of all completed transactions along with the customer’s name and risk tier.</p><pre>SELECT <br>    t.txn_id,<br>    c.full_name,<br>    c.risk_tier,<br>    t.amount,<br>    t.txn_type<br>FROM transactions t<br>INNER JOIN customers c<br>    ON t.customer_id = c.customer_id;</pre><p><strong>What happens here:</strong></p><ul><li>Ananya (C101), Karthik (C102), and Meera (C103) appear with their transaction details.</li><li><strong>Vikram (</strong>C104<strong>) is dropped</strong> because he has no transactions.</li><li><strong>Transaction </strong>T905<strong> (</strong>C999<strong>) is dropped</strong> because there is no matching customer profile.</li></ul><p><strong>When to use it:</strong> When you only care about active, matched activity — for example, calculating total transaction volume per verified customer.</p><h3>2. LEFT JOIN: Keep Everything on the Left, Match What You Can</h3><p>A <strong>LEFT JOIN</strong> prioritizes your primary (left) table. It keeps <strong>every single row</strong> from the left table, pulls in matching details from the right table where available, and fills in NULL wherever a match doesn&#39;t exist.</p><p><strong>Scenario:</strong> You want to audit <em>all</em> registered customers — including dormant accounts that haven’t transacted yet.</p><pre>SELECT <br>    c.customer_id,<br>    c.full_name,<br>    c.city,<br>    t.txn_id,<br>    t.amount<br>FROM customers c<br>LEFT JOIN transactions t<br>    ON c.customer_id = t.customer_id;</pre><p><strong>What happens here:</strong></p><ul><li>Ananya, Karthik, and Meera show up with their transactions.</li><li><strong>Vikram (</strong>C104<strong>) stays in the result</strong>, with NULL under txn_id and amount.</li></ul><p><strong>Pro Tip — Finding Dormant Accounts:</strong> Adding WHERE t.txn_id IS NULL at the end of a LEFT JOIN is one of the cleanest ways in SQL to isolate customers with zero activity.</p><h3>3. RIGHT JOIN: The Mirror Image</h3><p>A <strong>RIGHT JOIN</strong> does the exact opposite — it keeps every row from the right table and fills in NULL when the left table has no match.</p><p>In practice, most analysts rarely write RIGHT JOIN. Why? Because swapping the table order in a LEFT JOIN achieves the exact same result and is much easier for humans to read from left to right.</p><p><strong>Scenario:</strong> Auditing the transactions table to spot orphan records where customer profile data is missing.</p><pre>SELECT <br>    t.txn_id,<br>    t.customer_id AS txn_customer_id,<br>    t.amount,<br>    c.full_name<br>FROM transactions t<br>LEFT JOIN customers c<br>    ON t.customer_id = c.customer_id<br>WHERE c.customer_id IS NULL;</pre><p>Here, transaction T905<strong> (</strong>C999<strong>)</strong> jumps right out—a classic data completeness check before running any downstream model or report.</p><h3>4. FULL OUTER JOIN: The Complete Picture (Including Mismatches)</h3><p>A <strong>FULL OUTER JOIN</strong> keeps everything from <strong>both</strong> tables. Matches are stitched together; non-matches from either side get NULL on the opposite side.</p><p><strong>Scenario:</strong> Data reconciliation between your customer onboarding system and your transaction ledger. You want to see active customers, dormant customers (C104), <em>and</em> unmapped transactions (T905) in one unified view.</p><pre>SELECT <br>    c.customer_id,<br>    c.full_name,<br>    t.txn_id,<br>    t.amount<br>FROM customers c<br>FULL OUTER JOIN transactions t<br>    ON c.customer_id = t.customer_id;</pre><p><em>(Note: If you are practicing on MySQL, </em>FULL OUTER JOIN<em> isn&#39;t supported natively—you simulate it by combining a </em>LEFT JOIN<em> and a </em>RIGHT JOIN<em> using </em>UNION<em>.)</em></p><h3>5. CROSS JOIN: Every Possible Combination (No Matching Key)</h3><p>Unlike every other join we just covered, a <strong>CROSS JOIN</strong> has no ON condition. It pairs <strong>every row</strong> from the left table with <strong>every row</strong> from the right table (known mathematically as a Cartesian product). If Table A has 4 rows and Table B has 3 rows, CROSS JOIN outputs $4 \times 3 = 12$ rows.</p><p>If you ran customers CROSS JOIN transactions, SQL would match Vikram (C104) with Ananya&#39;s UPI payment (T901), creating nonsense combinations. So when would an analyst actually want this?</p><p><strong>Scenario:</strong> Building a <strong>complete monthly activity grid</strong> across channels. Suppose you have 4 customers and a reference table of 3 payment channels (UPI, NEFT, IMPS), and you want a report showing every customer&#39;s spend across <em>all three channels</em>—explicitly showing ₹0 where a customer never used a channel.</p><pre>WITH channels AS (<br>    SELECT &#39;UPI&#39; AS txn_type<br>    UNION ALL SELECT &#39;NEFT&#39;<br>    UNION ALL SELECT &#39;IMPS&#39;<br>)<br>SELECT <br>    c.customer_id,<br>    c.full_name,<br>    ch.txn_type,<br>    COALESCE(SUM(t.amount), 0) AS channel_volume<br>FROM customers c<br>CROSS JOIN channels ch<br>LEFT JOIN transactions t<br>    ON c.customer_id = t.customer_id<br>    AND ch.txn_type = t.txn_type<br>GROUP BY <br>    c.customer_id, <br>    c.full_name, <br>    ch.txn_type<br>ORDER BY <br>    c.customer_id, <br>    ch.txn_type;</pre><p><strong>Why this pattern is gold in real projects:</strong></p><ul><li>The CROSS JOIN creates a clean skeleton of all $4 \times 3 = 12$ (customer, channel) pairs first.</li><li>The LEFT JOIN then fills in actual transaction totals where they exist, and COALESCE(..., 0) turns missing combinations into clean zeros instead of leaving holes in your dataset.</li></ul><p><em>(Warning: Never run a </em><em>CROSS JOIN directly on two large raw tables—crossing a 100,000-row customer table with a 10-million-row transaction table generates a trillion rows and will crash your query.)</em></p><h3>6. SELF JOIN: Comparing Rows Inside the Same Table</h3><p>So far, we’ve joined <em>different</em> tables together. A <strong>SELF JOIN</strong> happens when a table is joined <strong>to itself</strong>.</p><p>Why would you ever join a table to itself? Whenever you need to compare <strong>one event against another event</strong> inside the same log — for example, comparing two consecutive transfers made by the same customer.</p><p><strong>Scenario:</strong> Look back at Karthik (C102) in our transactions table. He made two NEFT transfers on the exact same day (2026-11-02): T902 for ₹49,000 and T903 for ₹48,500. How do we catch pairs of same-day transfers made by the same customer?</p><p>To do this, we treat our single transactions table as two separate copies using aliases (t1 and t2):</p><pre>SELECT <br>    t1.customer_id,<br>    t1.txn_date,<br>    t1.txn_id AS first_txn,<br>    t1.amount AS first_amount,<br>    t2.txn_id AS second_txn,<br>    t2.amount AS second_amount,<br>    (t1.amount + t2.amount) AS combined_amount<br>FROM transactions t1<br>INNER JOIN transactions t2<br>    ON t1.customer_id = t2.customer_id<br>    AND t1.txn_date = t2.txn_date<br>    AND t1.txn_id &lt; t2.txn_id;</pre><p><strong>Look closely at that third condition (</strong><strong>t1.txn_id &lt; t2.txn_id)—this is the secret to a clean Self Join:</strong></p><ul><li>Without it, SQL would match T902 with <em>itself</em> (T902 = T902).</li><li>Using &lt;&gt; (not equal) would return duplicate mirror pairs (T902 paired with T903, <em>and</em> T903 paired with T902).</li><li>Using &lt; ensures each unique pair appears <strong>only once</strong> (T902 followed by T903), cleanly surfacing Karthik&#39;s combined ₹97,500 same-day split activity.</li></ul><p><strong>When to use it:</strong> Detecting rapid repeat transactions, comparing a user’s current order against their previous order, or mapping hierarchies (like an employees table where manager_id points back to employee_id).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*LtpGEK5agF0_J9ELAh0dPw.png" /><figcaption>A quick cheatsheet of joins</figcaption></figure><h3>Putting It Together: A Real-World Analytical Query</h3><p>In actual work, you rarely stop at just joining two tables — you join them to <strong>aggregate and flag patterns</strong>.</p><p>Suppose you want to identify <strong>High-Risk customers</strong> whose total transfer volume crossed <strong>₹50,000</strong> in November 2026:</p><pre>SELECT <br>    c.customer_id,<br>    c.full_name,<br>    c.risk_tier,<br>    COUNT(t.txn_id) AS total_txns,<br>    SUM(t.amount) AS total_volume<br>FROM customers c<br>INNER JOIN transactions t<br>    ON c.customer_id = t.customer_id<br>WHERE c.risk_tier = &#39;High&#39;<br>  AND t.txn_date &gt;= &#39;2026-11-01&#39;<br>GROUP BY <br>    c.customer_id, <br>    c.full_name, <br>    c.risk_tier<br>HAVING SUM(t.amount) &gt; 50000;</pre><p>Look at what happens for <strong>Karthik (</strong>C102<strong>)</strong>: individually, his two NEFT transfers (₹49,000 and ₹48,500) stayed just under ₹50,000, yet together they total ₹97,500. Joining the customer risk profile with aggregated transaction behavior immediately surfaces a pattern that single-row inspection would miss.</p><h3>Quick Cheat Sheet Before You Write Your Next Query</h3><ul><li><strong>Want only matched rows?</strong> → INNER JOIN</li><li><strong>Want all rows from your main table, even without activity?</strong> → LEFT JOIN</li><li><strong>Want to find missing records or orphan keys?</strong> → LEFT JOIN + WHERE right_table.key IS NULL</li><li><strong>Want a full reconciliation across both sides?</strong> → FULL OUTER JOIN</li><li><strong>Want every possible combination (e.g., building a date/channel matrix before a </strong><strong>LEFT JOIN)?</strong> → CROSS JOIN</li><li><strong>Want to compare two rows inside the same table (e.g., repeat same-day transactions)?</strong> → SELF JOIN (using table aliases t1 and t2 + t1.id &lt; t2.id)</li></ul><p>P.S.: These questions are asked in almost all of my interviews.</p><h3>What’s Next in Day 3?</h3><p>Once you join tables, one common trap catches almost everyone: <strong>accidental row duplication</strong> when one customer has multiple transactions (the classic <em>many-to-many</em> fan-out problem). In <strong>Day 3</strong>, we’ll tackle <strong>Common Table Expressions (CTEs) and Window Functions</strong> — the tools that let you calculate rolling averages, rank transactions, and avoid double-counting without breaking a sweat.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=525113146bde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering SQL : From Theory to Practice — Day 1]]></title>
            <link>https://medium.com/@reshma.dharmakumar/mastering-sql-from-theory-to-practice-day-1-68529379833a?source=rss-2fc8359ef1bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/68529379833a</guid>
            <category><![CDATA[query]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Reshma Dharmakumar]]></dc:creator>
            <pubDate>Wed, 30 Apr 2025 03:32:38 GMT</pubDate>
            <atom:updated>2025-04-30T03:32:38.237Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mastering SQL : From Theory to Practice — Day 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*63mLzjTu_eVnO80S" /><figcaption>Photo by <a href="https://unsplash.com/@sunder_2k25?utm_source=medium&amp;utm_medium=referral">Sunder Muthukumaran</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When it comes to working with data, <strong>SQL (Structured Query Language)</strong> is the backbone of almost everything. Whether we’re analyzing a tiny dataset or working with massive amounts of data, knowing how to query and manage data with SQL is essential.</p><p>I’ve often seen people get overwhelmed by SQL’s complexity at first — but once we break it down into bite-sized chunks, it’s not only manageable but also pretty intuitive. Let’s dive into some of the most important SQL basics that’ll set us up for success, from theory to practical use cases.</p><h3>1. SELECT: Getting the Data We Need</h3><h4>What It Is:</h4><p>At the heart of SQL is the SELECT statement. It’s our tool for asking the database, “Hey, what data do you have for me?” Think of it like we’re sitting down at a restaurant and we’re deciding what to order from the menu. We tell the waiter (SQL) exactly what we want.</p><h4>Basic Syntax:</h4><pre>SELECT column1, column2, ...<br>FROM table_name;</pre><h4>Example:</h4><p>Let’s say we have a table called customers, and we just want to see the names and email addresses of our customers. We’d write:</p><pre>SELECT name, email<br>FROM customers;</pre><p>This will pull back all customer names and emails from the customers table. Easy, right?</p><h3>2. WHERE: Filtering the Data</h3><h4>What It Is:</h4><p>The WHERE clause is all about <strong>filtering</strong> the data. It&#39;s like saying, &quot;I don’t want everything on the menu, just the dishes that have chicken.&quot; We can specify conditions with operators like =, &gt;, &lt;, IN, or LIKE to fine-tune our query.</p><h4>Basic Syntax:</h4><pre>SELECT column1, column2, ...<br>FROM table_name<br>WHERE condition;</pre><h4>Example:</h4><p>Say we only want to see customers who live in <strong>New York</strong>. Here’s how we’d filter it:</p><pre>SELECT name, email<br>FROM customers<br>WHERE city = &#39;New York&#39;;</pre><p>This will return only the customers who live in New York. It’s a simple way to pull out exactly what we need.</p><h3>3. ORDER BY: Sorting Our Results</h3><h4>What It Is:</h4><p>Once we have our data, we might want to sort it. The ORDER BY clause helps with that. It&#39;s like arranging our items from the lowest price to the highest price, or vice versa. We can sort data in ascending (ASC) or descending (DESC) order.</p><h4>Basic Syntax:</h4><pre>SELECT column1, column2, ...<br>FROM table_name<br>ORDER BY column1 [ASC | DESC];</pre><h4>Example:</h4><p>Let’s say we want to list the customers, but we want the ones who’ve spent the most money at the top. We would use ORDER BY like this:</p><pre>SELECT name, total_spent<br>FROM customers<br>ORDER BY total_spent DESC;</pre><p>This will return all customers, but <strong>sorted from highest spender to lowest</strong>.</p><h3>4. GROUP BY: Summarizing Data</h3><h4>What It Is:</h4><p>The GROUP BY clause is used when we want to <strong>group data</strong> and perform calculations on those groups. We often use it alongside aggregate functions like COUNT(), SUM(), AVG(), etc. Think of it like organizing our data into categories and then performing operations like counting or averaging on those categories.</p><h4>Basic Syntax:</h4><pre>SELECT column1, COUNT(*)<br>FROM table_name<br>GROUP BY column1;</pre><h4>Example:</h4><p>Let’s say we have a table called sales, and we want to know how many sales each <strong>salesperson</strong> made. Here&#39;s how we could do that:</p><pre>SELECT salesperson_id, COUNT(*)<br>FROM sales<br>GROUP BY salesperson_id;</pre><p>This will show us how many sales each salesperson has made. It’s a great way to get summaries of large amounts of data.</p><h3>5. NULL: Dealing with Missing Data</h3><h4>What It Is:</h4><p>In SQL, NULL represents <strong>missing or undefined</strong> data. It’s not the same as an empty string or zero. NULL is used when there’s no value available for a particular column. To filter out or find NULL values, we use IS NULL or IS NOT NULL.</p><h4>Basic Syntax:</h4><pre>SELECT column1, column2<br>FROM table_name<br>WHERE column1 IS NULL;</pre><h4>Example:</h4><p>Let’s say we want to find customers who haven’t yet provided their phone numbers. The query would be:</p><pre>SELECT name, email<br>FROM customers<br>WHERE phone_number IS NULL;</pre><p>This will give us a list of customers who are missing their phone numbers in the database.</p><h3>Conclusion: SQL in the Real World</h3><p>Mastering the basics of SQL is a <strong>crucial step</strong> if we want to work in data. It’s like learning how to read a map before going on a road trip — once we know the basics, the possibilities are endless.</p><p>By now, we should be comfortable with common SQL commands like SELECT, WHERE, ORDER BY, GROUP BY and NULL. These are the building blocks that will help us query databases and retrieve meaningful insights from our data.</p><p>I’ll be covering some more advanced SQL concepts, like subqueries, window functions, and optimizing queries, in future blog posts. Stay tuned!</p><p><strong>Keep practicing</strong> and before we know it, SQL will feel like second nature. If we have any questions or want further clarification, feel free to drop a comment or reach out.</p><p><strong>Let’s Connect:</strong></p><p>👉 <a href="https://medium.com/@reshma.dharmakumar">Follow me for more SQL tips and insights.</a><br> 👉 Reach out if we’re interested in diving deeper into SQL!</p><p>#SQL #DataAnalytics #LearningSQL #DataScience #SQLBasics #DatabaseManagement</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68529379833a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis (EDA): A Step-by-Step Approach using Python]]></title>
            <link>https://medium.com/@reshma.dharmakumar/exploratory-data-analysis-eda-a-step-by-step-approach-using-python-f46c84084823?source=rss-2fc8359ef1bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f46c84084823</guid>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[outliers]]></category>
            <category><![CDATA[data-cleaning]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <dc:creator><![CDATA[Reshma Dharmakumar]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 07:03:14 GMT</pubDate>
            <atom:updated>2025-01-01T07:03:14.882Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Exploratory Data Analysis (EDA): A Step-by-Step Approach</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D1aQnvMten-P2sEI" /><figcaption>Photo by <a href="https://unsplash.com/@dawson2406?utm_source=medium&amp;utm_medium=referral">Stephen Dawson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Exploratory Data Analysis (EDA) is the first and most crucial step in any data science project. It helps uncover patterns, detect outliers, and understand relationships between variables. EDA lays the foundation for building predictive models and making data-driven decisions. In this blog, I’ll walk you through the process step-by-step using simple language and practical examples.</p><h3>What is EDA?</h3><p>EDA is the process of analyzing data sets to summarize their main characteristics. It involves visualizations and statistical techniques to:</p><ul><li>Spot trends and patterns</li><li>Identify missing values</li><li>Detect anomalies or outliers</li><li>Understand variable distributions</li><li>Assess relationships between variables</li></ul><h3>Why is EDA Important?</h3><ol><li><strong>Data Cleaning:</strong> Identify errors and missing data.</li><li><strong>Feature Selection:</strong> Choose the right variables for modeling.</li><li><strong>Hypothesis Testing:</strong> Formulate and test assumptions about the data.</li><li><strong>Improved Model Accuracy:</strong> Gain insights to optimize model performance.</li></ol><h3>Step 1: Understand the Data</h3><p>Start by loading the dataset and reviewing its structure.</p><pre>import pandas as pd<br># Load dataset<br>data = pd.read_csv(&#39;data.csv&#39;)<br><br># Check the first 5 rows<br>data.head()<br><br># Display column names and data types<br>data.info()<br><br># Check basic statistics<br>data.describe()</pre><ul><li>Look at data types (numeric, categorical, etc.).</li><li>Identify missing values and outliers.</li><li>Assess variable ranges and distributions.</li></ul><h3>Step 2: Handle Missing Values</h3><p>Missing data can mess with analysis. Address them early.</p><pre># Check missing values<br>data.isnull().sum()<br><br># Fill missing values with mean or median<br>data[&#39;column_name&#39;].fillna(data[&#39;column_name&#39;].mean(), inplace=True)<br><br># Drop rows with missing values<br>data.dropna(inplace=True)</pre><p>Domain knowledge is necessary to handle missing values appropriately.</p><h3>Step 3: Visualize the Data</h3><p>Visualizations make patterns clearer and more actionable.</p><h4>Histogram (Distribution)</h4><pre>import matplotlib.pyplot as plt<br>import seaborn as sns<br><br># Histogram for a numeric column<br>sns.histplot(data[&#39;column_name&#39;], bins=20, kde=True)<br>plt.show()</pre><p>Use histograms to see value distributions and detect skewness.</p><h4>Boxplot (Outliers)</h4><pre>sns.boxplot(x=data[&#39;column_name&#39;])<br>plt.show()</pre><p>Boxplots help spot outliers that may impact modeling.</p><h4>Pairplot (Relationships)</h4><pre>sns.pairplot(data)<br>plt.show()</pre><p>Pairplots reveal correlations between variables.</p><h3>Step 4: Analyze Relationships</h3><h4>Correlation Matrix</h4><pre># Calculate correlations<br>corr = data.corr()<br><br># Heatmap visualization<br>sns.heatmap(corr, annot=True, cmap=&#39;coolwarm&#39;)<br>plt.show()</pre><p>Positive and negative correlations guide feature selection.</p><h3>Step 5: Identify Outliers</h3><p>Outliers can skew results. Detect and handle them.</p><pre>from scipy import stats<br><br># Z-Score method<br>z_scores = stats.zscore(data[&#39;column_name&#39;])<br>outliers = data[abs(z_scores) &gt; 3]</pre><p>Consider treating outliers by capping or transformation, but the decision depends on the domain for which the analysis is being done.</p><h3>Step 6: Feature Engineering</h3><p>Transform raw data into useful inputs for modeling.</p><ul><li><strong>Binning:</strong> Convert continuous data into categories.</li><li><strong>Log Transformation:</strong> Reduce skewness.</li><li><strong>Dummy Variables:</strong> Encode categorical data for models.</li></ul><pre># Creating dummy variables<br>encoded_data = pd.get_dummies(data, drop_first=True)</pre><h3>Step 7: Summarize Findings</h3><p>Document observations before proceeding to modeling.</p><ol><li><strong>Key Trends:</strong> Highlight patterns or clusters found.</li><li><strong>Outliers:</strong> Mention anomalies and how they were handled.</li><li><strong>Feature Selection:</strong> Justify the inclusion of specific variables.</li><li><strong>Next Steps:</strong> Outline modeling plans.</li></ol><h3>Conclusion</h3><p>Exploratory Data Analysis is a vital step in the data science process. It provides the insights needed to clean data, select features, and prepare models effectively. By following this structured approach, you can make data-driven decisions and build more accurate machine learning models.</p><p>Ready to start your EDA journey? Load your dataset and begin exploring patterns today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f46c84084823" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding ARIMA and SARIMAX Models: Simple Guide for Time Series Forecasting]]></title>
            <link>https://medium.com/@reshma.dharmakumar/understanding-arima-and-sarimax-models-simple-guide-for-time-series-forecasting-5b7cb4eebc5c?source=rss-2fc8359ef1bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b7cb4eebc5c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <category><![CDATA[sarima]]></category>
            <category><![CDATA[arima]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <dc:creator><![CDATA[Reshma Dharmakumar]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 15:21:17 GMT</pubDate>
            <atom:updated>2024-09-05T14:02:21.778Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Demystifying ARIMA and SARIMAX: A Guide to Time Series Forecasting</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d2t59zCmRXMZJtd7" /><figcaption>Photo by <a href="https://unsplash.com/@tprahm?utm_source=medium&amp;utm_medium=referral">Tyler Prahm</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Imagine you’re a detective trying to solve a mystery by looking at clues from the past. ARIMA and SARIMAX are like your super-smart detective gadgets for analyzing patterns and making predictions. Let’s break them down!</p><h3>What is Time Series?</h3><p><strong>Imagine This:</strong><br>Think about your favorite video game scores over time. Every day you play, you get a new score. If you write down your scores for each day, you have a list of numbers that change over time. This list is called a <strong>time series</strong> because it shows how something changes <strong>over time</strong>.</p><p><strong>Why It’s Cool:</strong><br>Time series help us see patterns, like if your scores are getting better, worse, or staying the same. We can use these patterns to guess what your next score might be!</p><h3>Meet ARIMA: Your Prediction Buddy</h3><p><strong>ARIMA</strong> stands for:</p><ul><li><strong>A</strong>uto <strong>R</strong>egressive (AR)</li><li><strong>I</strong>ntegrated (I)</li><li><strong>M</strong>oving <strong>A</strong>verage (MA)</li></ul><p><strong>Let’s Break It Down:</strong></p><h3>a. Auto-Regressive (AR):</h3><ul><li><strong>What It Means:</strong> This part looks at how your past scores affect your future scores.</li><li><strong>Example:</strong> If you did really well yesterday, maybe you’ll do well today too because you’re on a roll!</li></ul><h3>b. Integrated (I):</h3><ul><li><strong>What It Means:</strong> Sometimes, your scores might go up or down steadily. This part helps to make the data more stable by removing trends.</li><li><strong>Example:</strong> If you’re getting better every day, this helps the model understand that trend and not get confused by it.</li></ul><h3>c. Moving Average (MA):</h3><ul><li><strong>What It Means:</strong> This part smooths out the ups and downs by looking at the average of past scores.</li><li><strong>Example:</strong> If you had a bad day yesterday, this helps balance it out by considering how things were before that bad day.</li></ul><p><strong>Putting It All Together:</strong> ARIMA uses your past scores (AR), makes the data steady (I), and smooths things out (MA) to predict your next score. It’s like using your history to make a smart guess about the future!</p><h3>Introducing SARIMAX: The Supercharged ARIMA</h3><p><strong>SARIMAX</strong> stands for:</p><ul><li><strong>S</strong>easonal <strong>ARIMA</strong> with <strong>e</strong>xogenous variables (Extra Information)</li></ul><p><strong>Why We Need SARIMAX:</strong> Sometimes, things repeat in patterns, like seasons! For example, your ice cream sales might go up every summer and down every winter. SARIMAX helps us handle these repeating patterns and can also use extra information to make better predictions.</p><h3>a. Seasonal ARIMA (SARIMA):</h3><ul><li><strong>What It Adds:</strong> It looks for patterns that repeat over time, like seasons or months.</li><li><strong>Example:</strong> If you know your game scores are higher on weekends, SARIMA can use that pattern to predict future weekend scores.</li></ul><h3>b. eXogenous Variables (X):</h3><ul><li><strong>What It Means:</strong> This is extra information that might affect your scores.</li><li><strong>Example:</strong> Maybe you get better scores when you play with a new controller. This extra info helps SARIMAX make smarter predictions.</li></ul><p><strong>Putting It All Together:</strong> SARIMAX is like ARIMA on steroids! It not only uses your past scores but also looks for repeating patterns and can use extra info to make even better guesses about your future scores.</p><h3>A Fun Example: Predicting Ice Cream Sales</h3><p><strong>Scenario:</strong> Imagine you run an ice cream stand, and you want to predict how many ice creams you’ll sell each day.</p><h3>Using ARIMA:</h3><ul><li><strong>Auto-Regressive:</strong> If you sold a lot yesterday, you might sell a lot today.</li><li><strong>Integrated:</strong> If your sales are increasing every month, ARIMA helps to account for that growth.</li><li><strong>Moving Average:</strong> It smooths out days when sales were unusually high or low.</li></ul><p><strong>Prediction:</strong> ARIMA might tell you, “Based on your past sales, you’ll likely sell around 50 ice creams tomorrow.”</p><h3>Using SARIMAX:</h3><ul><li><strong>Seasonal:</strong> Sales are higher in summer and lower in winter.</li><li><strong>eXogenous Variables:</strong> Maybe you have a weather forecast showing it will be a hot day.</li></ul><p><strong>Prediction:</strong> SARIMAX uses both the seasonal pattern and the weather info to predict, “Since it’s summer and sunny, you’ll probably sell around 80 ice creams tomorrow!”</p><h3>Why Are ARIMA and SARIMAX Awesome?</h3><ul><li><strong>Data Detective Skills:</strong> They help find hidden patterns in your data.</li><li><strong>Smart Predictions:</strong> They use these patterns to make educated guesses about the future.</li><li><strong>Flexible:</strong> SARIMAX can handle more complex situations with repeating patterns and extra info.</li></ul><h3>How Do They Work? A Simple Step-by-Step</h3><h3>Step 1: Gather Your Data</h3><ul><li>Collect your daily scores or sales numbers.</li></ul><h3>Step 2: Look for Patterns</h3><ul><li>See if your data has trends (like getting better over time) or repeating patterns (like weekly cycles).</li></ul><h3>Step 3: Choose the Right Model</h3><ul><li>Use ARIMA if your data has trends and random ups and downs.</li><li>Use SARIMAX if your data also has repeating patterns and you have extra info to include.</li></ul><h3>Step 4: Teach the Model</h3><ul><li>Let the model learn from your past data.</li></ul><h3>Step 5: Make Predictions</h3><ul><li>Ask the model to predict future scores or sales based on what it learned.</li></ul><h3>Final Thoughts</h3><p>ARIMA and SARIMAX are powerful tools that help us make sense of numbers that change over time. Whether you’re tracking game scores, ice cream sales, or even weather patterns, these models can help you predict what’s coming next by learning from the past. It’s like having a crystal ball that uses data to give you a smart guess about the future!</p><p>Happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b7cb4eebc5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Intersection of Data Science and Economics: A Theoretical Foundation]]></title>
            <link>https://medium.com/@reshma.dharmakumar/the-intersection-of-data-science-and-economics-a-theoretical-foundation-eae7520ff5b9?source=rss-2fc8359ef1bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/eae7520ff5b9</guid>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Reshma Dharmakumar]]></dc:creator>
            <pubDate>Wed, 28 Aug 2024 18:22:52 GMT</pubDate>
            <atom:updated>2024-08-28T18:56:45.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OmXMmRSKjNcuoOk5" /><figcaption>Photo by <a href="https://unsplash.com/@lukechesser?utm_source=medium&amp;utm_medium=referral">Luke Chesser</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I’m excited to explore the powerful intersection between Data Science and Economics. Both fields, though distinct, share a common goal: making informed decisions based on data-driven insights.</p><h3><strong>Understanding Data Science Through an Economic Lens</strong></h3><p>At its core, Data Science is about extracting meaningful information from vast amounts of data. This process is analogous to how economists analyze markets, behaviors, and trends to make predictions and inform policy.</p><ol><li><strong>Supply and Demand of Data</strong> 📈</li></ol><p>Just as supply and demand curves in economics illustrate market equilibrium, data availability (supply) and the need for insights (demand) drive the value of data in decision-making. The richer the data, the more refined our models can be.</p><p><strong>2. Optimization Problems</strong> 🎯</p><p>Economists often focus on optimization — maximizing utility, minimizing cost, or achieving equilibrium. In Data Science, optimization is key in algorithms like Linear Regression, where we minimize the error to find the best-fitting line.</p><p><strong>3. Causal Inference and Correlation</strong> 🔍</p><p>Economics is deeply rooted in understanding causality — what causes what. In Data Science, this concept is reflected in regression analysis and causal inference methods, where we discern correlation from causation to make accurate predictions.</p><p><strong>4. The Value of Prediction</strong> 📊</p><p>Forecasting future trends is a staple in both fields. Economists predict GDP growth, while Data Scientists predict customer behavior. Techniques like time series analysis bridge these fields, allowing us to model and forecast with precision.</p><h3><strong>Bridging the Gap</strong></h3><p>As I delve deeper into these intertwined concepts, my goal is to bring clarity to the theoretical underpinnings of Data Science while drawing parallels with economic principles. Through my blog, I aim to demystify these topics, making them accessible and applicable to real-world scenarios.</p><p>This journey is just beginning, and I’m eager to share insights, learnings, and applications that sit at the nexus of Data Science and Economics. Stay tuned for more!</p><p>#DataScience #Economics #MachineLearning #Optimization #CausalInference #Forecasting #MediumBloggingJourney</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eae7520ff5b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>