<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ data analytics - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ data analytics - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:31:19 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/data-analytics/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Python in Marketing: A Practical Guide to Marketing Analytics, Automation, and Data-Driven Growth [Full Book] ]]>
                </title>
                <description>
                    <![CDATA[ Marketing has always involved wrangling lots of data. Before digital marketing, businesses had to track sales, customer purchases, coupon redemptions, store traffic, and survey responses to understand ]]>
                </description>
                <link>https://www.freecodecamp.org/news/python-in-marketing-a-practical-book/</link>
                <guid isPermaLink="false">6ae36961d5f7580678ebe2d1</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Data Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ automation ]]>
                    </category>
                
                    <category>
                        <![CDATA[ book ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Eva J Patel ]]>
                </dc:creator>
                <pubDate>Thu, 29 Oct 2026 15:42:25 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/edbaff87-7932-42b2-8c28-61bb67972244.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Marketing has always involved wrangling lots of data. Before digital marketing, businesses had to track sales, customer purchases, coupon redemptions, store traffic, and survey responses to understand what their customers wanted.</p>
<p>And while digital marketing didn't invent marketing analytics, it dramatically increased the amount of information out there.</p>
<p>Today, almost every interaction can produce data. A person might see an advertisement, click it, visit a website, read an article, subscribe to an email list, open several emails, add a product to a shopping cart, leave the website, return through a search engine, and eventually make a purchase. And every one of those interactions can potentially become a data point.</p>
<p>For a marketer, this creates an incredible opportunity. It also creates a problem: having more data doesn't automatically result in better decisions.</p>
<p>A company can have hundreds of thousands of customer records and still not know which customers are most valuable. A marketing team can have dozens of dashboards and still struggle to answer a simple question such as, "Which campaign should we invest more money into?"</p>
<p>This is where programming becomes useful. Python gives marketers a way to work with data programmatically. Instead of manually opening spreadsheets, copying formulas, filtering rows, and creating the same report every week, you can build reusable processes that perform those tasks automatically.</p>
<p>More importantly, Python allows you to go beyond simple reporting. You can use it to investigate customer behavior, discover patterns, perform statistical analysis, create predictive models, automate workflows, and build systems that continuously transform raw marketing data into useful information.</p>
<p>That doesn't mean every marketer needs to become a software engineer. It just means that programming can become another tool in a marketer's toolbox and this tutorial explains how.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<p>You don't need to be an experienced programmer or marketer to use this book, but a few basics will make the examples easier to follow.</p>
<ul>
<li><strong>A computer with Python installed:</strong> Use a recent Python 3 version. If you're new to Python, an editor such as VS Code or PyCharm can help you run the examples.</li>
<li><strong>Basic computer and file skills:</strong> You should be comfortable opening files, creating folders, and working with CSV or Excel spreadsheets.</li>
<li><strong>A willingness to learn Python fundamentals:</strong> Part I starts with variables, strings, numbers, conditions, loops, and functions, so prior Python experience is helpful but not required.</li>
<li><strong>A little familiarity with marketing concepts:</strong> Terms such as campaign, conversion, revenue, clicks, and advertising spend will appear throughout. You can learn the metrics as you go. The book explains key terms where they're introduced.</li>
<li><strong>The ability to install packages:</strong> Later chapters use libraries such as pandas, NumPy, Matplotlib, scikit-learn, and requests. Examples show how to install them.</li>
</ul>
<p>You can follow the book using sample data. You don't need access to a company's private customer data or paid marketing APIs. If you use real data, make sure you have permission to access it and avoid exposing personal or confidential information.</p>
<h3 id="heading-what-this-book-will-teach-you">What This Book Will Teach You</h3>
<p>This book focuses on three major ideas:</p>
<ol>
<li><strong>Marketing analytics:</strong> using data to understand what happened and why.</li>
<li><strong>Marketing automation:</strong> using Python to perform repetitive marketing tasks more efficiently.</li>
<li><strong>Marketing intelligence:</strong> combining data, analytics, automation, and predictive techniques to support better decisions.</li>
</ol>
<p>You'll begin with Python fundamentals and gradually move into more advanced applications.</p>
<p>By the end, you'll build a marketing intelligence system that combines many of these concepts into one project.</p>
<h3 id="heading-heres-what-well-cover">Here's What We'll Cover:</h3>
<ul>
<li><a href="#heading-part-i-python-fundamentals-for-marketers">Part I: Python Fundamentals for Marketers</a></li>
<li><a href="#heading-part-ii-working-with-marketing-data">Part II: Working With Marketing Data</a></li>
<li><a href="#heading-part-iii-data-cleaning-and-analysis-with-pandas">Part III: Data Cleaning and Analysis With pandas</a></li>
<li><a href="#heading-part-iv-marketing-visualization">Part IV: Marketing Visualization</a></li>
<li><a href="#heading-part-v-customer-and-campaign-analytics">Part V: Customer and Campaign Analytics</a></li>
<li><a href="#heading-part-vi-marketing-automation">Part VI: Marketing Automation</a></li>
<li><a href="#heading-part-vii-machine-learning-for-marketing">Part VII: Machine Learning for Marketing</a></li>
<li><a href="#heading-part-viii-building-a-marketing-intelligence-system">Part VIII: Building a Marketing Intelligence System</a></li>
<li><a href="#heading-capstone-project-build-a-python-marketing-intelligence-platform">Capstone Project: Build a Python Marketing Intelligence Platform</a></li>
<li><a href="#heading-conclusion-next-steps">Conclusion / Next Steps</a></li>
</ul>
<h2 id="heading-the-philosophy-of-this-book">The Philosophy of This Book</h2>
<p>There's an important difference between learning Python and learning to <strong>use</strong> Python.</p>
<p>Learning Python means understanding syntax, data types, functions, loops, libraries, and other programming concepts. Using Python means taking those concepts and applying them to an actual problem.</p>
<p>This book focuses heavily on the second approach.</p>
<p>You'll still learn Python fundamentals, but the examples will consistently connect those fundamentals to marketing.</p>
<p>Instead of simply writing:</p>
<pre><code class="language-python">x = 10
y = 20
print(x + y)
</code></pre>
<p>we'll work with things like:</p>
<pre><code class="language-python">campaign_budget = 10000
campaign_spend = 7350

remaining_budget = campaign_budget - campaign_spend

print(remaining_budget)
</code></pre>
<p>The programming concept is the same, but the context is different.</p>
<p>That context is what makes the skill useful.</p>
<h2 id="heading-part-i-python-fundamentals-for-marketers">Part I: Python Fundamentals for Marketers</h2>
<p>Python doesn't know what a campaign is or what a customer is. And it doesn't know whether an advertisement is successful. Python simply processes the instructions you give it.</p>
<p>That means your first job is learning how to communicate with the computer.</p>
<p>Fortunately, you don't need to learn everything about Python before you can start working with marketing data. But you do need a practical foundation.</p>
<h3 id="heading-thinking-like-a-programmer">Thinking Like a Programmer</h3>
<p>Programming can initially seem intimidating because computers are extremely literal.</p>
<p>If you tell a person: "Calculate how much money we have left from the campaign budget," they can probably figure out what you mean.</p>
<p>A computer needs explicit instructions. You need to tell it which values to use and which operation to perform.</p>
<p>For example:</p>
<pre><code class="language-python">budget = 10000
spent = 7350

remaining = budget - spent

print(remaining)
</code></pre>
<p>The output is:</p>
<pre><code class="language-text">2650
</code></pre>
<p>The computer didn't need to understand marketing. It simply followed the instructions.</p>
<p>This is the basic relationship between you and a programming language.</p>
<p>You provide instructions, and Python translates those instructions into operations the computer can perform.</p>
<h3 id="heading-breaking-problems-into-steps">Breaking Problems Into Steps</h3>
<p>One of the most important programming skills is learning to break a large problem into smaller steps.</p>
<p>Imagine a marketing manager asks: "Can you tell me which campaigns are performing poorly?"</p>
<p>That sounds simple, but it actually contains several smaller questions.</p>
<p>What does "poorly" mean?</p>
<p>Is it:</p>
<ul>
<li>Low revenue?</li>
<li>Low conversion rate?</li>
<li>High CPA?</li>
<li>Low ROAS?</li>
<li>Low engagement?</li>
<li>Low profit?</li>
</ul>
<p>You'll need to know what data you need, where that data is stored, how you should clean it, how to calculate the relevant metrics, and what threshold should determine whether a campaign is considered weak.</p>
<p>Once you break the problem apart, the programming becomes much easier.</p>
<p>For example:</p>
<pre><code class="language-text">Load campaign data.
Clean the data.
Calculate ROAS.
Calculate conversion rate.
Filter campaigns below the chosen thresholds.
Display the results.
</code></pre>
<p>Python can then turn those steps into code.</p>
<p>This way of thinking is called decomposition. You'll use it constantly throughout this book.</p>
<h3 id="heading-chapter-1-learning-and-implementing-the-basics">Chapter 1: Learning and Implementing the Basics</h3>
<h4 id="heading-variables">Variables</h4>
<p>Variables allow you to store information under a name.</p>
<pre><code class="language-python">campaign = "Back to School"
budget = 5000
clicks = 1250
conversions = 84
</code></pre>
<p>Now Python knows that:</p>
<ul>
<li><code>campaign</code> contains text.</li>
<li><code>budget</code> contains a number.</li>
<li><code>clicks</code> contains a number.</li>
<li><code>conversions</code> contains a number.</li>
</ul>
<p>You can use those variables later.</p>
<pre><code class="language-python">print(campaign)
print(budget)
print(clicks)
print(conversions)
</code></pre>
<p>You can also change their values.</p>
<pre><code class="language-python">budget = 5000

budget = 7500

print(budget)
</code></pre>
<p>The final value is:</p>
<pre><code class="language-text">7500
</code></pre>
<p>Variables are useful because marketing programs constantly work with changing values.</p>
<p>Today's revenue is different from yesterday's revenue. This month's advertising budget is different from last month's. A customer's order count changes as they make purchases. And a campaign's performance changes over time.</p>
<p>Variables allow your program to represent those values.</p>
<h4 id="heading-naming-variables-clearly">Naming Variables Clearly</h4>
<p>You could technically write:</p>
<pre><code class="language-python">x = 5000
</code></pre>
<p>But what does <code>x</code> mean? You would have to look elsewhere to find out.</p>
<p>A better approach is:</p>
<pre><code class="language-python">campaign_budget = 5000
</code></pre>
<p>The name immediately communicates its purpose.</p>
<p>Similarly:</p>
<pre><code class="language-python">total_revenue = 25000
total_cost = 8000
total_conversions = 450
</code></pre>
<p>Clear variable names make your code easier to understand. This becomes increasingly important as your programs grow.</p>
<h4 id="heading-strings">Strings</h4>
<p>Strings represent text.</p>
<pre><code class="language-python">campaign_name = "Holiday Sale"
channel = "Email"
customer_name = "Ava"
</code></pre>
<p>You can combine strings, for example:</p>
<pre><code class="language-python">message = "Welcome, " + customer_name

print(message)
</code></pre>
<p>The result is:</p>
<pre><code class="language-text">Welcome, Ava
</code></pre>
<p>But f-strings are usually easier to read.</p>
<pre><code class="language-python">message = f"Welcome, {customer_name}"

print(message)
</code></pre>
<p>You can include multiple variables:</p>
<pre><code class="language-python">customer_name = "Ava"
discount = 20

message = (
    f"Hi {customer_name}, "
    f"you have a {discount}% discount."
)

print(message)
</code></pre>
<p>This becomes particularly useful when generating personalized marketing messages.</p>
<h4 id="heading-numbers">Numbers</h4>
<p>Python supports integers and floating-point numbers.</p>
<p>An integer is a whole number:</p>
<pre><code class="language-python">customers = 1500
</code></pre>
<p>A float contains a decimal:</p>
<pre><code class="language-python">conversion_rate = 4.75
</code></pre>
<p>You can perform mathematical operations:</p>
<pre><code class="language-python">revenue = 15000
cost = 5000

profit = revenue - cost

print(profit)
</code></pre>
<p>You can multiply:</p>
<pre><code class="language-python">average_order_value = 75
orders = 120

revenue = average_order_value * orders

print(revenue)
</code></pre>
<p>And divide:</p>
<pre><code class="language-python">revenue = 12000
orders = 150

average_order_value = revenue / orders

print(average_order_value)
</code></pre>
<p>These basic operations form the foundation for many marketing metrics.</p>
<h4 id="heading-percentages">Percentages</h4>
<p>Marketing analytics uses percentages everywhere.</p>
<p>Suppose 500 people clicked an advertisement out of 10,000 impressions.</p>
<p>The click-through rate is:</p>
<pre><code class="language-python">clicks = 500
impressions = 10000

ctr = clicks / impressions * 100

print(ctr)
</code></pre>
<p>The result is:</p>
<pre><code class="language-text">5.0
</code></pre>
<p>You could format it like this:</p>
<pre><code class="language-python">print(f"CTR: {ctr:.2f}%")
</code></pre>
<p>The <code>.2f</code> tells Python to display two decimal places.</p>
<h4 id="heading-boolean-values">Boolean Values</h4>
<p>Boolean values represent two states:</p>
<pre><code class="language-python">True
False
</code></pre>
<p>For example:</p>
<pre><code class="language-python">campaign_active = True
</code></pre>
<p>You can use Booleans with conditions.</p>
<pre><code class="language-python">campaign_active = True

if campaign_active:
    print("Campaign is currently running.")
</code></pre>
<p>Booleans become particularly useful when your program needs to make decisions.</p>
<h4 id="heading-comparison-operators">Comparison Operators</h4>
<p>In marketing, one metric you'll often compare is <strong>return on ad spend (ROAS)</strong>. ROAS measures the revenue attributed to advertising relative to the amount spent on that advertising:</p>
<p><strong>ROAS = Revenue Attributed to Ads ÷ Advertising Cost</strong></p>
<p>For example, if a campaign generates $4,000 in attributed revenue from $1,000 in ad spend, its ROAS is 4.0, often described as 4:1: the campaign generated $4 in revenue for every $1 spent on ads.</p>
<p>ROAS isn't the same as profit because it doesn't automatically subtract product costs, agency fees, or other business expenses. The right target depends on the company's margins and goals.</p>
<p>Using Python, you can compare the values of ROAS using this simple line of code:</p>
<pre><code class="language-python">roas = 4.2

print(roas &gt; 3)
</code></pre>
<p>The result is:</p>
<pre><code class="language-text">True
</code></pre>
<p>Other comparisons include:</p>
<pre><code class="language-python">roas == 3
roas != 3
roas &gt;= 3
roas &lt;= 3
</code></pre>
<p>These comparisons allow you to build rules.</p>
<pre><code class="language-python">if roas &gt;= 3:
    print("Campaign is performing well.")
</code></pre>
<h4 id="heading-combining-conditions">Combining Conditions</h4>
<p>Marketing decisions often involve multiple conditions.</p>
<p>Suppose a campaign is considered promising when both ROAS is above 3 and conversion rate is above 4 percent.</p>
<pre><code class="language-python">roas = 3.8
conversion_rate = 5.2

if roas &gt;= 3 and conversion_rate &gt;= 4:
    print("Campaign meets performance criteria.")
</code></pre>
<p>The <code>and</code> operator requires both conditions to be true.</p>
<p>You can also use <code>or</code>:</p>
<pre><code class="language-python">if roas &gt;= 4 or conversion_rate &gt;= 6:
    print("Campaign has at least one strong performance signal.")
</code></pre>
<p>These simple logical operators become extremely useful when creating automated marketing rules.</p>
<h4 id="heading-lists">Lists</h4>
<p>A list stores multiple values.</p>
<pre><code class="language-python">channels = [
    "Email",
    "Search",
    "Social Media",
    "Display"
]
</code></pre>
<p>You can access an item using its position, like this:</p>
<pre><code class="language-python">print(channels[0])
</code></pre>
<p>The result is:</p>
<pre><code class="language-text">Email
</code></pre>
<p>Python uses zero-based indexing, meaning the first item is at position <code>0</code>.</p>
<p>You can add an item:</p>
<pre><code class="language-python">channels.append("Affiliate")
</code></pre>
<p>You can see how many items are in the list:</p>
<pre><code class="language-python">print(len(channels))
</code></pre>
<p>Lists are useful for storing collections of marketing information.</p>
<h4 id="heading-dictionaries">Dictionaries</h4>
<p>Dictionaries store information as key-value pairs.</p>
<pre><code class="language-python">campaign = {
    "name": "Holiday Sale",
    "channel": "Email",
    "budget": 5000,
    "conversions": 125
}
</code></pre>
<p>You can retrieve a value:</p>
<pre><code class="language-python">print(campaign["channel"])
</code></pre>
<p>You can also update a value:</p>
<pre><code class="language-python">campaign["budget"] = 7500
</code></pre>
<p>Dictionaries are particularly useful when representing a single customer, campaign, product, or marketing event.</p>
<p>For example:</p>
<pre><code class="language-python">customer = {
    "name": "Ava",
    "age": 24,
    "orders": 7,
    "total_spent": 850
}
</code></pre>
<p>You could access:</p>
<pre><code class="language-python">print(customer["total_spent"])
</code></pre>
<h4 id="heading-lists-of-dictionaries">Lists of Dictionaries</h4>
<p>Things become much more interesting when you combine lists and dictionaries.</p>
<pre><code class="language-python">campaigns = [
    {
        "name": "Spring Sale",
        "channel": "Email",
        "revenue": 8500
    },
    {
        "name": "Summer Sale",
        "channel": "Social Media",
        "revenue": 6200
    },
    {
        "name": "Holiday Sale",
        "channel": "Search",
        "revenue": 12000
    }
]
</code></pre>
<p>Now you have a simple representation of multiple campaigns.</p>
<p>You can loop through them:</p>
<pre><code class="language-python">for campaign in campaigns:
    print(campaign["name"])
</code></pre>
<p>This produces:</p>
<pre><code class="language-text">Spring Sale
Summer Sale
Holiday Sale
</code></pre>
<p>This is the beginning of working with collections of structured data.</p>
<h4 id="heading-loops">Loops</h4>
<p>A loop repeats an operation.</p>
<pre><code class="language-python">channels = [
    "Email",
    "Search",
    "Social Media",
    "Display"
]

for channel in channels:
    print(channel)
</code></pre>
<p>You could also perform calculations:</p>
<pre><code class="language-python">revenues = [5000, 7500, 9000, 6200]

for revenue in revenues:
    print(revenue * 0.1)
</code></pre>
<p>The loop processes each value.</p>
<p>Imagine having 10,000 customers. You wouldn't want to manually write the same operation 10,000 times.</p>
<p>A loop gives Python instructions for handling each record. Later in this book, you'll see how pandas can make this kind of work even more powerful and efficient.</p>
<h4 id="heading-conditional-logic-inside-loops">Conditional Logic Inside Loops</h4>
<p>You can combine loops and conditions.</p>
<pre><code class="language-python">campaigns = [
    {"name": "Spring Sale", "roas": 2.5},
    {"name": "Summer Sale", "roas": 4.8},
    {"name": "Holiday Sale", "roas": 1.2}
]

for campaign in campaigns:
    if campaign["roas"] &gt;= 3:
        print(
            f"{campaign['name']} is performing well."
        )
</code></pre>
<p>Only the campaigns meeting the condition are printed.</p>
<p>This is conceptually similar to filtering a marketing dataset.</p>
<h4 id="heading-functions">Functions</h4>
<p>Functions package reusable logic.</p>
<p>Suppose you repeatedly need to calculate ROAS. Instead of writing:</p>
<pre><code class="language-python">roas = revenue / cost
</code></pre>
<p>every time, create a function.</p>
<pre><code class="language-python">def calculate_roas(revenue, cost):
    return revenue / cost
</code></pre>
<p>Then:</p>
<pre><code class="language-python">roas = calculate_roas(
    15000,
    5000
)

print(roas)
</code></pre>
<p>You can reuse the same function:</p>
<pre><code class="language-python">campaign_one = calculate_roas(12000, 3000)
campaign_two = calculate_roas(8000, 4000)
campaign_three = calculate_roas(15000, 2500)
</code></pre>
<p>This is much cleaner.</p>
<h4 id="heading-adding-validation-to-functions">Adding Validation to Functions</h4>
<p>A good function should account for problematic inputs.</p>
<p>Consider:</p>
<pre><code class="language-python">def calculate_roas(revenue, cost):
    return revenue / cost
</code></pre>
<p>What happens if <code>cost</code> is zero?</p>
<p>Python will raise an error because division by zero is undefined.</p>
<p>A safer version is:</p>
<pre><code class="language-python">def calculate_roas(revenue, cost):
    if cost == 0:
        return None

    return revenue / cost
</code></pre>
<p>Now:</p>
<pre><code class="language-python">print(calculate_roas(10000, 0))
</code></pre>
<p>returns:</p>
<pre><code class="language-text">None
</code></pre>
<p>rather than crashing.</p>
<p>This idea of protecting your code from unexpected input becomes increasingly important when we begin working with real datasets.</p>
<h4 id="heading-returning-multiple-values">Returning Multiple Values</h4>
<p>A function can return multiple results.</p>
<pre><code class="language-python">def campaign_metrics(
    revenue,
    cost,
    clicks,
    conversions
):
    if cost == 0:
        roas = None
    else:
        roas = revenue / cost

    if clicks == 0:
        conversion_rate = None
    else:
        conversion_rate = (
            conversions / clicks * 100
        )

    return roas, conversion_rate
</code></pre>
<p>You can use it like this:</p>
<pre><code class="language-python">roas, conversion_rate = campaign_metrics(
    12000,
    4000,
    1000,
    80
)

print(roas)
print(conversion_rate)
</code></pre>
<p>Later, we'll replace or integrate functions like into reusable analytics modules.</p>
<h3 id="heading-chapter-2-libraries-in-python">Chapter 2: Libraries in Python</h3>
<h4 id="heading-importing-libraries">Importing Libraries</h4>
<p>Python's built-in functionality is useful, but marketing analytics requires additional tools.</p>
<p>Libraries provide pre-built functionality.</p>
<p>For example:</p>
<pre><code class="language-python">import pandas as pd
</code></pre>
<p>The <code>as pd</code> part gives pandas a shorter alias.</p>
<p>Now you can use:</p>
<pre><code class="language-python">pd.read_csv()
</code></pre>
<p>rather than:</p>
<pre><code class="language-python">pandas.read_csv()
</code></pre>
<p>You'll see this convention throughout data analysis projects.</p>
<p>NumPy is commonly imported as:</p>
<pre><code class="language-python">import numpy as np
</code></pre>
<p>Matplotlib's plotting module is commonly imported as:</p>
<pre><code class="language-python">import matplotlib.pyplot as plt
</code></pre>
<h4 id="heading-installing-libraries">Installing Libraries</h4>
<p>If a library isn't already installed, use pip.</p>
<pre><code class="language-bash">pip install pandas
</code></pre>
<p>For several libraries:</p>
<pre><code class="language-bash">pip install pandas numpy matplotlib scikit-learn requests openpyxl
</code></pre>
<p>The exact installation process can vary depending on your Python environment.</p>
<p>If you use a virtual environment, it's a good practice to install project dependencies inside that environment rather than globally.</p>
<h4 id="heading-virtual-environments">Virtual Environments</h4>
<p>Suppose one project requires one version of a library and another project requires a different version. Installing everything globally can create conflicts.</p>
<p>A virtual environment gives a project its own isolated Python environment.</p>
<p>You can create one like this:</p>
<pre><code class="language-bash">python -m venv marketing-env
</code></pre>
<p>And then activate it like this on Windows:</p>
<pre><code class="language-bash">marketing-env\Scripts\activate
</code></pre>
<p>Or like this on macOS or Linux:</p>
<pre><code class="language-bash">source marketing-env/bin/activate
</code></pre>
<p>Then install your packages:</p>
<pre><code class="language-bash">pip install pandas numpy matplotlib scikit-learn
</code></pre>
<p>You can save your dependencies:</p>
<pre><code class="language-bash">pip freeze &gt; requirements.txt
</code></pre>
<p>Another developer can then install them with:</p>
<pre><code class="language-bash">pip install -r requirements.txt
</code></pre>
<p>This becomes useful when you turn your capstone into a shareable project.</p>
<h2 id="heading-part-ii-working-with-marketing-data">Part II: Working With Marketing Data</h2>
<p>Marketing data rarely arrives in the exact format you want. That's one of the first realities you need to accept.</p>
<p>A spreadsheet might contain missing values, an exported report might have inconsistent capitalization, a CRM might use one customer ID format while an advertising platform uses another, dates might appear in different formats, or numbers might be stored as strings.</p>
<p>A dataset can look perfectly normal while containing subtle problems that produce incorrect analysis.</p>
<p>Before you calculate anything, understand what you're working with.</p>
<h3 id="heading-understanding-the-marketing-data-lifecycle">Understanding the Marketing Data Lifecycle</h3>
<p>A useful way to think about marketing analytics is as a lifecycle.</p>
<ol>
<li>Data is first collected.</li>
<li>Then it's stored.</li>
<li>Then it's cleaned.</li>
<li>Then it's transformed.</li>
<li>Then it's analyzed.</li>
<li>Then the findings are communicated.</li>
<li>Finally, someone uses those findings to make a decision.</li>
</ol>
<p>Python can participate in almost every stage.</p>
<p>For example, Python can retrieve information from an API, store it in a DataFrame, clean it with pandas, calculate KPIs, create visualizations, train a machine learning model, and export a report.</p>
<p>That's why Python becomes more valuable as your marketing workflow becomes more complex.</p>
<h3 id="heading-structured-and-unstructured-data">Structured and Unstructured Data</h3>
<p>Structured data is information organized into predictable fields.</p>
<p>A spreadsheet containing:</p>
<pre><code class="language-text">customer_id
date
campaign
channel
revenue
</code></pre>
<p>is structured data.</p>
<p>Each row represents a record, and each column represents a variable. This is the kind of data pandas handles particularly well.</p>
<p>Unstructured data is different. Examples include:</p>
<ul>
<li>Social media posts</li>
<li>Customer reviews</li>
<li>Email text</li>
<li>Survey responses</li>
<li>Images</li>
<li>Videos</li>
</ul>
<p>Python can also work with unstructured data, but that often requires additional techniques such as natural language processing or computer vision.</p>
<p>This book primarily focuses on structured marketing data because it provides a strong foundation for analytics, automation, and machine learning.</p>
<h3 id="heading-rows-and-columns">Rows and Columns</h3>
<p>Suppose your dataset contains:</p>
<pre><code class="language-text">customer_id | channel | clicks | conversions | revenue
101         | Email   | 500    | 40          | 3200
102         | Search  | 800    | 65          | 5100
103         | Social  | 300    | 18          | 1400
</code></pre>
<p>Each row represents an observation, while each column represents an attribute.</p>
<p>Understanding this distinction is important because many pandas operations operate either across rows, across columns, or across groups of rows.</p>
<h4 id="heading-the-unit-of-analysis">The Unit of Analysis</h4>
<p>One concept that deserves special attention is the unit of analysis.</p>
<p>Ask: <strong>What does one row represent?</strong> Does it represent:</p>
<ul>
<li>A customer?</li>
<li>A purchase?</li>
<li>A campaign?</li>
<li>An advertisement?</li>
<li>A website session?</li>
<li>An email?</li>
<li>A day?</li>
</ul>
<p>This matters enormously.</p>
<p>Imagine you have a dataset where every row represents a purchase. A customer who made ten purchases will appear ten times.</p>
<p>If you count rows and call that the number of customers, your analysis will be wrong.</p>
<p>You would instead need the number of unique customer IDs.</p>
<pre><code class="language-python">df["customer_id"].nunique()
</code></pre>
<p>The unit of analysis should always be understood before calculating metrics.</p>
<h3 id="heading-marketing-metrics-are-context-dependent">Marketing Metrics Are Context-Dependent</h3>
<p>Suppose Campaign A has a 10 percent conversion rate.</p>
<p>That sounds excellent, but what if it generated only ten visitors and one conversion?</p>
<p>Now suppose Campaign B has a 4 percent conversion rate but generated 100,000 visitors and 4,000 conversions.</p>
<p>The percentage alone doesn't tell the complete story.</p>
<p>This is why good marketing analytics considers other factors, like:</p>
<ul>
<li>Volume</li>
<li>Rate</li>
<li>Cost</li>
<li>Revenue</li>
<li>Profitability</li>
<li>Customer quality</li>
<li>Time period</li>
<li>Business objective</li>
</ul>
<p>A metric isn't an answer by itself. It's evidence.</p>
<h3 id="heading-chapter-3-working-with-csv-data">Chapter 3: Working With CSV Data</h3>
<p>CSV stands for Comma-Separated Values, and it's one of the simplest and most common ways of exchanging tabular data.</p>
<p>Suppose <code>campaigns.csv</code> contains:</p>
<pre><code class="language-text">campaign,channel,impressions,clicks,conversions,cost,revenue
Spring Sale,Email,10000,850,120,500,6000
Summer Sale,Social Media,25000,1100,75,1200,4200
Holiday Sale,Search,18000,1400,180,2000,9500
</code></pre>
<p>Load it:</p>
<pre><code class="language-python">import pandas as pd

df = pd.read_csv("campaigns.csv")
</code></pre>
<p>Inspect the first five rows:</p>
<pre><code class="language-python">df.head()
</code></pre>
<p>You can see more rows if you want:</p>
<pre><code class="language-python">df.head(10)
</code></pre>
<p>Or the last five:</p>
<pre><code class="language-python">df.tail()
</code></pre>
<h4 id="heading-understanding-dataframe-shape">Understanding DataFrame Shape</h4>
<p>Use:</p>
<pre><code class="language-python">df.shape
</code></pre>
<p>You might receive:</p>
<pre><code class="language-text">(1000, 8)
</code></pre>
<p>That means the DataFrame contains 1,000 rows and 8 columns.</p>
<p>This is one of the quickest ways to understand the size of your dataset.</p>
<h4 id="heading-viewing-column-names">Viewing Column Names</h4>
<pre><code class="language-python">df.columns
</code></pre>
<p>You might see:</p>
<pre><code class="language-text">Index([
    'campaign',
    'channel',
    'impressions',
    'clicks',
    'conversions',
    'cost',
    'revenue'
], dtype='object')
</code></pre>
<p>If you're writing reusable code, knowing the exact column names is important.</p>
<h4 id="heading-selecting-a-column">Selecting a Column</h4>
<p>Select one column:</p>
<pre><code class="language-python">df["revenue"]
</code></pre>
<p>Or select multiple columns:</p>
<pre><code class="language-python">df[
    [
        "campaign",
        "revenue",
        "cost"
    ]
]
</code></pre>
<p>This lets you create smaller views of your dataset.</p>
<h4 id="heading-selecting-rows">Selecting Rows</h4>
<p>You can select rows using conditions.</p>
<pre><code class="language-python">df[df["revenue"] &gt; 5000]
</code></pre>
<p>This returns campaigns where revenue is greater than $5,000.</p>
<p>You can combine conditions:</p>
<pre><code class="language-python">df[
    (df["revenue"] &gt; 5000) &amp;
    (df["cost"] &lt; 3000)
]
</code></pre>
<p>Parentheses are important when combining pandas conditions because each comparison needs to be evaluated as a complete condition before pandas combines the results. Operators such as <code>&amp;</code> and <code>|</code> have different precedence rules from Python's ordinary <code>and</code> and <code>or</code>, so leaving out parentheses can cause an error or an unintended expression.</p>
<p>Put each condition in its own parentheses, and use <code>&amp;</code> for AND and <code>|</code> for OR when filtering a DataFrame.</p>
<p>For example:</p>
<pre><code class="language-python"># Select campaigns with more than 1,000 clicks
# and a conversion rate above 2%
filtered_campaigns = df[
    (df["clicks"] &gt; 1000) &amp;
    (df["conversion_rate"] &gt; 0.02)
]
</code></pre>
<p>Here, both conditions must be true for a row to be included in <code>filtered_campaigns</code>.Sorting Data</p>
<p>Sort by revenue:</p>
<pre><code class="language-python">df.sort_values(
    "revenue",
    ascending=False
)
</code></pre>
<p>This places the highest-revenue campaigns first.</p>
<p>Sort by cost:</p>
<pre><code class="language-python">df.sort_values(
    "cost",
    ascending=True
)
</code></pre>
<p>You can sort by multiple columns:</p>
<pre><code class="language-python">df.sort_values(
    ["channel", "revenue"],
    ascending=[True, False]
)
</code></pre>
<p>This first groups the results by channel and then orders revenue within each channel.</p>
<h3 id="heading-chapter-4-working-with-excel">Chapter 4: Working With Excel</h3>
<p>Many marketing departments still rely heavily on Excel.</p>
<p>Fortunately, pandas makes it relatively easy to work with Excel files.</p>
<pre><code class="language-python">df = pd.read_excel(
    "marketing_data.xlsx"
)
</code></pre>
<p>You can specify a worksheet:</p>
<pre><code class="language-python">df = pd.read_excel(
    "marketing_data.xlsx",
    sheet_name="Campaigns"
)
</code></pre>
<p>You can inspect available sheets using:</p>
<pre><code class="language-python">excel_file = pd.ExcelFile(
    "marketing_data.xlsx"
)

print(excel_file.sheet_names)
</code></pre>
<p>This is useful when working with large workbooks.</p>
<h4 id="heading-exporting-data-to-excel">Exporting Data to Excel</h4>
<p>You can export a DataFrame:</p>
<pre><code class="language-python">df.to_excel(
    "marketing_report.xlsx",
    index=False
)
</code></pre>
<p>You can create multiple worksheets:</p>
<pre><code class="language-python">with pd.ExcelWriter(
    "marketing_report.xlsx"
) as writer:

    df.to_excel(
        writer,
        sheet_name="Data",
        index=False
    )

    channel_summary.to_excel(
        writer,
        sheet_name="Channels"
    )
</code></pre>
<p>This capability will become important in the capstone because the final system will produce a structured marketing report.</p>
<h3 id="heading-chapter-5-dates-and-time">Chapter 5: Dates and Time</h3>
<p>Marketing performance is highly dependent on time.</p>
<p>A campaign that generated $20,000 in revenue over six months is very different from one that generated $20,000 in revenue over two days.</p>
<p>Start by converting date columns:</p>
<pre><code class="language-python">df["date"] = pd.to_datetime(
    df["date"]
)
</code></pre>
<p>Now you can extract components.</p>
<pre><code class="language-python">df["year"] = df["date"].dt.year
df["month"] = df["date"].dt.month
df["day"] = df["date"].dt.day
</code></pre>
<p>You can extract the month name:</p>
<pre><code class="language-python">df["month_name"] = (
    df["date"]
    .dt.month_name()
)
</code></pre>
<p>And weekday:</p>
<pre><code class="language-python">df["weekday"] = (
    df["date"]
    .dt.day_name()
)
</code></pre>
<h4 id="heading-time-based-marketing-questions">Time-Based Marketing Questions</h4>
<p>Once dates are properly formatted, you can answer questions such as:</p>
<ul>
<li>Which month generated the most revenue?</li>
<li>Which weekday has the highest conversion rate?</li>
<li>Did campaign performance improve after a specific change?</li>
<li>Is there seasonal behavior?</li>
<li>Are customer purchases becoming less frequent?</li>
</ul>
<p>For example:</p>
<pre><code class="language-python">monthly_revenue = (
    df.groupby(
        df["date"].dt.to_period("M")
    )["revenue"]
    .sum()
)
</code></pre>
<p>This produces monthly revenue totals.</p>
<h3 id="heading-chapter-6-working-with-marketing-apis">Chapter 6: Working With Marketing APIs</h3>
<p>A file is useful when someone manually exports data. But what if you want your marketing intelligence system to collect data automatically?</p>
<p>This is where APIs become important.</p>
<p>An API, or Application Programming Interface, provides a structured way for one program to communicate with another.</p>
<p>For example, a platform might expose an endpoint that returns campaign information.</p>
<p>Python can send a request:</p>
<pre><code class="language-python">import requests

response = requests.get(
    "https://example.com/api/campaigns"
)

print(response.status_code)
</code></pre>
<p>A successful response commonly has a status code such as:</p>
<pre><code class="language-text">200
</code></pre>
<p>You can inspect the response body:</p>
<pre><code class="language-python">print(response.text)
</code></pre>
<p>If the response contains JSON:</p>
<pre><code class="language-python">data = response.json()
</code></pre>
<p>You can inspect it:</p>
<pre><code class="language-python">print(data)
</code></pre>
<h4 id="heading-api-authentication">API Authentication</h4>
<p>Real APIs often require authentication.</p>
<p>For example:</p>
<pre><code class="language-python">api_key = "your-api-key"
</code></pre>
<p>But you should <strong>not</strong> place actual secret keys directly inside code that you intend to share publicly.</p>
<p>Instead, use environment variables.</p>
<pre><code class="language-python">import os

api_key = os.getenv(
    "MARKETING_API_KEY"
)
</code></pre>
<p>You can then construct headers:</p>
<pre><code class="language-python">headers = {
    "Authorization": f"Bearer {api_key}"
}
</code></pre>
<p>And make the request:</p>
<pre><code class="language-python">response = requests.get(
    "https://example.com/api/campaigns",
    headers=headers
)
</code></pre>
<p>The exact authentication system depends on the API.</p>
<h4 id="heading-api-errors">API Errors</h4>
<p>Your program shouldn't assume that every request succeeds.</p>
<pre><code class="language-python">response = requests.get(
    api_url,
    timeout=30
)

if response.status_code == 200:
    data = response.json()
else:
    print(
        f"Request failed: "
        f"{response.status_code}"
    )
</code></pre>
<p>When you send an API request, receiving a response doesn't necessarily mean the request succeeded. The server might return an error status, such as <code>404 Not Found</code> or <code>500 Internal Server Error</code>.</p>
<p>The <code>raise_for_status()</code> method checks the HTTP response status. If the response indicates an unsuccessful request, it raises an exception instead of allowing your program to continue as if everything worked.</p>
<p>A <code>try</code> block lets you handle that exception:</p>
<pre><code class="language-python">import requests

try:
    response = requests.get(
        "https://example.com/api/campaigns",
        timeout=30
    )
    response.raise_for_status()
    campaigns = response.json()

except requests.exceptions.RequestException as error:
    print(f"Could not retrieve campaign data: {error}")
</code></pre>
<p>Here, <code>requests.get()</code> sends the request, <code>timeout=30</code> prevents the program from waiting indefinitely, and <code>raise_for_status()</code> raises an exception for an unsuccessful HTTP response. The <code>except</code> block catches request-related errors and displays a message.</p>
<p>In a production workflow, you should also log the error and decide whether the process should retry, skip the failed source, or stop report generation. Avoid silently treating a failed request as an empty dataset because that could produce misleading marketing reports.</p>
<p>This becomes especially important when your system runs automatically. If an API goes down at 3 AM, you want the program to report the problem rather than silently producing an empty marketing report.</p>
<h4 id="heading-api-pagination">API Pagination</h4>
<p>Some APIs return only a limited number of records per request. If an account contains thousands of campaign records, for example, the API might return the first 100 and provide a link or token for retrieving the next group. This process is called <strong>pagination</strong>.</p>
<p>The pagination method depends on the API. Some services use page numbers, others use offsets, and some provide a continuation token or a URL for the next page. Always check the API's documentation before implementing pagination.</p>
<p>The following example demonstrates an API that returns a <code>results</code> list and a <code>next</code> URL:</p>
<pre><code class="language-python">import requests

def fetch_all_campaigns(api_url, headers):
    all_campaigns = []
    next_url = api_url

    while next_url:
        response = requests.get(
            next_url,
            headers=headers,
            timeout=30
        )
        response.raise_for_status()
        payload = response.json()

        all_campaigns.extend(payload["results"])
        next_url = payload.get("next")

    return all_campaigns
</code></pre>
<p>The function starts with the initial API URL and continues requesting pages while <code>next_url</code> contains a URL. The <code>extend()</code> method adds the records from each page to the same list. When the API returns no next-page URL, the loop stops.</p>
<p>This is an illustrative pattern, not a universal solution. Your API might use different field names or require a different pagination method. For a real integration, follow the service's documentation and consider safeguards such as retry limits and maximum page counts.</p>
<h4 id="heading-api-rate-limits">API Rate Limits</h4>
<p>APIs often limit how many requests a client can make within a particular period. These restrictions are called <strong>rate limits</strong>. For example, a service might allow only a certain number of requests per minute.</p>
<p>If your marketing automation script sends too many requests, the API may return an HTTP <code>429 Too Many Requests</code> response. Instead of repeatedly sending requests immediately, your program should pause and try again according to the service's rules.</p>
<p>Some APIs provide a <code>Retry-After</code> response header that indicates how long the client should wait. Here's a simplified example:</p>
<pre><code class="language-python">import time
import requests

def get_with_rate_limit(url, headers, max_retries=5):
    for attempt in range(max_retries):
        response = requests.get(
            url,
            headers=headers,
            timeout=30
        )

        if response.status_code == 429:
            retry_after = response.headers.get(
                "Retry-After", "2"
            )
            time.sleep(float(retry_after))
            continue

        response.raise_for_status()
        return response

    raise RuntimeError(
        "API request failed after repeated rate-limit responses."
    )
</code></pre>
<p>This function retries a limited number of times when the API returns a <code>429</code> response. If the response includes a <code>Retry-After</code> header, the function uses that value to determine how long to wait. If the header is absent, it waits for two seconds.</p>
<p>This is a starting point rather than a complete production retry system. Some APIs use different retry rules, and production systems should also consider temporary server errors, logging, exponential backoff, and safeguards against excessive retries. Always follow the API provider's documentation.</p>
<p>Rate-limit handling is particularly important when automating reports across multiple campaigns or accounts. Respecting these limits makes your integration more reliable and reduces the chance of interrupted data collection.</p>
<h2 id="heading-part-iii-data-cleaning-and-analysis-with-pandas">Part III: Data Cleaning and Analysis with Pandas</h2>
<p>The first rule of marketing analytics should be simple: <strong>Don't trust your dataset until you've inspected it.</strong></p>
<p>That doesn't mean your data is bad. It just means you should verify it before analyzing it and making decisions based off of it.</p>
<p>A dataset can contain millions of perfectly formatted rows and still represent the wrong thing.</p>
<h3 id="heading-chapter-7-inspecting-data-quality">Chapter 7: Inspecting Data Quality</h3>
<p>Start with:</p>
<pre><code class="language-python">df.info()
</code></pre>
<p>This provides information about:</p>
<ul>
<li>Number of rows</li>
<li>Column names</li>
<li>Missing values</li>
<li>Data types</li>
<li>Memory usage</li>
</ul>
<p>You can also use:</p>
<pre><code class="language-python">df.describe()
</code></pre>
<p>This gives statistical information for numerical columns.</p>
<p>For example, you might discover that:</p>
<pre><code class="language-text">revenue
count    1000
mean     5820
min      -250
max      85000
</code></pre>
<p>The negative minimum should immediately make you investigate.</p>
<p>A negative revenue value might be legitimate if it represents a refund, or it could indicate a data-entry error.</p>
<p>The number alone doesn't tell you which.</p>
<h4 id="heading-missing-values">Missing Values</h4>
<p>Check for missing values with:</p>
<pre><code class="language-python">df.isnull().sum()
</code></pre>
<p>You might see:</p>
<pre><code class="language-text">customer_id       0
campaign          3
channel           0
revenue          12
cost              4
</code></pre>
<p>Now you know exactly where missing information exists.</p>
<h4 id="heading-why-missing-data-matters">Why Missing Data Matters</h4>
<p>Suppose you calculate average revenue:</p>
<pre><code class="language-python">df["revenue"].mean()
</code></pre>
<p>pandas generally excludes missing values from the calculation.</p>
<p>That may be convenient, but you still need to understand why the values are missing.</p>
<p>If the missing values are random, one approach may work. If all missing revenue values come from one specific sales channel, simply ignoring them could bias your conclusions.</p>
<p>Missing data isn't merely a technical problem. It can change the conclusions you draw from your marketing analysis.</p>
<p>Imagine that several campaign records have no revenue value. If you replace every missing value with zero, you're assuming those campaigns generated no revenue. But a missing value could mean that revenue tracking failed, the data hasn't arrived yet, or the purchase information is stored somewhere else.</p>
<p>Those situations aren't equivalent.</p>
<p>Before filling or removing missing values, ask yourself:</p>
<ul>
<li>Why is the value missing?</li>
<li>Does a missing value genuinely mean zero, or is the information unknown?</li>
<li>How many records are affected?</li>
<li>Could removing those records bias the analysis?</li>
</ul>
<p>For example, filling missing advertising costs with zero could cause a campaign's return on ad spend to become misleading or undefined. Similarly, removing every row with a missing customer attribute could exclude an important group of customers from your analysis.</p>
<p>Use <code>fillna()</code> or <code>dropna()</code> only after deciding what the missing values mean in the context of your dataset. Document important assumptions so that other people can understand how the results were produced.</p>
<h4 id="heading-duplicate-records">Duplicate Records</h4>
<p>Check duplicates like this:</p>
<pre><code class="language-python">df.duplicated().sum()
</code></pre>
<p>If the result is 25, you have 25 rows that are exact duplicates.</p>
<p>You can remove them like this:</p>
<pre><code class="language-python">df = df.drop_duplicates()
</code></pre>
<p>But remember the unit of analysis.</p>
<p>Two rows with the same customer ID aren't necessarily duplicates, as a customer can make multiple purchases.</p>
<p>Two rows with the same campaign name aren't necessarily duplicates, as a campaign may have data recorded across multiple days.</p>
<p>Never delete records merely because they share one or two values. Always check those values first.</p>
<h3 id="heading-chapter-8-cleaning-text-data">Chapter 8: Cleaning Text Data</h3>
<p>Marketing datasets often contain inconsistent text.</p>
<p>You may find:</p>
<pre><code class="language-text">Email
email
EMAIL
Email Marketing
</code></pre>
<p>Python treats these as different values.</p>
<p>Start by standardizing case:</p>
<pre><code class="language-python">df["channel"] = (
    df["channel"]
    .str.lower()
)
</code></pre>
<p>Then remove unnecessary whitespace:</p>
<pre><code class="language-python">df["channel"] = (
    df["channel"]
    .str.strip()
)
</code></pre>
<p>Now this:</p>
<pre><code class="language-text">Email
email
EMAIL
</code></pre>
<p>will all become standardized to this:</p>
<pre><code class="language-text">email
</code></pre>
<p>You can also standardize specific labels:</p>
<pre><code class="language-python">df["channel"] = df["channel"].replace({
    "email marketing": "email",
    "paid social": "social media",
    "social": "social media"
})
</code></pre>
<h4 id="heading-why-standardization-matters">Why Standardization Matters</h4>
<p>Imagine you calculate revenue by channel before cleaning the data.</p>
<p>You might get:</p>
<pre><code class="language-text">email            $20,000
Email            $15,000
EMAIL             $8,000
</code></pre>
<p>The business may actually have generated $43,000 from one channel, but if you haven't standardized, your analysis would incorrectly treat those as separate channels.</p>
<p>This is a small example of how data quality can affect business decisions.</p>
<h3 id="heading-chapter-9-cleaning-numeric-data">Chapter 9: Cleaning Numeric Data</h3>
<p>Numbers sometimes arrive in a dataset as text instead of as numerical values. This is especially common when working with marketing reports exported from spreadsheets, advertising platforms, or customer relationship management (CRM) systems.</p>
<p>For example, a revenue column might contain these values:</p>
<pre><code class="language-python">"$5,000"
"$7,500"
"$2,300"
</code></pre>
<p>Although these values represent money, Python may store them as strings because they contain characters such as dollar signs and commas. A string is a sequence of characters, not a number that Python can directly use in mathematical calculations.</p>
<p>For example, Python can't reliably calculate a total or average from strings containing currency symbols. Before calculating marketing metrics, you need to clean these values and convert them into an appropriate numeric type.</p>
<h4 id="heading-removing-currency-symbols-and-separators">Removing Currency Symbols and Separators</h4>
<p>The first step is to remove characters that prevent Python from interpreting the values as numbers.</p>
<pre><code class="language-python">df["revenue"] = (
    df["revenue"]
    .str.replace("$", "", regex=False)
    .str.replace(",", "", regex=False)
)
</code></pre>
<p>Here, “remove symbols” means removing formatting characters such as <code>$</code> and <code>,</code> from the text. The code transforms <code>"$5,000"</code> into <code>"5000"</code>. Notice that the result is still a string. Cleaning the text doesn't automatically turn it into a numeric value.</p>
<h4 id="heading-converting-the-cleaned-values-into-numbers">Converting the Cleaned Values Into Numbers</h4>
<p>After removing the formatting characters, convert the cleaned strings into numeric values:</p>
<pre><code class="language-python">df["revenue"] = pd.to_numeric(
    df["revenue"],
    errors="coerce"
)
</code></pre>
<p>In this example, <strong>convert</strong> means changing the cleaned text into a numeric data type that Python can use for addition, subtraction, multiplication, division, and statistical calculations.</p>
<p>The <code>errors="coerce"</code> argument tells pandas to replace values it can't interpret as numbers with <code>NaN</code>, which represents a missing or unavailable numeric value. This prevents invalid text from silently being treated as a valid number, but it also means you should investigate any values that become <code>NaN</code>.</p>
<p>You can identify the affected records like this:</p>
<pre><code class="language-python">df[df["revenue"].isna()]
</code></pre>
<p>If the original column might contain missing values, save a copy before cleaning so you can distinguish values that were already missing from values that became invalid during conversion.</p>
<pre><code class="language-python">original_revenue = df["revenue"].copy()

cleaned_revenue = (
    original_revenue
    .str.replace("$", "", regex=False)
    .str.replace(",", "", regex=False)
)

numeric_revenue = pd.to_numeric(
    cleaned_revenue,
    errors="coerce"
)

invalid_revenue = (
    cleaned_revenue.notna()
    &amp; numeric_revenue.isna()
)

df["revenue"] = numeric_revenue

print(df.loc[invalid_revenue, "revenue"])
</code></pre>
<p>For more detailed investigations, keep the original values in a separate column before replacing them.</p>
<h4 id="heading-checking-for-invalid-values">Checking for Invalid Values</h4>
<p>Converting text into numbers doesn't guarantee that the resulting values make sense. A dataset might contain negative conversion rates or unusually large percentages.</p>
<p>For example:</p>
<pre><code class="language-text">conversion_rate
5.2
4.8
-17
250
</code></pre>
<p>A conversion rate of <code>250%</code> is suspicious if the metric represents conversions divided by clicks and each click can produce no more than one conversion. But it might be valid under a different definition, such as when the metric counts multiple conversion events per click. A negative conversion rate would generally require investigation.</p>
<p>You can find values outside the usual range for a conventional conversion rate with:</p>
<pre><code class="language-python">df[
    (df["conversion_rate"] &lt; 0)
    | (df["conversion_rate"] &gt; 100)
]
</code></pre>
<p>This code identifies records for review. It doesn't automatically determine whether they're errors. Check the metric definition, source data, and business context before correcting or removing any records.</p>
<p>So remember: clean formatting characters, convert the cleaned values into the correct data type, and validate the results before using them in marketing calculations.</p>
<h3 id="heading-chapter-10-creating-marketing-metrics-with-pandas">Chapter 10: Creating Marketing Metrics With pandas</h3>
<p>Raw marketing data tells you what happened, but calculated metrics help you evaluate performance. With pandas, you can create new columns that measure how efficiently campaigns turn impressions into clicks, clicks into conversions, and advertising spending into revenue.</p>
<p>Before calculating these metrics, make sure the columns contain numeric values and that the data uses consistent units.</p>
<h4 id="heading-calculating-common-marketing-metrics">Calculating Common Marketing Metrics</h4>
<p><strong>Click-through rate (CTR)</strong> measures the percentage of impressions that resulted in clicks.</p>
<pre><code class="language-python">df["ctr"] = (
    df["clicks"]
    .div(df["impressions"])
    .mul(100)
)
</code></pre>
<p><strong>Conversion rate</strong> measures the percentage of clicks that resulted in conversions.</p>
<pre><code class="language-python">df["conversion_rate"] = (
    df["conversions"]
    .div(df["clicks"])
    .mul(100)
)
</code></pre>
<p><strong>Cost per click (CPC)</strong> measures the average advertising cost for each click.</p>
<pre><code class="language-python">df["cpc"] = (
    df["cost"]
    .div(df["clicks"])
)
</code></pre>
<p><strong>Cost per acquisition (CPA)</strong> measures the average cost of generating a conversion or acquisition, depending on how the business defines an acquisition.</p>
<pre><code class="language-python">df["cpa"] = (
    df["cost"]
    .div(df["conversions"])
)
</code></pre>
<p><strong>Return on advertising spend (ROAS)</strong> measures the revenue attributed to advertising relative to the advertising cost.</p>
<p>You can calculate ROAS in pandas like this (as we covered before):</p>
<pre><code class="language-python">df["roas"] = (
    df["revenue"]
    .div(df["cost"])
)
</code></pre>
<p>The correct interpretation of each metric depends on the definitions used in your dataset. For example, a conversion might represent a purchase, a signup, a qualified lead, or another desired action.</p>
<h4 id="heading-protecting-against-zero-values">Protecting Against Zero Values</h4>
<p>Marketing datasets can contain campaigns with zero clicks, zero conversions, or zero advertising cost. These values require careful handling because division by zero is undefined.</p>
<p>Consider this calculation:</p>
<pre><code class="language-python">df["conversion_rate"] = (
    df["conversions"]
    .div(df["clicks"])
    .mul(100)
)
</code></pre>
<p>If a campaign has zero clicks, the conversion-rate calculation has a denominator of zero. That means there's no valid click-based rate to calculate for that campaign. Similarly, CPA can't be calculated when there are zero conversions, and ROAS can't be calculated when advertising cost is zero.</p>
<p>A safer approach is to replace zero denominators with missing values before performing the division:</p>
<pre><code class="language-python">df["conversion_rate"] = (
    df["conversions"]
    .div(df["clicks"].replace(0, float("nan")))
    .mul(100)
)

df["cpa"] = (
    df["cost"]
    .div(df["conversions"].replace(0, float("nan")))
)

df["roas"] = (
    df["revenue"]
    .div(df["cost"].replace(0, float("nan")))
)
</code></pre>
<p>This approach is safer because it avoids presenting an undefined calculation as a meaningful result. When clicks are zero, the conversion rate becomes missing rather than being reported as a valid percentage. When conversions are zero, CPA is unavailable rather than a finite cost per acquisition. When cost is zero, ROAS is unavailable rather than being treated as a valid ratio.</p>
<p>A missing value doesn't mean the metric is zero. For example:</p>
<ul>
<li><strong>Zero conversions with 100 clicks:</strong> the conversion rate is 0%.</li>
<li><strong>Zero clicks:</strong> the click-based conversion rate can't be calculated.</li>
<li><strong>Zero advertising cost:</strong> ROAS can't be calculated using revenue divided by cost.</li>
</ul>
<p>These situations have different business meanings and shouldn't be treated as interchangeable.</p>
<p>You can check which records have unavailable metrics:</p>
<pre><code class="language-python">df[
    df[
        ["conversion_rate", "cpa", "roas"]
    ].isna().any(axis=1)
]
</code></pre>
<p>Investigate these records before using the metrics in reports or making campaign decisions.</p>
<h4 id="heading-interpreting-the-results">Interpreting the Results</h4>
<p>Creating metrics is only the beginning. A high CTR doesn't necessarily mean a campaign generates valuable customers, and a high ROAS doesn't automatically mean the campaign is profitable.</p>
<p>Use multiple metrics together. CTR can help evaluate engagement, conversion rate can help evaluate how effectively clicks lead to the desired action, CPA can help evaluate acquisition efficiency, and ROAS can help evaluate attributed revenue relative to advertising cost.</p>
<p>The goal isn't just maximizing every metric independently. You want to understand how the metrics work together and whether they support the business objective.</p>
<h3 id="heading-chapter-11-filtering-data">Chapter 11: Filtering Data</h3>
<p>Filtering allows you to ask targeted questions. You could specifically search for:</p>
<p>Campaigns with ROAS above 3:</p>
<pre><code class="language-python">high_roas = df[
    df["roas"] &gt; 3
]
</code></pre>
<p>Campaigns with high conversion rates:</p>
<pre><code class="language-python">high_conversion = df[
    df["conversion_rate"] &gt; 5
]
</code></pre>
<p>Campaigns that satisfy both:</p>
<pre><code class="language-python">strong_campaigns = df[
    (df["roas"] &gt; 3) &amp;
    (df["conversion_rate"] &gt; 5)
]
</code></pre>
<p>Campaigns that satisfy either:</p>
<pre><code class="language-python">promising_campaigns = df[
    (df["roas"] &gt; 4) |
    (df["conversion_rate"] &gt; 7)
]
</code></pre>
<h4 id="heading-filtering-by-text">Filtering by Text</h4>
<p>Email campaigns:</p>
<pre><code class="language-python">email = df[
    df["channel"] == "email"
]
</code></pre>
<p>You can search for text:</p>
<pre><code class="language-python">holiday = df[
    df["campaign"]
    .str.contains(
        "holiday",
        case=False,
        na=False
    )
]
</code></pre>
<p>This is useful when campaign names follow patterns.</p>
<h3 id="heading-chapter-12-groupby-the-core-of-marketing-analysis">Chapter 12: GroupBy, The Core of Marketing Analysis</h3>
<p>One of the most useful pandas operations for marketing analytics is <code>groupby()</code>. It allows you to organize rows into groups that share a value and calculate summaries for each group.</p>
<p>Imagine that your dataset contains campaign results from several marketing channels, including email, search, social media, and display advertising. Looking at every campaign separately can make it difficult to understand which channels contribute the most revenue or generate the most conversions.</p>
<p>With <code>groupby()</code>, you can combine the campaign records by channel and calculate metrics for each channel.</p>
<h4 id="heading-grouping-campaigns-by-channel">Grouping Campaigns by Channel</h4>
<p>Suppose your dataset contains a column named <code>channel</code> and another named <code>revenue</code>. You can calculate total revenue for each channel:</p>
<pre><code class="language-python">channel_revenue = (
    df.groupby("channel")["revenue"]
    .sum()
)

print(channel_revenue)
</code></pre>
<p>The code groups all rows with the same channel name, selects the revenue column, and adds the revenue values within each group.</p>
<p>You can use the same approach to calculate average revenue:</p>
<pre><code class="language-python">channel_average = (
    df.groupby("channel")["revenue"]
    .mean()
)
</code></pre>
<p>Count the number of campaign records in each channel:</p>
<pre><code class="language-python">campaign_count = (
    df.groupby("channel")
    .size()
)
</code></pre>
<p>Or calculate total conversions:</p>
<pre><code class="language-python">channel_conversions = (
    df.groupby("channel")["conversions"]
    .sum()
)
</code></pre>
<p>Each result answers a different question. Total revenue measures the revenue associated with a channel, average revenue describes the average revenue per record, campaign count indicates how many records are present, and total conversions measures the number of conversions attributed to the channel.</p>
<h4 id="heading-creating-a-complete-marketing-report">Creating a Complete Marketing Report</h4>
<p>Marketing decisions usually require more than one metric. Instead of calculating each summary separately, you can use <code>agg()</code> to calculate multiple totals in one operation.</p>
<pre><code class="language-python">channel_summary = (
    df.groupby("channel")
    .agg({
        "impressions": "sum",
        "clicks": "sum",
        "conversions": "sum",
        "cost": "sum",
        "revenue": "sum"
    })
)
</code></pre>
<p>This creates a table with one row per channel and a column for each total. You can then calculate ROAS and CPA using those totals:</p>
<pre><code class="language-python">channel_summary["roas"] = (
    channel_summary["revenue"]
    .div(channel_summary["cost"].replace(0, float("nan")))
)

channel_summary["cpa"] = (
    channel_summary["cost"]
    .div(
        channel_summary["conversions"].replace(
            0, float("nan")
        )
    )
)

print(channel_summary.round(2))
</code></pre>
<p>For example, imagine that your data produces the following illustrative report:</p>
<table>
<thead>
<tr>
<th>Channel</th>
<th align="right">Impressions</th>
<th align="right">Clicks</th>
<th align="right">Conversions</th>
<th align="right">Cost</th>
<th align="right">Revenue</th>
<th align="right">ROAS</th>
<th align="right">CPA</th>
</tr>
</thead>
<tbody><tr>
<td>Email</td>
<td align="right">50,000</td>
<td align="right">4,000</td>
<td align="right">500</td>
<td align="right">$2,000</td>
<td align="right">$10,000</td>
<td align="right">5.00</td>
<td align="right">$4.00</td>
</tr>
<tr>
<td>Search</td>
<td align="right">80,000</td>
<td align="right">6,000</td>
<td align="right">300</td>
<td align="right">$3,000</td>
<td align="right">$9,000</td>
<td align="right">3.00</td>
<td align="right">$10.00</td>
</tr>
<tr>
<td>Social Media</td>
<td align="right">100,000</td>
<td align="right">5,000</td>
<td align="right">250</td>
<td align="right">$2,500</td>
<td align="right">$7,500</td>
<td align="right">3.00</td>
<td align="right">$10.00</td>
</tr>
</tbody></table>
<p><em>Illustrative data shown to demonstrate the report structure.</em></p>
<p>This table is more useful than a list of isolated totals because it allows you to compare reach, engagement, conversions, cost, and attributed revenue in one place.</p>
<p>In this example, email has the highest ROAS and the lowest CPA among the three channels. Social media has the most impressions, but that reach doesn't translate into the highest revenue or conversion total. These results suggest questions to investigate, but they don't automatically prove why one channel performs better than another.</p>
<h4 id="heading-why-calculate-ratios-from-totals">Why Calculate Ratios From Totals?</h4>
<p>When calculating an overall channel ROAS, divide total attributed revenue by total advertising cost. When calculating CPA, divide total cost by total conversions.</p>
<p>Don't simply average the individual campaign ROAS or CPA values if you want the overall channel metric. Campaigns may have very different budgets and conversion volumes, so a simple average can give small campaigns the same weight as large campaigns.</p>
<p>The key lesson here is this: <code>groupby()</code> helps turn individual campaign records into summaries that support channel comparisons and reporting. The results become more meaningful when you calculate the relevant metrics from the grouped totals and interpret them in context.</p>
<h3 id="heading-chapter-13-exploratory-data-analysis">Chapter 13: Exploratory Data Analysis</h3>
<p>Exploratory data analysis, commonly called EDA, is the process of examining a dataset to understand its structure, quality, patterns, and possible relationships before drawing conclusions or building a predictive model.</p>
<p>The purpose of EDA is both to generate statistics as well as to answer practical questions about the data:</p>
<ul>
<li>What information does the dataset contain?</li>
<li>Are any values missing, duplicated, or incorrectly formatted?</li>
<li>Which campaigns or channels appear to perform differently?</li>
<li>Are there unusual values that need investigation?</li>
<li>Do variables appear to move together?</li>
<li>Are there patterns that could help explain marketing performance?</li>
</ul>
<p>EDA helps you discover what the data can support and what still needs to be investigated. It can also reveal data-quality problems that would otherwise lead to misleading reports or unreliable machine learning models.</p>
<h4 id="heading-step-1-understand-the-dataset">Step 1: Understand the Dataset</h4>
<p>Start by checking the number of rows and columns, previewing records, and examining data types.</p>
<pre><code class="language-python">print(df.shape)
print(df.head())
print(df.info())
</code></pre>
<p><code>df.shape</code> shows the dataset's dimensions. <code>df.head()</code> displays the first few rows, while <code>df.info()</code> summarizes the columns, data types, and non-missing values.</p>
<p>These checks can reveal problems such as a revenue column stored as text or a column containing fewer non-missing records than expected.</p>
<h4 id="heading-step-2-examine-summary-statistics">Step 2: Examine Summary Statistics</h4>
<pre><code class="language-python">print(df.describe())
</code></pre>
<p>For numeric columns, <code>describe()</code> reports statistics such as count, mean, standard deviation, minimum, quartiles, and maximum.</p>
<p>These values help you understand typical values and identify possible anomalies. For example, a campaign with unusually high advertising cost may be legitimate, or it may indicate a data-entry error. The summary alone can't determine which explanation is correct.</p>
<h4 id="heading-step-3-check-missing-and-duplicate-records">Step 3: Check Missing and Duplicate Records</h4>
<pre><code class="language-python">print(df.isnull().sum())
print(df.duplicated().sum())
</code></pre>
<p>Missing values can affect calculations and models. Duplicate rows may indicate repeated exports or duplicated records, although repeated values aren't automatically duplicates. Before removing records, determine whether they represent genuinely repeated observations or valid separate events.</p>
<h4 id="heading-step-4-examine-categories">Step 4: Examine Categories</h4>
<p>Marketing data often contains categories such as channel, campaign, region, audience, or device type.</p>
<pre><code class="language-python">print(df["channel"].value_counts())
print(df["campaign"].value_counts())
</code></pre>
<p>These summaries show how many records belong to each category. If a channel appears only once while another appears hundreds of times, that imbalance may affect how you interpret comparisons.</p>
<h4 id="heading-step-5-explore-distributions-and-relationships">Step 5: Explore Distributions and Relationships</h4>
<p>You can summarize the distribution of revenue:</p>
<pre><code class="language-python">print(df["revenue"].describe())
</code></pre>
<p>You can also examine correlations between numeric variables:</p>
<pre><code class="language-python">numeric_columns = [
    "impressions",
    "clicks",
    "conversions",
    "cost",
    "revenue"
]

print(df[numeric_columns].corr())
</code></pre>
<p>Correlation describes how two numeric variables vary together. A positive correlation means higher values of one variable tend to occur alongside higher values of the other; a negative correlation means higher values of one tend to occur alongside lower values of the other.</p>
<p>For example, advertising cost and revenue may be positively correlated because campaigns with larger budgets also generate more revenue. That doesn't prove that increasing spending caused the revenue increase. Campaign quality, audience size, seasonality, product demand, and other factors may also contribute.</p>
<h4 id="heading-what-insights-can-eda-produce">What Insights Can EDA Produce?</h4>
<p>EDA can help you identify:</p>
<ul>
<li><strong>Data-quality issues:</strong> missing values, invalid data types, duplicate records, or suspicious measurements.</li>
<li><strong>Performance differences:</strong> channels or campaigns with higher or lower revenue, conversions, or costs.</li>
<li><strong>Distribution patterns:</strong> whether most orders have similar values or whether a few unusually large orders affect the average.</li>
<li><strong>Potential relationships:</strong> variables that appear to change together and deserve further analysis.</li>
<li><strong>Questions for further investigation:</strong> unexpected results that need business context, a visualization, or a statistical test.</li>
</ul>
<p>EDA doesn't automatically establish cause and effect. Instead, it provides a better understanding of the dataset and helps you decide which analyses should come next.</p>
<h3 id="heading-chapter-14-cohort-analysis">Chapter 14: Cohort Analysis</h3>
<p>Customer behavior becomes more interesting when you analyze it over time.</p>
<p>A cohort groups customers based on a shared starting point. For example, you might group customers based on the month they first purchased.</p>
<p>Suppose one customer first purchased in January and another first purchased in March. They belong to different acquisition cohorts.</p>
<p>First, identify each customer's first purchase:</p>
<pre><code class="language-python">df["purchase_date"] = pd.to_datetime(
    df["purchase_date"]
)

first_purchase = (
    df.groupby("customer_id")[
        "purchase_date"
    ].min()
)
</code></pre>
<p>You can attach that information to the dataset:</p>
<pre><code class="language-python">df["first_purchase"] = (
    df["customer_id"]
    .map(first_purchase)
)
</code></pre>
<p>Then extract the cohort month:</p>
<pre><code class="language-python">df["cohort_month"] = (
    df["first_purchase"]
    .dt.to_period("M")
)
</code></pre>
<p>Now you can compare customer behavior across acquisition periods.</p>
<p>Cohort analysis is particularly useful for understanding retention. A company might discover that customers acquired during one campaign remain active much longer than customers acquired through another campaign.</p>
<p>That insight can be much more valuable than simply knowing which campaign generated the most initial conversions.</p>
<h3 id="heading-chapter-15-retention-analysis">Chapter 15: Retention Analysis</h3>
<p>Acquiring a customer is only one part of marketing. Keeping that customer matters, too.</p>
<p>Suppose a company acquires 1,000 customers in January. If only 50 return in February, the business may have a retention problem.</p>
<p>You can calculate returning customers like this:</p>
<pre><code class="language-python">monthly_customers = (
    df.groupby(
        df["purchase_date"].dt.to_period("M")
    )["customer_id"]
    .nunique()
)
</code></pre>
<p>More detailed retention analysis requires defining exactly what counts as an active customer.</p>
<p>For an e-commerce company, activity might mean a purchase. For a SaaS product, it might mean logging in. And for an email campaign, it might mean opening or clicking.</p>
<p>The definition should match the business model.</p>
<h2 id="heading-part-iv-marketing-visualization">Part IV: Marketing Visualization</h2>
<p>Once you've cleaned and analyzed your data, the next challenge is communication.</p>
<p>A marketing analyst might understand a dataset perfectly, while a marketing manager might not want to look at 50,000 rows of data.</p>
<p>Visualization provides a bridge.</p>
<h3 id="heading-chapter-16-visualization-as-communication">Chapter 16: Visualization as Communication</h3>
<p>A visualization should answer a question. For example:</p>
<ol>
<li><strong>Which channel generates the most revenue?</strong> In this case, a bar chart makes sense.</li>
<li><strong>How is revenue changing over time?</strong> Here, a line chart makes sense.</li>
<li><strong>Is advertising spend associated with revenue?</strong> And for this, a scatter plot can help investigate the relationship.</li>
</ol>
<p>And while charts certainly do look professional, that's not the only goal here. Our true goal is to make the important information easier to understand.</p>
<h4 id="heading-how-to-choose-the-right-chart">How to Choose the Right Chart</h4>
<p>So how do you know which type of chart to use?</p>
<p>You should use line charts for trends over time, bar charts for category comparisons, scatter plots for relationships between numerical variables, histograms for distributions, and tables when exact values matter.</p>
<p>A visualization should match the question.</p>
<h3 id="heading-chapter-17-revenue-over-time">Chapter 17: Revenue Over Time</h3>
<p>Revenue is more informative when you examine how it changes over time instead of looking at a single total. A company might generate substantial revenue in one month but experience a decline in the following months. Another company might have lower total revenue but show steady growth.</p>
<p>Analyzing revenue over time helps you investigate trends, recurring seasonal patterns, sudden changes, and periods that may require additional attention.</p>
<p>Before plotting revenue, make sure the dataset contains a valid date column and a numeric revenue column. The example below assumes the dataset has a <code>purchase_date</code> column and that each row represents a revenue event or transaction.</p>
<h4 id="heading-preparing-monthly-revenue">Preparing Monthly Revenue</h4>
<p>First, convert the date column to a datetime format:</p>
<pre><code class="language-python">import pandas as pd
import matplotlib.pyplot as plt

df["purchase_date"] = pd.to_datetime(
    df["purchase_date"],
    errors="coerce"
)

df = df.dropna(
    subset=["purchase_date", "revenue"]
)
</code></pre>
<p>Next, group the revenue by month:</p>
<pre><code class="language-python">monthly_revenue = (
    df.set_index("purchase_date")["revenue"]
    .resample("MS")
    .sum()
)
</code></pre>
<p>The <code>"MS"</code> frequency groups the data by month, with each period labeled by the start of the month. The <code>sum()</code> operation adds the revenue values within each month.</p>
<p>This calculation assumes that each row represents a revenue amount that should be added. If the dataset already contains monthly revenue totals, don't sum repeated monthly totals without checking the structure, because doing so could double-count revenue.</p>
<h4 id="heading-visualizing-the-trend">Visualizing the Trend</h4>
<pre><code class="language-python">monthly_revenue.plot(
    kind="line",
    marker="o"
)

plt.title("Illustrative Monthly Marketing Revenue")
plt.xlabel("Month")
plt.ylabel("Revenue ($)")
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
</code></pre>
<p>A line chart makes changes over time easier to see. The horizontal axis represents time, and the vertical axis represents revenue. Each point represents the total revenue for a month, while the connecting lines make the overall pattern easier to follow.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a581501af6af179dc1987d5/7be7abc8-7b4d-43c4-b8b7-42991d9a3901.png" alt="Illustrative Monthly Marketing Revenue Potential Output" style="display: block;" width="600" height="400" loading="lazy">

<p><em>Illustrative data for learning purposes</em></p>
<h4 id="heading-interpreting-the-chart">Interpreting the Chart</h4>
<p>When examining the graph, ask these questions:</p>
<ul>
<li>Is revenue generally increasing, decreasing, or staying stable?</li>
<li>Are there sudden increases or decreases?</li>
<li>Do similar changes appear during the same season each year?</li>
<li>Could a campaign launch, price change, promotion, or product release help explain a change?</li>
<li>Are the periods being compared complete and measured consistently?</li>
</ul>
<p>A rising line doesn't automatically mean a marketing campaign caused revenue to increase. Other factors, including seasonality, pricing, product availability, and changes in customer demand, may contribute.</p>
<p>If the dataset contains only a few months, you may not have enough history to identify a reliable seasonal pattern. Use the chart to identify questions, then compare the pattern with campaign activity and other business information.</p>
<p>So remember: a revenue-over-time chart shows how performance changes, giving you a starting point for investigating trends and understanding what may be driving them.</p>
<h3 id="heading-chapter-18-channel-comparisons">Chapter 18: Channel Comparisons</h3>
<p>Marketing teams often use several channels at the same time. Email, search advertising, social media, and display advertising can each contribute to revenue, but they may perform differently in terms of reach, conversions, and cost.</p>
<p>Channel comparisons help answer questions such as:</p>
<ul>
<li>Which channels generate the most revenue?</li>
<li>Which channels produce the most conversions?</li>
<li>Which channels use the advertising budget most efficiently?</li>
<li>Are high-reach channels also generating meaningful results?</li>
</ul>
<p>A visualization makes these comparisons easier to understand, especially when the report contains several channels.</p>
<h4 id="heading-comparing-revenue-by-channel">Comparing Revenue by Channel</h4>
<p>Start by grouping revenue by channel:</p>
<pre><code class="language-python">channel_revenue = (
    df.groupby("channel")["revenue"]
    .sum()
    .sort_values(ascending=False)
)
</code></pre>
<p>Then create a bar chart:</p>
<pre><code class="language-python">import matplotlib.pyplot as plt

channel_revenue.plot(
    kind="bar"
)

plt.title("Illustrative Revenue by Marketing Channel")
plt.xlabel("Marketing Channel")
plt.ylabel("Revenue ($)")
plt.xticks(rotation=45, ha="right")
plt.tight_layout()
plt.show()
</code></pre>
<p>Each bar represents the total revenue associated with one channel. Sorting the values from highest to lowest makes it easier to identify which channels contribute the most revenue in the dataset.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a581501af6af179dc1987d5/8637e85d-a950-49fa-8d4e-91188f3d0826.png" alt="Illustrative Revenue by Marketing Channel Potential Output" style="display: block;" width="600" height="400" loading="lazy">

<p><em>Illustrative data for learning purposes</em></p>
<h4 id="heading-comparing-conversions-by-channel">Comparing Conversions by Channel</h4>
<p>Revenue doesn't tell the whole story. A channel might generate fewer dollars but produce a large number of signups, leads, or purchases, depending on the business objective.</p>
<pre><code class="language-python">channel_conversions = (
    df.groupby("channel")["conversions"]
    .sum()
    .sort_values(ascending=False)
)

channel_conversions.plot(
    kind="bar"
)

plt.title("Illustrative Conversions by Marketing Channel")
plt.xlabel("Marketing Channel")
plt.ylabel("Conversions")
plt.xticks(rotation=45, ha="right")
plt.tight_layout()
plt.show()
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6a581501af6af179dc1987d5/191e1863-9e06-4299-9787-49b494a5efb0.png" alt="Illustrative Conversions by Marketing Channel Potential Output" style="display: block;" width="600" height="400" loading="lazy">

<p><em>Illustrative data for learning purposes</em></p>
<p>The first chart compares revenue volume, while the second compares conversion volume. Together, they provide more context than either chart alone.</p>
<h4 id="heading-why-one-metric-isnt-enough">Why One Metric Isn't Enough</h4>
<p>Imagine the following results:</p>
<table>
<thead>
<tr>
<th>Channel</th>
<th align="right">Revenue</th>
<th align="right">Conversions</th>
<th align="right">Advertising Cost</th>
</tr>
</thead>
<tbody><tr>
<td>Email</td>
<td align="right">$50,000</td>
<td align="right">1,000</td>
<td align="right">$40,000</td>
</tr>
<tr>
<td>Search</td>
<td align="right">$45,000</td>
<td align="right">300</td>
<td align="right">$5,000</td>
</tr>
</tbody></table>
<p>Email generates more revenue and more conversions. But search generates $45,000 in revenue with only $5,000 in advertising cost, while email spends $40,000 to generate $50,000 in revenue.</p>
<p>Their ROAS values are:</p>
<ul>
<li>Email: $50,000 ÷ $40,000 = 1.25</li>
<li>Search: $45,000 ÷ $5,000 = 9.00</li>
</ul>
<p>Search has the higher ROAS in this example, even though email generates more total revenue. Remember that ROAS measures attributed revenue relative to advertising cost. It's not the same as profit.</p>
<p>These numbers illustrate why you should compare related metrics rather than automatically choosing the channel with the tallest revenue bar.</p>
<h3 id="heading-chapter-19-scatter-plots">Chapter 19: Scatter Plots</h3>
<p>Suppose you want to explore whether advertising spend and revenue are related.</p>
<pre><code class="language-python">plt.scatter(
    df["cost"],
    df["revenue"]
)

plt.title(
    "Advertising Cost vs Revenue"
)

plt.xlabel("Advertising Cost")
plt.ylabel("Revenue")

plt.tight_layout()
plt.show()
</code></pre>
<p>The resulting pattern can help you investigate relationships.</p>
<p>But don't immediately conclude that spending more causes revenue to increase.</p>
<p>The relationship could be affected by:</p>
<ul>
<li>Campaign quality</li>
<li>Audience size</li>
<li>Seasonality</li>
<li>Product demand</li>
<li>Brand recognition</li>
<li>Existing customer behavior</li>
<li>Other marketing channels</li>
</ul>
<p>Visualization helps you ask better questions, but it doesn't replace the actual analysis of the data.</p>
<h3 id="heading-chapter-20-distribution-analysis">Chapter 20: Distribution Analysis</h3>
<p>Distribution analysis examines how values are spread across a dataset. Instead of focusing only on a total or average, it helps you understand which values occur frequently, how much variation exists, and whether a small number of unusually high or low observations influence the results.</p>
<p>In marketing, distribution analysis can help you understand customer order values, campaign costs, website sessions, conversion rates, and other numeric measurements.</p>
<p>This is different from simply analyzing older values. Historical analysis compares measurements across time, while distribution analysis examines the spread and frequency of values within a dataset or a selected period. You can use both approaches together, but they answer different questions.</p>
<p>For example, historical analysis asks whether average order value increased from one month to the next. Distribution analysis asks whether most orders have similar values or whether a few unusually large orders pull the average upward.</p>
<h4 id="heading-examining-order-values">Examining Order Values</h4>
<p>Suppose your dataset contains an <code>order_value</code> column. Begin by examining its summary statistics:</p>
<pre><code class="language-python">print(df["order_value"].describe())
</code></pre>
<p>The output includes the count, mean, standard deviation, minimum, quartiles, and maximum.</p>
<p>The <strong>mean</strong> is the arithmetic average: add all order values and divide by the number of orders. The <strong>median</strong> is the middle value when the orders are sorted. The median is less affected by a small number of extremely large purchases.</p>
<p>For example, consider these five order values:</p>
<pre><code class="language-text">$20, $25, $30, $35, $390
</code></pre>
<p>The mean is $100, but the median is $30. The $390 purchase raises the mean substantially, even though four of the five orders are below $40.</p>
<p>This is why the mean doesn't always describe a typical customer's order particularly well. If order values are strongly skewed, the median and the distribution itself may provide a more representative picture.</p>
<h4 id="heading-visualizing-the-distribution">Visualizing the Distribution</h4>
<p>A histogram groups numeric values into ranges called bins and shows how many observations fall into each range.</p>
<pre><code class="language-python">import pandas as pd
import matplotlib.pyplot as plt

df = pd.DataFrame({
    "order_id": range(1, 11),
    "order_value": [20, 25, 30, 35, 390, 28, 32, 40, 45, 50]
})

plt.figure(figsize=(9, 5))

plt.hist(
    df["order_value"],
    bins=8,
    edgecolor="black"
)

plt.title("Illustrative Distribution of Customer Order Values")
plt.xlabel("Order Value ($)")
plt.ylabel("Number of Orders")
plt.grid(axis="y", alpha=0.3)
plt.tight_layout()
plt.show()
</code></pre>
<p>Each bar represents a range of order values, and the height indicates how many orders fall within that range.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a581501af6af179dc1987d5/3a0d7be3-9fc8-41b1-8732-9c1a9be80433.png" alt="Histogram Output" style="display: block;" width="600" height="400" loading="lazy">

<p>A histogram can reveal whether most orders cluster around a particular range, whether the distribution has a long tail of high-value purchases, or whether multiple groups of order values appear to exist.</p>
<h4 id="heading-what-should-you-look-for">What Should You Look For?</h4>
<p>When interpreting a distribution, consider:</p>
<ul>
<li><strong>Center:</strong> Where do the values tend to fall? The mean and median can help describe the center.</li>
<li><strong>Spread:</strong> How much do values vary? A wide distribution indicates more variation than a tightly clustered one.</li>
<li><strong>Skew:</strong> Are values concentrated toward one end with a longer tail on the other?</li>
<li><strong>Outliers:</strong> Are some values unusually far from the rest?</li>
<li><strong>Multiple groups:</strong> Does the distribution suggest different types of customers or transactions?</li>
</ul>
<p>An unusual value isn't necessarily an error. A very large order could be a legitimate purchase from a valuable customer. Check the source and business context before removing or changing it.</p>
<h4 id="heading-why-distribution-analysis-matters">Why Distribution Analysis Matters</h4>
<p>Suppose average order value rises substantially in a particular month. Looking only at the mean might lead you to assume that customers generally began spending more. But the increase could be caused by a handful of unusually large purchases while most customers continue to spend the same amount.</p>
<p>Comparing the mean, median, histogram, and historical trends can help distinguish these possibilities.</p>
<p>The key lesson is this: distribution analysis helps you understand what's typical, how much values vary, and whether extreme observations affect the story told by a summary statistic.</p>
<h2 id="heading-part-v-customer-and-campaign-analytics">Part V: Customer and Campaign Analytics</h2>
<p>Marketing analytics becomes significantly more interesting when you stop asking only "How did our campaign perform?" and start asking "Who responded, why did they respond, and what should we do next?"</p>
<h3 id="heading-chapter-21-customer-segmentation">Chapter 21: Customer Segmentation</h3>
<p>Customer segmentation is the process of dividing customers into groups based on shared characteristics or behaviors. Rather than treating every customer as identical, a business can identify groups that may respond differently to marketing campaigns.</p>
<p>For example, some customers purchase frequently, some make only one purchase, and others have not purchased for several months. A business may want to reward frequent customers, encourage one-time buyers to return, or reconnect with customers who have become inactive.</p>
<p>Segmentation helps marketers develop more relevant strategies for different customer groups. It doesn't automatically tell you what each customer wants, but it provides a structured way to understand patterns in customer behavior.</p>
<h4 id="heading-rfm-analysis">RFM Analysis</h4>
<p>One common approach is RFM analysis, which uses three measurements:</p>
<ul>
<li><strong>Recency:</strong> How recently did the customer make a purchase?</li>
<li><strong>Frequency:</strong> How many purchases has the customer made during the period being analyzed?</li>
<li><strong>Monetary value:</strong> How much money has the customer spent during that period?</li>
</ul>
<p>These measurements provide different perspectives on customer activity. A customer with low recency in days has purchased recently, while a customer with high recency in days hasn't purchased for longer. Higher frequency indicates more purchases, and higher monetary value indicates greater recorded spending.</p>
<p>Suppose a dataset contains <code>customer_id</code>, <code>purchase_date</code>, and <code>order_value</code>. First, convert the purchase dates to datetime values:</p>
<pre><code class="language-python">df["purchase_date"] = pd.to_datetime(
    df["purchase_date"],
    errors="coerce"
)
</code></pre>
<p>Choose an analysis date and calculate each customer's last purchase, purchase frequency, and total recorded spending:</p>
<pre><code class="language-python">analysis_date = pd.Timestamp("2026-09-05")

customer_rfm = (
    df.groupby("customer_id")
    .agg(
        last_purchase=("purchase_date", "max"),
        frequency=("purchase_date", "count"),
        monetary=("order_value", "sum")
    )
)

customer_rfm["recency"] = (
    analysis_date - customer_rfm["last_purchase"]
).dt.days

customer_rfm = customer_rfm[
    ["recency", "frequency", "monetary"]
]

print(customer_rfm)
</code></pre>
<p>This example assumes that each row represents one purchase and that <code>order_value</code> contains the value of that purchase. If your data has multiple rows per order, use a unique order identifier to count orders correctly. Choose an analysis date that matches the reporting period you're studying.</p>
<h4 id="heading-understanding-the-rfm-table">Understanding the RFM Table</h4>
<p>The following illustrative table shows what an RFM summary might look like:</p>
<table>
<thead>
<tr>
<th>Customer ID</th>
<th align="right">Recency (days)</th>
<th align="right">Frequency (orders)</th>
<th align="right">Monetary Value</th>
</tr>
</thead>
<tbody><tr>
<td>C001</td>
<td align="right">8</td>
<td align="right">12</td>
<td align="right">$960</td>
</tr>
<tr>
<td>C002</td>
<td align="right">75</td>
<td align="right">4</td>
<td align="right">$240</td>
</tr>
<tr>
<td>C003</td>
<td align="right">180</td>
<td align="right">1</td>
<td align="right">$45</td>
</tr>
<tr>
<td>C004</td>
<td align="right">20</td>
<td align="right">7</td>
<td align="right">$525</td>
</tr>
</tbody></table>
<p><em>Illustrative values for learning purposes.</em></p>
<p>Customer C001 purchased recently, has placed many orders, and has spent the most in this example. Customer C003 hasn't purchased for a much longer period, has placed only one order, and has the lowest recorded spending.</p>
<p>These differences may suggest different marketing approaches. A business might consider a loyalty offer for a frequent customer, a follow-up offer for a one-time buyer, or a re-engagement campaign for a customer who has been inactive.</p>
<p>But RFM values should be interpreted in context. A customer with low frequency might be perfectly normal for a product that's purchased only once a year. The length of the observation period also matters because a customer who has been active for two months has had less time to accumulate purchases than a customer who has been active for two years.</p>
<h3 id="heading-chapter-22-customer-lifetime-value">Chapter 22: Customer Lifetime Value</h3>
<p>Customer lifetime value estimates how much value a customer generates over their relationship with the business.</p>
<p>A simple historical measure is:</p>
<pre><code class="language-python">customer_ltv = (
    df.groupby("customer_id")[
        "order_value"
    ].sum()
)
</code></pre>
<p>This tells you how much each customer has spent historically.</p>
<p>A more sophisticated model might estimate future value.</p>
<p>For example, a conceptual lifetime value formula could consider:</p>
<pre><code class="language-text">Average Order Value
× Purchase Frequency
× Expected Customer Lifespan
</code></pre>
<p>But real lifetime value calculations can become much more complex.</p>
<p>They may need to consider:</p>
<ul>
<li>Gross margin</li>
<li>Retention</li>
<li>Churn</li>
<li>Discounting</li>
<li>Acquisition cost</li>
<li>Product category</li>
<li>Customer behavior</li>
</ul>
<p>The important lesson is that LTV is an estimate, not an unquestionable truth.</p>
<h3 id="heading-chapter-23-customer-acquisition-cost">Chapter 23: Customer Acquisition Cost</h3>
<p>Customer acquisition cost, or CAC, estimates how much it costs to acquire a customer.</p>
<p>A simple formula is:</p>
<pre><code class="language-python">cac = total_marketing_cost / new_customers
</code></pre>
<p>Suppose:</p>
<pre><code class="language-python">marketing_cost = 20000
new_customers = 400

cac = marketing_cost / new_customers

print(cac)
</code></pre>
<p>The result is:</p>
<pre><code class="language-text">50.0
</code></pre>
<p>That means the average acquisition cost was $50 per customer.</p>
<p>Comparing CAC with customer value can help determine whether acquisition is economically sustainable.</p>
<h4 id="heading-cac-and-ltv-together">CAC and LTV Together</h4>
<p>Suppose:</p>
<pre><code class="language-text">CAC = $50
LTV = $300
</code></pre>
<p>That looks potentially healthy.</p>
<p>Now suppose:</p>
<pre><code class="language-text">CAC = $250
LTV = $180
</code></pre>
<p>The business may be acquiring customers for more than they're worth.</p>
<p>These metrics should still be interpreted carefully. LTV may be estimated, and CAC may vary substantially by channel.</p>
<p>Some acquisition costs may be excluded from a simple calculation. But together, they provide a useful framework for thinking about marketing economics.</p>
<h3 id="heading-chapter-24-funnel-analysis">Chapter 24: Funnel Analysis</h3>
<p>A marketing funnel represents the stages a customer moves through before completing a desired action, such as making a purchase, signing up for a service, or submitting a lead form.</p>
<p>A typical online shopping funnel might include:</p>
<ol>
<li>Visiting a website</li>
<li>Viewing a product</li>
<li>Adding the product to a cart</li>
<li>Starting checkout</li>
<li>Completing a purchase</li>
</ol>
<p>At each stage, some people continue while others leave. Funnel analysis measures how many people progress from one stage to the next and helps you identify where additional investigation may be useful.</p>
<h4 id="heading-calculating-stage-conversion-rates">Calculating Stage Conversion Rates</h4>
<p>Suppose a website records the following counts during the same reporting period:</p>
<pre><code class="language-python">visitors = 50000
product_views = 30000
cart_adds = 8000
checkouts = 4000
purchases = 2500
</code></pre>
<p>A <strong>stage conversion rate</strong> is the percentage of people who reach one stage and then progress to the next stage.</p>
<p>Stage Conversion Rate = Number Reaching the Next Stage ÷ Number Reaching the Previous Stage × 100</p>
<p>For example, the product-view rate is calculated by dividing product views by visitors:</p>
<pre><code class="language-python">product_view_rate = (
    product_views / visitors * 100
)

cart_rate = (
    cart_adds / product_views * 100
)

checkout_rate = (
    checkouts / cart_adds * 100
)

purchase_rate = (
    purchases / checkouts * 100
)

print(f"Visitor to product view: {product_view_rate:.1f}%")
print(f"Product view to cart: {cart_rate:.1f}%")
print(f"Cart to checkout: {checkout_rate:.1f}%")
print(f"Checkout to purchase: {purchase_rate:.1f}%")
</code></pre>
<p>With these illustrative values, 60% of visitors view a product, about 26.7% of product viewers add an item to their cart, 50% of cart additions progress to checkout, and 62.5% of checkouts result in a purchase.</p>
<p>Each percentage describes a specific transition. Don't confuse these stage conversion rates with the overall purchase rate, which would compare purchases directly with visitors.</p>
<p>These calculations also assume that the stage counts are defined consistently and refer to comparable users or sessions within the same reporting period. If the counts represent different populations or use different tracking rules, the rates may not accurately describe customer progression.</p>
<h4 id="heading-investigating-customer-experience">Investigating Customer Experience</h4>
<p>A low stage conversion rate tells you where people are dropping out, but it doesn't explain why they're leaving. The next step is to investigate the customer experience at that stage.</p>
<p>For example, if many customers abandon checkout, possible issues to examine include:</p>
<ul>
<li>Unexpected shipping fees or taxes</li>
<li>A checkout process that requires too many steps</li>
<li>Forms that are difficult to complete on a mobile device</li>
<li>Limited payment options</li>
<li>Slow-loading pages or technical errors</li>
<li>Confusing delivery or return information</li>
<li>A mismatch between the advertisement and the landing page</li>
</ul>
<p>You can investigate these possibilities using analytics events, device-level comparisons, customer support feedback, usability testing, and error logs. These sources help you identify potential explanations rather than assuming the funnel rate itself proves the cause.</p>
<p>If the evidence suggests that a checkout change might help, you could test a simpler checkout flow or clearer pricing information. This connects funnel analysis to A/B testing: funnel analysis identifies where to investigate, while an experiment can help assess whether a proposed change improves the outcome.</p>
<p>Funnel analysis shows where customers stop progressing. Investigating the customer experience helps you develop explanations and determine which changes are worth testing.</p>
<h3 id="heading-chapter-25-ab-testing">Chapter 25: A/B Testing</h3>
<p>A/B testing is a controlled experiment used to compare two versions of a marketing experience. A business might compare two landing pages, email subject lines, advertisements, checkout designs, or calls to action to find out which version performs better for a defined objective.</p>
<p>Version A is the control or existing version, while Version B is the alternative being tested. Ideally, eligible users are randomly assigned to one version so that the comparison is less likely to be distorted by differences between the groups.</p>
<h4 id="heading-calculating-conversion-rates">Calculating Conversion Rates</h4>
<p>Suppose you're testing two landing pages and measuring whether visitors complete a desired action.</p>
<pre><code class="language-python">visitors_a = 5000
conversions_a = 240

visitors_b = 5000
conversions_b = 290
</code></pre>
<p>Calculate each conversion rate:</p>
<pre><code class="language-python">rate_a = (
    conversions_a / visitors_a
)

rate_b = (
    conversions_b / visitors_b
)

print(f"Version A: {rate_a:.2%}")
print(f"Version B: {rate_b:.2%}")
</code></pre>
<p>In this example, Version A has a conversion rate of 4.8%, while Version B has a conversion rate of 5.8%. The observed difference is one percentage point.</p>
<p>But an observed difference <strong>doesn't automatically prove that Version B is genuinely better</strong>. Results can vary because of random chance, even when two versions perform similarly in the wider population.</p>
<h4 id="heading-understanding-statistical-uncertainty">Understanding Statistical Uncertainty</h4>
<p>An A/B test uses a sample of visitors to estimate how the versions might perform across a larger population. Because the test doesn't usually include every possible customer, the measured conversion rates are estimates rather than perfectly known population values.</p>
<p>Statistical uncertainty describes the fact that these estimates can vary from sample to sample. A different group of visitors might produce a slightly different result, even if the underlying performance of the two versions hasn't changed.</p>
<p>Several factors influence the uncertainty of an experiment:</p>
<ul>
<li><strong>Sample size:</strong> smaller samples generally produce less precise estimates than larger samples.</li>
<li><strong>Conversion frequency:</strong> when the desired action is rare, more observations may be needed to estimate the conversion rate precisely.</li>
<li><strong>Random variation:</strong> individual visitor behavior isn't perfectly predictable.</li>
<li><strong>Experimental design:</strong> uneven assignment, tracking problems, or changes made during the test can undermine the comparison.</li>
</ul>
<p>A small observed difference in a small sample may be due to random variation. A larger, well-designed experiment can provide stronger evidence, but sample size alone doesn't fix problems such as biased assignment or incorrect tracking.</p>
<h4 id="heading-statistical-significance-and-business-significance">Statistical Significance and Business Significance</h4>
<p>Statistical significance addresses whether the observed result would be unusual under a specified statistical model in which there's no true difference between the versions. It doesn't directly tell you how valuable the difference is to the business, nor does it prove that the result will repeat in every future setting.</p>
<p>Business significance concerns whether the size of the improvement is worth acting on. For example, a small conversion-rate improvement might generate meaningful additional revenue for a high-traffic website but very little additional value for a low-traffic site. The costs and risks of implementing the change also matter.</p>
<p>A responsible A/B testing process should:</p>
<ol>
<li>Define the primary outcome before the test begins.</li>
<li>Randomly assign eligible visitors when appropriate.</li>
<li>Make sure conversion tracking works consistently for both versions.</li>
<li>Decide how much data and what test duration are appropriate before evaluating the result.</li>
<li>Consider statistical uncertainty and the practical size of the observed difference.</li>
<li>Avoid repeatedly checking results and stopping as soon as one version looks better unless the testing method explicitly accounts for sequential monitoring.</li>
<li>Document the result, limitations, and decision.</li>
</ol>
<p>A/B testing isn't simply a matter of choosing whichever version has the larger percentage. The goal is to gather reliable evidence about whether a change improves a meaningful outcome.</p>
<p>The key lesson here is this: statistical uncertainty matters because sample results can differ from the true underlying performance. Understanding that uncertainty helps you avoid making expensive marketing decisions based on random fluctuations.</p>
<h2 id="heading-part-vi-marketing-automation">Part VI: Marketing Automation</h2>
<p>Marketing teams often spend enormous amounts of time repeating processes that follow predictable rules.</p>
<p>That makes automation one of the strongest applications of Python.</p>
<h3 id="heading-chapter-26-identifying-automation-opportunities">Chapter 26: Identifying Automation Opportunities</h3>
<p>A good candidate for automation usually has several characteristics:</p>
<ul>
<li>It happens repeatedly</li>
<li>It follows predictable steps</li>
<li>It uses structured data</li>
<li>It requires little subjective judgment</li>
<li>Mistakes are common when performed manually</li>
<li>Automating it saves meaningful time</li>
</ul>
<p>For example:</p>
<p>"Every Monday, download campaign data, calculate ROAS, identify campaigns below a threshold, and generate a report."</p>
<p>That's an excellent automation candidate.</p>
<h3 id="heading-chapter-27-building-a-reporting-function">Chapter 27: Building a Reporting Function</h3>
<p>Instead of manually running every step, create a function.</p>
<pre><code class="language-python">def generate_campaign_report(
    input_file,
    output_file
):
    df = pd.read_csv(input_file)

    df["roas"] = (
        df["revenue"] /
        df["cost"]
    )

    df["conversion_rate"] = (
        df["conversions"] /
        df["clicks"] *
        100
    )

    df.to_csv(
        output_file,
        index=False
    )
</code></pre>
<p>Then:</p>
<pre><code class="language-python">generate_campaign_report(
    "campaigns.csv",
    "campaign_report.csv"
)
</code></pre>
<p>Now the workflow can be repeated.</p>
<h3 id="heading-chapter-28-logging">Chapter 28: Logging</h3>
<p>When a script runs automatically, <code>print()</code> statements are often not enough.</p>
<p>Logging provides a more structured approach.</p>
<pre><code class="language-python">import logging

logging.basicConfig(
    level=logging.INFO
)

logging.info(
    "Marketing report started."
)
</code></pre>
<p>Then:</p>
<pre><code class="language-python">logging.info(
    "Campaign data loaded successfully."
)
</code></pre>
<p>If an error occurs:</p>
<pre><code class="language-python">logging.error(
    "Unable to load campaign data."
)
</code></pre>
<p>Logging becomes particularly useful when a scheduled job runs without someone watching it.</p>
<h3 id="heading-chapter-29-scheduling">Chapter 29: Scheduling</h3>
<p>Once your script works, you can schedule it.</p>
<p>For example, you might configure your operating system to run the reporting program every Monday morning.</p>
<p>The scheduling system itself depends on your environment. On Windows, Task Scheduler can execute Python programs. On macOS and Linux, cron is a common option. Cloud platforms can also run scheduled jobs.</p>
<p>The important concept is that <strong>automation isn't complete until the process can run reliably without someone manually starting it.</strong></p>
<h3 id="heading-chapter-30-automated-alerts">Chapter 30: Automated Alerts</h3>
<p>A marketing system shouldn't always wait for someone to open a report.</p>
<p>It can identify important conditions.</p>
<pre><code class="language-python">if overall_roas &lt; 1:
    alert = (
        "Warning: overall ROAS is below 1."
    )
</code></pre>
<p>Or:</p>
<pre><code class="language-python">if conversion_rate &lt; previous_rate * 0.8:
    alert = (
        "Conversion rate has fallen "
        "significantly compared with the "
        "previous period."
    )
</code></pre>
<p>The alert can eventually be connected to email, Slack, Microsoft Teams, or another notification system.</p>
<p>The important thing is that the system identifies situations requiring attention.</p>
<h3 id="heading-chapter-31-responsible-automation">Chapter 31: Responsible Automation</h3>
<p>Automation can make marketing work faster and more consistent, but it can also repeat mistakes at scale. A script that calculates an incorrect metric once can produce the same incorrect result every time it runs. If the report feeds into campaign decisions or automated customer communications, the consequences can grow quickly.</p>
<p>Suppose a report accidentally labels customers as eligible for a promotion when they don't meet the eligibility rules. A manual review might catch the problem. An automated system without validation could distribute the incorrect list repeatedly.</p>
<p>For this reason, production automation should include input validation, error handling, logging, testing, and monitoring. Important actions may also require human approval.</p>
<h4 id="heading-a-simple-production-ready-workflow">A Simple Production-Ready Workflow</h4>
<p>A basic marketing-report automation workflow can follow these steps:</p>
<ol>
<li><strong>Load the source data:</strong> Read the latest campaign export or approved input file.</li>
<li><strong>Validate the data:</strong> Check that required columns exist, numeric fields contain valid values, and unexpected records are flagged.</li>
<li><strong>Calculate the metrics:</strong> Generate conversion rate, CPA, and ROAS while handling zero denominators appropriately.</li>
<li><strong>Save the report:</strong> Write the results to a designated output location.</li>
<li><strong>Log the outcome:</strong> Record whether the report succeeded or failed so someone can investigate problems.</li>
<li><strong>Schedule and monitor the process:</strong> Use an operating-system scheduler or an approved orchestration tool, and check that the expected output is produced.</li>
</ol>
<p>The following example demonstrates a simple workflow for a campaign report. It assumes the input CSV contains one row per campaign and includes <code>campaign</code>, <code>clicks</code>, <code>conversions</code>, <code>cost</code>, and <code>revenue</code> columns.</p>
<pre><code class="language-python">import logging
from pathlib import Path

import pandas as pd

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s %(levelname)s: %(message)s"
)

REQUIRED_COLUMNS = {
    "campaign",
    "clicks",
    "conversions",
    "cost",
    "revenue"
}


def generate_report(input_file, output_file):
    input_path = Path(input_file)
    output_path = Path(output_file)

    try:
        if not input_path.exists():
            raise FileNotFoundError(
                f"Input file not found: {input_path}"
            )

        df = pd.read_csv(input_path)

        missing = REQUIRED_COLUMNS - set(df.columns)
        if missing:
            raise ValueError(
                f"Missing required columns: {sorted(missing)}"
            )

        numeric_columns = [
            "clicks",
            "conversions",
            "cost",
            "revenue"
        ]

        for column in numeric_columns:
            df[column] = pd.to_numeric(
                df[column],
                errors="coerce"
            )

        if df[numeric_columns].isna().any().any():
            raise ValueError(
                "Required numeric fields contain missing "
                "or invalid values."
            )

        if (df[numeric_columns] &lt; 0).any().any():
            raise ValueError(
                "Negative values were found in metrics "
                "that should not be negative."
            )

        if (df["conversions"] &gt; df["clicks"]).any():
            logging.warning(
                "Some campaigns have more conversions "
                "than clicks. Check the metric definitions."
            )

        df["conversion_rate"] = (
            df["conversions"]
            .div(df["clicks"].replace(0, float("nan")))
            .mul(100)
        )

        df["cpa"] = (
            df["cost"]
            .div(
                df["conversions"].replace(
                    0, float("nan")
                )
            )
        )

        df["roas"] = (
            df["revenue"]
            .div(df["cost"].replace(0, float("nan")))
        )

        output_path.parent.mkdir(
            parents=True,
            exist_ok=True
        )

        df.to_csv(output_path, index=False)

        logging.info(
            "Report saved successfully to %s",
            output_path
        )

    except Exception:
        logging.exception(
            "Marketing report generation failed"
        )
        raise


if __name__ == "__main__":
    generate_report(
        "campaigns.csv",
        "reports/campaign_report.csv"
    )
</code></pre>
<h4 id="heading-what-makes-this-workflow-safer">What Makes This Workflow Safer?</h4>
<p>The script checks that the input file exists and that required columns are present. It attempts to convert metric columns into numeric values and stops if required fields contain missing or invalid data. It also flags negative values in metrics that shouldn't normally be negative.</p>
<p>When conversions exceed clicks, the example logs a warning rather than automatically changing the data. Depending on the business's definition of a conversion, that result may be possible, so it should be investigated rather than silently corrected.</p>
<p>The calculated rates use missing values for zero denominators. This prevents undefined ratios from being reported as valid numbers. The script also creates the output directory if necessary, records successful completion, and logs failures before raising the error so that a scheduler or monitoring system can detect the failure.</p>
<p>This is a practical starting point, not a complete monitoring platform. A real deployment should also consider data freshness, duplicate imports, expected row counts, access permissions, secure storage, backups, alerting, and whether a human should approve the report before it influences a campaign.</p>
<h4 id="heading-scheduling-the-workflow">Scheduling the Workflow</h4>
<p>The script can be run manually while it's being tested. Once it works reliably, it can be scheduled using a tool such as Windows Task Scheduler or cron on Linux and macOS. The scheduler determines when the script runs. The Python code determines what the script does.</p>
<p>Before scheduling it, test the workflow using sample data and deliberately introduce problems such as a missing column or an invalid numeric value. Confirm that the script fails clearly rather than producing a misleading report.</p>
<p>The key lesson over here: reliable automation isn't just about running code without human involvement. You also need to worry about about validating inputs, handling failures, documenting results, and ensuring that the automated output can be trusted.</p>
<h2 id="heading-part-vii-machine-learning-for-marketing">Part VII: Machine Learning for Marketing</h2>
<p>Machine learning becomes useful when you want to move from describing what happened to estimating what might happen next.</p>
<h3 id="heading-chapter-32-from-analytics-to-prediction">Chapter 32: From Analytics to Prediction</h3>
<p>Traditional analytics might answer a question like, "Which customers purchased last month?"</p>
<p>Machine learning, on the other hand, might answer: "Which customers are most likely to purchase next month?"</p>
<p>Traditional analytics asks "Which leads converted?"</p>
<p>Machine learning asks "Which leads are most likely to convert?"</p>
<p>Traditional analytics asks "Which customers churned?"</p>
<p>Machine learning asks "Which customers appear most likely to churn?"</p>
<p>This distinction is important: Machine learning doesn't replace analytics. It builds on it.</p>
<h3 id="heading-chapter-33-features-and-targets">Chapter 33: Features and Targets</h3>
<p>A machine learning model typically needs input variables called features.</p>
<p>Suppose you want to predict customer churn. Features might include:</p>
<pre><code class="language-text">purchase_frequency
total_spend
days_since_last_purchase
email_opens
website_sessions
</code></pre>
<p>The target might be:</p>
<pre><code class="language-text">churned
</code></pre>
<p>In Python:</p>
<pre><code class="language-python">features = [
    "purchase_frequency",
    "total_spend",
    "days_since_last_purchase",
    "email_opens",
    "website_sessions"
]

X = df[features]
y = df["churned"]
</code></pre>
<p>Here:</p>
<p><code>X</code> contains information used for prediction.</p>
<p><code>y</code> contains the outcome you want to predict.</p>
<h3 id="heading-chapter-34-splitting-data">Chapter 34: Splitting Data</h3>
<p>Before training a machine learning model, you need to separate the data used to teach the model from the data used to evaluate it.</p>
<p>This is important because a model can perform well on examples it has already seen without performing equally well on new examples. If you evaluate a model using the same records it learned from, the evaluation may give an overly optimistic impression of how well the model will perform in practice.</p>
<p>A common approach is to create a <strong>training set</strong> and a <strong>test set</strong>:</p>
<ul>
<li><strong>Training set:</strong> the records the model uses to learn patterns.</li>
<li><strong>Test set:</strong> records held back until evaluation to estimate how the trained model performs on data it didn't use for learning.</li>
</ul>
<p>For example, an 80/20 split allocates approximately 80% of the records to training and 20% to testing. This is a common starting point, not a universal rule. The appropriate split depends on the dataset size, the prediction task, and how the model will be used.</p>
<h4 id="heading-creating-the-split-with-scikit-learn">Creating the Split With scikit-learn</h4>
<p>Assume that <code>X</code> contains the model's input features and <code>y</code> contains the target you want to predict.</p>
<pre><code class="language-python">from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(
    X,
    y,
    test_size=0.2,
    random_state=42
)
</code></pre>
<p>Here, <code>test_size=0.2</code> reserves 20% of the records for testing. <code>random_state=42</code> makes the random split reproducible, so you can obtain the same split again when the dataset and code remain unchanged.</p>
<p>For a classification problem, you may also want to preserve the approximate proportion of each class in both sets:</p>
<pre><code class="language-python">X_train, X_test, y_train, y_test = train_test_split(
    X,
    y,
    test_size=0.2,
    random_state=42,
    stratify=y
)
</code></pre>
<p>Using <code>stratify=y</code> is often helpful when the target classes are imbalanced. But stratification requires enough examples in each class and isn't appropriate for every task.</p>
<h4 id="heading-avoiding-time-related-leakage">Avoiding Time-Related Leakage</h4>
<p>Random splitting isn't always suitable for marketing data. If you're predicting future purchases or future churn, the records have a time order. Training on later observations and testing on earlier observations can allow information from the future to influence the evaluation.</p>
<p>For time-dependent predictions, consider training on an earlier period and testing on a later period. The split should reflect the information that would actually have been available when the prediction was made.</p>
<p>Also remember that splitting data does not, by itself, prevent data leakage. Any preprocessing steps that learn information from the dataset (like imputing missing values or scaling features) should generally be fitted using the training data only and then applied to the test data.</p>
<p>Remember: data splitting helps estimate how a model may perform on unseen data, but the split must reflect the way the model will be used in the real world.</p>
<h3 id="heading-chapter-35-classification">Chapter 35: Classification</h3>
<p>Classification is a machine learning task in which a model predicts a category or class. Marketing examples include predicting whether a customer will churn, whether a lead will convert, whether an email is likely to be marked as spam, or whether a customer will purchase within a defined period.</p>
<p>Classification differs from regression. Classification predicts categories, while regression predicts a numeric value such as expected revenue or customer lifetime value.</p>
<p>A classification model learns patterns from historical examples in which the correct outcomes are already known. It then uses those patterns to predict outcomes for new records. The model's predictions are estimates, not guarantees.</p>
<h4 id="heading-preparing-the-features-and-target">Preparing the Features and Target</h4>
<p>Suppose you want to predict whether a customer will churn. Your dataset might include features such as:</p>
<pre><code class="language-text">purchase_frequency
total_spend
days_since_last_purchase
email_opens
website_sessions
</code></pre>
<p>The target might be a column named <code>churned</code>, where each record is labeled to indicate whether the customer churned during a clearly defined period.</p>
<p>In Python:</p>
<pre><code class="language-python">features = [
    "purchase_frequency",
    "total_spend",
    "days_since_last_purchase",
    "email_opens",
    "website_sessions"
]

X = df[features]
y = df["churned"]
</code></pre>
<p>Here, <code>X</code> contains the information used to make predictions, and <code>y</code> contains the outcome the model is supposed to predict. The features should only include information that would genuinely be available at the time the prediction is made.</p>
<p>Before fitting the model, handle missing values and categorical variables as appropriate, and split the dataset into training and test sets as described in the previous chapter.</p>
<h4 id="heading-training-a-logistic-regression-classifier">Training a Logistic Regression Classifier</h4>
<p>Logistic regression is a common starting point for binary classification, such as predicting one of two outcomes: churn or no churn.</p>
<pre><code class="language-python">from sklearn.linear_model import LogisticRegression

model = LogisticRegression(
    max_iter=1000
)

model.fit(
    X_train,
    y_train
)
</code></pre>
<p>The <code>fit()</code> method trains the model using the training features and their known target labels. The model learns relationships between the input variables and the outcome.</p>
<p>Use the trained model to predict classes for the held-back test features:</p>
<pre><code class="language-python">predictions = model.predict(
    X_test
)
</code></pre>
<p>The <code>predict()</code> method produces predicted class labels. For a binary churn model, those labels might indicate churn or no churn.</p>
<p>You can evaluate the predictions with a classification report:</p>
<pre><code class="language-python">from sklearn.metrics import classification_report

print(
    classification_report(
        y_test,
        predictions,
        zero_division=0
    )
)
</code></pre>
<p>This report summarizes metrics such as precision, recall, and F1 score for each class.</p>
<h4 id="heading-other-classification-models">Other Classification Models</h4>
<p>Logistic regression isn't the only option. Depending on the data and problem, you might also investigate:</p>
<ul>
<li><strong>Decision trees:</strong> learn a series of decision rules based on feature values.</li>
<li><strong>Random forests:</strong> combine predictions from multiple decision trees.</li>
<li><strong>Gradient boosting:</strong> build a sequence of models that aims to improve predictive performance.</li>
<li><strong>Support vector machines:</strong> identify decision boundaries that separate classes.</li>
<li><strong>Naive Bayes:</strong> use probabilistic assumptions to estimate class membership.</li>
</ul>
<p>Different models have different strengths, computational requirements, and interpretability. A more complex model isn't automatically better. Compare suitable models using the same data split and evaluation criteria, and avoid choosing a model based only on training performance.</p>
<p>So remember: Classification models learn from labeled historical examples to predict categories for new records. Their usefulness depends on the quality of the data, the timing of the features, the model choice, and how well the predictions are evaluated.</p>
<h3 id="heading-chapter-36-why-accuracy-can-be-misleading">Chapter 36: Why Accuracy Can Be Misleading</h3>
<p>Accuracy measures the proportion of predictions a classification model gets correct. It's easy to understand, but it can be misleading when the classes are imbalanced or when different mistakes have different business costs.</p>
<p>Suppose only 1% of customers churn. A model that predicts “not churned” for every customer would achieve approximately 99% accuracy. But it would fail to identify any of the customers who actually churn.</p>
<p>That model has high accuracy but may be practically useless if the purpose is to identify customers who need retention efforts.</p>
<p>To evaluate classification models more effectively, consider precision, recall, F1 score, ROC-AUC, and the confusion matrix.</p>
<h4 id="heading-the-confusion-matrix">The Confusion Matrix</h4>
<p>A confusion matrix compares predicted labels with the actual labels. For a binary classifier, it contains four outcomes:</p>
<ul>
<li><strong>True positives (TP):</strong> the model predicts the positive class, and the actual class is positive.</li>
<li><strong>True negatives (TN):</strong> the model predicts the negative class, and the actual class is negative.</li>
<li><strong>False positives (FP):</strong> the model predicts the positive class, but the actual class is negative.</li>
<li><strong>False negatives (FN):</strong> the model predicts the negative class, but the actual class is positive.</li>
</ul>
<p>For a churn model, a true positive is a customer correctly identified as someone who churns. A false positive is a customer incorrectly flagged as likely to churn. A false negative is a customer who churns but wasn't identified by the model.</p>
<p>These error types have different consequences. A false positive might cause the business to spend money on a retention offer for someone who would have stayed anyway. A false negative might mean the business misses an opportunity to reach a customer who is about to leave.</p>
<h4 id="heading-accuracy">Accuracy</h4>
<p>Accuracy measures the proportion of all predictions that are correct.</p>
<p>Accuracy = (TP + TN) ÷ (TP + TN + FP + FN)</p>
<p>It can be useful when the classes and error costs are reasonably balanced. But when one class is much more common than the other, accuracy may hide poor performance on the less common class.</p>
<h4 id="heading-precision">Precision</h4>
<p>Precision measures the proportion of predicted positives that are actually positive.</p>
<p>Precision = TP ÷ (TP + FP)</p>
<p>For a churn model, precision answers: “Of the customers the model flagged as likely to churn, what proportion actually churned?”</p>
<p>High precision can be valuable when contacting a customer is expensive or when false alarms waste limited campaign resources.</p>
<h4 id="heading-recall">Recall</h4>
<p>Recall measures the proportion of actual positives that the model correctly identifies.</p>
<p>Recall = TP ÷ (TP + FN)</p>
<p>For a churn model, recall answers: “Of all customers who actually churned, what proportion did the model identify?”</p>
<p>High recall may be important when missing a customer at risk of churn is particularly costly. But increasing recall can also increase false positives, depending on the model and decision threshold.</p>
<h4 id="heading-f1-score">F1 Score</h4>
<p>The F1 score combines precision and recall using their harmonic mean:</p>
<p>F1 = 2 × (Precision × Recall) ÷ (Precision + Recall)</p>
<p>It can be useful when both precision and recall matter. It doesn't account for true negatives directly, and it shouldn't be treated as the best metric for every business problem.</p>
<h4 id="heading-roc-auc">ROC-AUC</h4>
<p>ROC-AUC summarizes how well a model ranks positive examples above negative examples across different classification thresholds. A value closer to 1 indicates stronger ranking performance, while a value near 0.5 indicates performance similar to random ranking under the usual interpretation.</p>
<p>ROC-AUC doesn't tell you whether a particular threshold is appropriate for a marketing action. When positive cases are rare, precision-recall analysis may also provide useful insight. In either case, evaluate the model on data that wasn't used to train it.</p>
<h4 id="heading-calculating-the-metrics-in-python">Calculating the Metrics in Python</h4>
<p>You can calculate several of these metrics using scikit-learn:</p>
<pre><code class="language-python">from sklearn.metrics import (
    accuracy_score,
    precision_score,
    recall_score,
    f1_score,
    roc_auc_score,
    confusion_matrix
)

predictions = model.predict(X_test)

print("Accuracy:", accuracy_score(y_test, predictions))
print(
    "Precision:",
    precision_score(
        y_test, predictions, zero_division=0
    )
)
print(
    "Recall:",
    recall_score(
        y_test, predictions, zero_division=0
    )
)
print(
    "F1 score:",
    f1_score(
        y_test, predictions, zero_division=0
    )
)
print("Confusion matrix:")
print(confusion_matrix(y_test, predictions))
</code></pre>
<p>For ROC-AUC, use the model's probability estimates or decision scores rather than its final predicted labels:</p>
<pre><code class="language-python">probabilities = model.predict_proba(X_test)[:, 1]

print(
    "ROC-AUC:",
    roc_auc_score(y_test, probabilities)
)
</code></pre>
<p>This assumes the model supports <code>predict_proba()</code> and that the positive class is represented by the second probability column. Verify the class ordering for your specific model and target labels.</p>
<h4 id="heading-choosing-the-right-metric">Choosing the Right Metric</h4>
<p>There's no universally best classification metric. The appropriate choice depends on the objective, the class distribution, and the cost of different errors.</p>
<p>For example, a retention team with a limited budget may prioritize precision because it can contact only a small number of customers. Another team may prioritize recall if missing a high-risk customer is especially costly.</p>
<p>Consider the business decision the model supports before selecting a metric. A useful evaluation should explain not only how well the model performs but also whether its mistakes are acceptable for the intended use.</p>
<p>The key lesson here is this: accuracy is only one part of model evaluation. Precision, recall, F1, ROC-AUC, and the confusion matrix reveal different aspects of performance and help connect model quality to business consequences.</p>
<h3 id="heading-chapter-37-customer-segmentation-with-machine-learning">Chapter 37: Customer Segmentation With Machine Learning</h3>
<p>Rule-based segmentation groups customers using predefined conditions. Machine learning offers another approach: clustering. Clustering algorithms look for patterns in data and group observations that are similar according to the features and distance measures used.</p>
<p>For marketing teams, clustering may help explore groups of customers with similar purchasing behavior, spending levels, or engagement patterns. The resulting groups can provide starting points for further analysis, but they don't automatically represent meaningful customer types.</p>
<h4 id="heading-using-k-means-clustering">Using K-Means Clustering</h4>
<p>K-Means is a clustering algorithm that divides observations into a chosen number of clusters. It repeatedly assigns observations to cluster centers and updates those centers to reduce the within-cluster squared distances.</p>
<p>For this example, suppose the dataset already contains one row per customer and includes <code>recency</code>, <code>frequency</code>, and <code>monetary</code> columns.</p>
<pre><code class="language-python">from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler

features = df[
    [
        "recency",
        "frequency",
        "monetary"
    ]
].copy()

scaler = StandardScaler()

scaled_features = scaler.fit_transform(
    features
)

model = KMeans(
    n_clusters=4,
    random_state=42,
    n_init=10
)

df["segment"] = model.fit_predict(
    scaled_features
)
</code></pre>
<p>The example standardizes the three features before clustering. This matters because monetary values may be much larger numerically than recency or frequency. Without scaling, features with larger numeric ranges can dominate the distance calculations.</p>
<p>Standardization changes the scale of the input variables, but it doesn'tt make the variables equally important from a business perspective. If the data contains extreme values, you should also consider whether standard scaling is suitable and whether the features need additional preprocessing.</p>
<p>The <code>n_clusters=4</code> setting asks K-Means to produce four clusters. The algorithm assigns each customer a numeric label, which the code stores in the <code>segment</code> column.</p>
<h4 id="heading-cluster-numbers-are-identifiers-not-rankings">Cluster Numbers Are Identifiers, Not Rankings</h4>
<p>The labels <code>0</code>, <code>1</code>, <code>2</code>, and <code>3</code> are simply identifiers for the four groups. <strong>Cluster 0 isn't automatically better, more valuable, or more important than cluster 1.</strong></p>
<p>The numbers don't rank customer quality. If the model is rerun with different settings or data, the numeric labels may be assigned differently even when the overall group patterns are similar.</p>
<p>To understand what each cluster represents, summarize the original feature values for each group:</p>
<pre><code class="language-python">cluster_summary = (
    df.groupby("segment")
    .agg(
        customer_count=("segment", "size"),
        average_recency=("recency", "mean"),
        average_frequency=("frequency", "mean"),
        average_monetary=("monetary", "mean")
    )
    .round(2)
)

print(cluster_summary)
</code></pre>
<p>This summary lets you compare the typical behavior of customers in each cluster. One group might have more recent purchases and higher frequency, while another might contain customers with low frequency and long gaps since their last purchase.</p>
<p>Use those observed patterns to develop descriptive names if they're justified by the data. For example, a group with recent purchases and high frequency might be described as “frequent active customers.” A group with high recency values and previously high spending might be worth investigating for re-engagement.</p>
<p>Don't assign names based only on the cluster number. Inspect the actual values and make sure the description fits the group's behavior.</p>
<h4 id="heading-choosing-and-evaluating-clusters">Choosing and Evaluating Clusters</h4>
<p>The number of clusters is a modeling choice. Four clusters may be useful for one dataset but too many or too few for another. You can compare candidate values using methods such as the elbow method or silhouette score, alongside whether the resulting groups are interpretable and useful for the business.</p>
<p>Clustering results are also sensitive to the features, scaling method, outliers, and selected number of clusters. The groups aren't guaranteed to correspond to natural customer types, and different algorithms may produce different results.</p>
<p>The key lesson: clustering can reveal patterns that help you explore customer groups. The cluster labels themselves have no built-in meaning. Interpret each group by examining its features and validating whether the pattern is useful for the business.</p>
<h3 id="heading-chapter-38-feature-engineering">Chapter 38: Feature Engineering</h3>
<p>Machine learning models often become more useful when raw data is transformed into meaningful features.</p>
<p>Suppose you have:</p>
<pre><code class="language-text">purchase_date
</code></pre>
<p>Instead of giving the raw date directly to the model, you might create:</p>
<pre><code class="language-text">days_since_last_purchase
</code></pre>
<p>Similarly, instead of raw transaction records, you might calculate:</p>
<pre><code class="language-text">total_orders
average_order_value
total_spend
days_since_first_purchase
email_open_rate
</code></pre>
<p>These engineered features can better represent customer behavior.</p>
<p>Feature engineering is often one of the most important parts of a machine learning project.</p>
<h3 id="heading-chapter-39-avoiding-data-leakage">Chapter 39: Avoiding Data Leakage</h3>
<p>Data leakage occurs when information that wouldn't legitimately be available to a model at prediction time influences its training or evaluation. Leakage can make a model appear much more accurate than it will be when used with real, future data.</p>
<p>Imagine that you're building a model to predict whether a customer will make a purchase in the next 30 days. Your goal is to use information available today to estimate what the customer will do during the following month.</p>
<p>If you accidentally include the customer's actual purchase outcome from that future period as an input feature, the model receives information that wouldn't have been available when the prediction was supposed to be made. This makes the evaluation misleading.</p>
<h4 id="heading-an-example-of-data-leakage">An Example of Data Leakage</h4>
<p>Suppose the dataset contains these columns:</p>
<pre><code class="language-text">past_purchases
website_visits
purchased_next_30_days
</code></pre>
<p>The first two columns describe historical behavior. The last column records the outcome you want to predict.</p>
<p>The following code contains a leakage problem:</p>
<pre><code class="language-python"># Incorrect: the target is included as an input feature.
X = df[
    [
        "past_purchases",
        "website_visits",
        "purchased_next_30_days"
    ]
]

y = df["purchased_next_30_days"]
</code></pre>
<p>The target, <code>purchased_next_30_days</code>, appears in both <code>X</code> and <code>y</code>. The model is given the answer it's supposed to predict. It may achieve an extremely high score, but that score doesn't demonstrate that the model can predict future purchases from legitimate historical information.</p>
<p>This is an example of direct target leakage. Other forms of leakage can be less obvious, such as using information collected after the prediction date or preprocessing the entire dataset before splitting it into training and test sets.</p>
<h4 id="heading-fixing-the-leakage">Fixing the Leakage</h4>
<p>The solution is to exclude the target and any other information that wouldn't be available at prediction time from the input features.</p>
<pre><code class="language-python"># Correct: use only information available before prediction.
X = df[
    [
        "past_purchases",
        "website_visits"
    ]
]

y = df["purchased_next_30_days"]
</code></pre>
<p>Next, split the data into training and test sets:</p>
<pre><code class="language-python">from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score

X_train, X_test, y_train, y_test = train_test_split(
    X,
    y,
    test_size=0.2,
    random_state=42,
    stratify=y
)

model = RandomForestClassifier(
    random_state=42
)

model.fit(
    X_train,
    y_train
)

predictions = model.predict(
    X_test
)

print(
    "Accuracy:",
    accuracy_score(y_test, predictions)
)
</code></pre>
<p>This example is safer because the model receives only the two historical features specified in <code>X</code>. The future purchase outcome remains the target that the model is learning to predict.</p>
<p>But removing the target from the features is only one part of preventing leakage. You must also confirm that <code>past_purchases</code> and <code>website_visits</code> contain information recorded before the prediction date. If either column includes activity from the future 30-day outcome period, leakage can still occur.</p>
<h4 id="heading-preventing-leakage-during-preprocessing">Preventing Leakage During Preprocessing</h4>
<p>Leakage can also happen when preprocessing learns information from records that should be held back for evaluation. For example, if you calculate scaling parameters or fill missing values using the entire dataset before splitting it, information from the test set can influence the training process.</p>
<p>A safer pattern is to fit preprocessing steps using the training data only, then apply the learned transformations to the test data. Scikit-learn pipelines can help enforce this separation.</p>
<p>For time-dependent prediction problems, use a time-based split when appropriate: train using earlier observations and evaluate using later observations. This better reflects the information available when future predictions are made.</p>
<h4 id="heading-a-practical-leakage-checklist">A Practical Leakage Checklist</h4>
<p>Before trusting a model's evaluation, ask:</p>
<ul>
<li>Were all input features available at the intended prediction time?</li>
<li>Does any feature contain the target itself or a direct proxy for the outcome?</li>
<li>Were preprocessing steps fitted using training data only?</li>
<li>Does the train/test split reflect the real prediction setting?</li>
<li>Are records or customers duplicated across the split in a way that could inflate performance?</li>
<li>Is the evaluation based on genuinely unseen data?</li>
</ul>
<p>A surprisingly high score isn't automatically evidence of leakage, but it's a reason to investigate the features, data collection process, and evaluation design carefully.</p>
<p>The key lesson here: a model must be evaluated using only the information it could legitimately access when making a prediction. Preventing leakage helps ensure that reported performance is meaningful rather than artificially inflated.</p>
<h2 id="heading-part-viii-building-a-marketing-intelligence-system">Part VIII: Building a Marketing Intelligence System</h2>
<p>At this point, you've learned many individual techniques. Now we can combine them.</p>
<p>A marketing intelligence system shouldn't simply be a collection of unrelated Python scripts. It should have a logical workflow.</p>
<h3 id="heading-step-1-defining-the-business-questions">Step 1: Defining the Business Questions</h3>
<p>Before writing the system, you should define what it should answer.</p>
<p>For our capstone, we'll ask:</p>
<ol>
<li>How much revenue are our marketing campaigns generating?</li>
<li>Which channels are most efficient?</li>
<li>Which campaigns are performing best?</li>
<li>Which campaigns may need attention?</li>
<li>Which customers are most valuable?</li>
<li>Which customers may need re-engagement?</li>
<li>How is performance changing over time?</li>
<li>Where are customers dropping out of the funnel?</li>
<li>Are there meaningful customer segments?</li>
<li>Can machine learning identify customers at risk of churn?</li>
<li>Can the system automatically generate a report?</li>
<li>Can the system alert the marketing team when important metrics change?</li>
</ol>
<p>These questions determine the architecture of the project.</p>
<h3 id="heading-step-2-project-structure">Step 2: Project Structure</h3>
<p>A practical project can be organized like this:</p>
<pre><code class="language-text">marketing_intelligence/
    data/
        raw/
        processed/

    reports/

    notebooks/

    models/

    src/
        data_loader.py
        cleaning.py
        metrics.py
        customer_analysis.py
        campaign_analysis.py
        segmentation.py
        reporting.py
        alerts.py

    tests/

    main.py

    requirements.txt
</code></pre>
<p>You don't have to create this entire structure on day one. The purpose is to show how a larger project can eventually be organized.</p>
<h3 id="heading-step-3-data-loading-module">Step 3: Data Loading Module</h3>
<p>Create:</p>
<pre><code class="language-text">src/data_loader.py
</code></pre>
<p>Then:</p>
<pre><code class="language-python">import pandas as pd


def load_marketing_data(path):
    return pd.read_csv(path)
</code></pre>
<p>Now the main program can import it:</p>
<pre><code class="language-python">from src.data_loader import (
    load_marketing_data
)

df = load_marketing_data(
    "data/raw/marketing_data.csv"
)
</code></pre>
<p>This keeps data-loading logic separate from analysis logic.</p>
<h3 id="heading-step-4-data-cleaning-module">Step 4: Data Cleaning Module</h3>
<p>Create:</p>
<pre><code class="language-text">src/cleaning.py
</code></pre>
<p>Then:</p>
<pre><code class="language-python">import pandas as pd


def clean_marketing_data(df):
    df = df.copy()

    df = df.drop_duplicates()

    df["date"] = pd.to_datetime(
        df["date"],
        errors="coerce"
    )

    numeric_columns = [
        "impressions",
        "clicks",
        "conversions",
        "cost",
        "revenue"
    ]

    for column in numeric_columns:
        df[column] = pd.to_numeric(
            df[column],
            errors="coerce"
        )

    df["channel"] = (
        df["channel"]
        .str.strip()
        .str.lower()
    )

    return df
</code></pre>
<p>This function performs common cleaning tasks.</p>
<h3 id="heading-step-5-metrics-module">Step 5: Metrics Module</h3>
<p>Create:</p>
<pre><code class="language-text">src/metrics.py
</code></pre>
<p>Then:</p>
<pre><code class="language-python">def calculate_metrics(df):
    df = df.copy()

    df["ctr"] = (
        df["clicks"]
        .div(
            df["impressions"]
            .replace(0, None)
        )
        .mul(100)
    )

    df["conversion_rate"] = (
        df["conversions"]
        .div(
            df["clicks"]
            .replace(0, None)
        )
        .mul(100)
    )

    df["cpc"] = (
        df["cost"]
        .div(
            df["clicks"]
            .replace(0, None)
        )
    )

    df["cpa"] = (
        df["cost"]
        .div(
            df["conversions"]
            .replace(0, None)
        )
    )

    df["roas"] = (
        df["revenue"]
        .div(
            df["cost"]
            .replace(0, None)
        )
    )

    return df
</code></pre>
<p>Now your calculations live in one reusable location.</p>
<h3 id="heading-step-6-campaign-analysis-module">Step 6: Campaign Analysis Module</h3>
<p>Create:</p>
<pre><code class="language-text">src/campaign_analysis.py
</code></pre>
<p>Then:</p>
<pre><code class="language-python">def analyze_campaigns(df):
    summary = (
        df.groupby("campaign")
        .agg({
            "impressions": "sum",
            "clicks": "sum",
            "conversions": "sum",
            "cost": "sum",
            "revenue": "sum"
        })
    )

    summary["roas"] = (
        summary["revenue"] /
        summary["cost"]
    )

    summary["cpa"] = (
        summary["cost"] /
        summary["conversions"]
    )

    return summary.sort_values(
        "roas",
        ascending=False
    )
</code></pre>
<p>This produces a reusable campaign-performance table.</p>
<h3 id="heading-step-7-channel-analysis">Step 7: Channel Analysis</h3>
<pre><code class="language-python">def analyze_channels(df):
    summary = (
        df.groupby("channel")
        .agg({
            "impressions": "sum",
            "clicks": "sum",
            "conversions": "sum",
            "cost": "sum",
            "revenue": "sum"
        })
    )

    summary["roas"] = (
        summary["revenue"] /
        summary["cost"]
    )

    summary["cpa"] = (
        summary["cost"] /
        summary["conversions"]
    )

    return summary.sort_values(
        "roas",
        ascending=False
    )
</code></pre>
<p>Now campaign analysis and channel analysis are separated. That makes the project easier to maintain.</p>
<h3 id="heading-step-8-detecting-underperforming-campaigns">Step 8: Detecting Underperforming Campaigns</h3>
<p>Create a reusable rule:</p>
<pre><code class="language-python">def identify_underperforming_campaigns(
    campaign_summary,
    roas_threshold=1,
    conversion_threshold=2
):
    return campaign_summary[
        (campaign_summary["roas"] &lt; roas_threshold) &amp;
        (
            campaign_summary["conversion_rate"]
            &lt; conversion_threshold
        )
    ]
</code></pre>
<p>But do you notice an issue? Our campaign summary doesn't currently calculate conversion rate.</p>
<p>This is a good example of why building software requires testing your assumptions.</p>
<p>We can fix the summary:</p>
<pre><code class="language-python">def analyze_campaigns(df):
    summary = (
        df.groupby("campaign")
        .agg({
            "impressions": "sum",
            "clicks": "sum",
            "conversions": "sum",
            "cost": "sum",
            "revenue": "sum"
        })
    )

    summary["conversion_rate"] = (
        summary["conversions"] /
        summary["clicks"] *
        100
    )

    summary["roas"] = (
        summary["revenue"] /
        summary["cost"]
    )

    summary["cpa"] = (
        summary["cost"] /
        summary["conversions"]
    )

    return summary.sort_values(
        "roas",
        ascending=False
    )
</code></pre>
<p>This is an important development habit: <strong>Test each stage before building the next stage on top of it.</strong></p>
<h3 id="heading-step-9-building-the-customer-intelligence-layer">Step 9: Building the Customer Intelligence Layer</h3>
<p>The customer layer should summarize behavior at the customer level.</p>
<pre><code class="language-python">def analyze_customers(df):
    summary = (
        df.groupby("customer_id")
        .agg({
            "revenue": "sum",
            "conversions": "sum",
            "campaign": "count"
        })
        .rename(
            columns={
                "campaign":
                "purchase_activity"
            }
        )
    )

    summary["average_order_value"] = (
        summary["revenue"] /
        summary["purchase_activity"]
    )

    return summary
</code></pre>
<p>This gives the system a customer-level perspective.</p>
<h3 id="heading-step-10-identifying-high-value-customers">Step 10: Identifying High-Value Customers</h3>
<p>We can create a simple rule:</p>
<pre><code class="language-python">def identify_high_value_customers(
    customer_summary,
    threshold=5000
):
    return customer_summary[
        customer_summary["revenue"]
        &gt;= threshold
    ]
</code></pre>
<p>Again, the threshold isn't universal.</p>
<p>A $5,000 threshold might be appropriate for one company and absurd for another.</p>
<p>A strong marketing intelligence system should make important thresholds configurable.</p>
<h3 id="heading-step-11-the-recommendation-engine">Step 11: The Recommendation Engine</h3>
<p>Now we can create recommendations.</p>
<pre><code class="language-python">def generate_channel_recommendation(
    row
):
    if row["roas"] &gt;= 4:
        return (
            "Strong performance. "
            "Investigate opportunities "
            "to scale efficiently."
        )

    if row["roas"] &gt;= 2:
        return (
            "Moderate performance. "
            "Continue monitoring and "
            "test optimization opportunities."
        )

    return (
        "Low return. Review targeting, "
        "creative, costs, and conversion "
        "performance before increasing spend."
    )
</code></pre>
<p>Apply it:</p>
<pre><code class="language-python">channel_summary[
    "recommendation"
] = channel_summary.apply(
    generate_channel_recommendation,
    axis=1
)
</code></pre>
<p>This is a basic rule-based intelligence layer.</p>
<p>It doesn't pretend that Python knows the perfect marketing strategy.</p>
<p>Instead, it translates predefined analytical conditions into useful prompts for human decision-makers.</p>
<h2 id="heading-capstone-project-build-a-python-marketing-intelligence-platform">Capstone Project: Build a Python Marketing Intelligence Platform</h2>
<p>The capstone project is the final application that brings the entire book together.</p>
<p>You're going to build a Python-based system that can take raw marketing data and transform it into a structured intelligence report.</p>
<p>The finished system will combine:</p>
<ul>
<li>Python fundamentals</li>
<li>pandas</li>
<li>Data cleaning</li>
<li>Marketing KPIs</li>
<li>Campaign analytics</li>
<li>Channel analytics</li>
<li>Customer analytics</li>
<li>RFM segmentation</li>
<li>Cohort analysis</li>
<li>Funnel analysis</li>
<li>Visualization</li>
<li>Automated alerts</li>
<li>Machine learning</li>
<li>Report generation</li>
<li>Automation</li>
</ul>
<p>The goal isn't to create a fictional "AI marketing platform" that magically knows what customers want. The goal is to build a realistic analytical pipeline.</p>
<h3 id="heading-capstone-objective">Capstone Objective</h3>
<p>The system should be able to answer:</p>
<blockquote>
<p>"What is happening in our marketing data, which areas deserve attention, and what evidence can we provide to support the next decision?"</p>
</blockquote>
<p>That's the central question behind the entire project.</p>
<h3 id="heading-step-1-create-the-dataset">Step 1: Create the Dataset</h3>
<p>For learning purposes, we can generate synthetic data like this:</p>
<pre><code class="language-python">import random
import pandas as pd

random.seed(42)

campaigns = [
    "Spring Sale",
    "Summer Sale",
    "Back to School",
    "Holiday Sale"
]

channels = [
    "Email",
    "Search",
    "Social Media",
    "Display"
]

rows = []

for _ in range(5000):
    impressions = random.randint(
        1000,
        50000
    )

    clicks = random.randint(
        20,
        5000
    )

    conversions = random.randint(
        0,
        500
    )

    cost = round(
        random.uniform(
            100,
            5000
        ),
        2
    )

    revenue = round(
        random.uniform(
            100,
            15000
        ),
        2
    )

    rows.append({
        "customer_id": random.randint(
            1,
            1000
        ),
        "campaign": random.choice(
            campaigns
        ),
        "channel": random.choice(
            channels
        ),
        "impressions": impressions,
        "clicks": clicks,
        "conversions": conversions,
        "cost": cost,
        "revenue": revenue
    })

df = pd.DataFrame(rows)

df.to_csv(
    "marketing_data.csv",
    index=False
)
</code></pre>
<p>This gives us a starting dataset.</p>
<h3 id="heading-step-2-load-the-data">Step 2: Load the Data</h3>
<pre><code class="language-python">df = pd.read_csv(
    "marketing_data.csv"
)
</code></pre>
<p>Immediately inspect it:</p>
<pre><code class="language-python">print(df.head())
print(df.shape)
print(df.info())
</code></pre>
<h3 id="heading-step-3-validate-the-data">Step 3: Validate the Data</h3>
<p>Check missing values:</p>
<pre><code class="language-python">print(
    df.isnull().sum()
)
</code></pre>
<p>Check duplicates:</p>
<pre><code class="language-python">print(
    df.duplicated().sum()
)
</code></pre>
<p>Check channels:</p>
<pre><code class="language-python">print(
    df["channel"].value_counts()
)
</code></pre>
<p>Check campaigns:</p>
<pre><code class="language-python">print(
    df["campaign"].value_counts()
)
</code></pre>
<p>The goal is to understand what entered the system.</p>
<h3 id="heading-step-4-clean-the-data">Step 4: Clean the Data</h3>
<pre><code class="language-python">df = df.drop_duplicates()

numeric_columns = [
    "impressions",
    "clicks",
    "conversions",
    "cost",
    "revenue"
]

for column in numeric_columns:
    df[column] = pd.to_numeric(
        df[column],
        errors="coerce"
    )

df["channel"] = (
    df["channel"]
    .str.strip()
    .str.lower()
)
</code></pre>
<p>Now the data is ready for the analytical layer.</p>
<h3 id="heading-step-5-calculate-kpis">Step 5: Calculate KPIs</h3>
<pre><code class="language-python">df["ctr"] = (
    df["clicks"] /
    df["impressions"] *
    100
)

df["conversion_rate"] = (
    df["conversions"] /
    df["clicks"] *
    100
)

df["cpc"] = (
    df["cost"] /
    df["clicks"]
)

df["cpa"] = (
    df["cost"] /
    df["conversions"]
)

df["roas"] = (
    df["revenue"] /
    df["cost"]
)
</code></pre>
<p>In the production version, we should protect every division from zero values.</p>
<h3 id="heading-step-6-build-the-channel-report">Step 6: Build the Channel Report</h3>
<pre><code class="language-python">channel_summary = (
    df.groupby("channel")
    .agg({
        "impressions": "sum",
        "clicks": "sum",
        "conversions": "sum",
        "cost": "sum",
        "revenue": "sum"
    })
)
</code></pre>
<p>Then:</p>
<pre><code class="language-python">channel_summary["ctr"] = (
    channel_summary["clicks"] /
    channel_summary["impressions"] *
    100
)

channel_summary["conversion_rate"] = (
    channel_summary["conversions"] /
    channel_summary["clicks"] *
    100
)

channel_summary["roas"] = (
    channel_summary["revenue"] /
    channel_summary["cost"]
)

channel_summary["cpa"] = (
    channel_summary["cost"] /
    channel_summary["conversions"]
)
</code></pre>
<p>Sort it:</p>
<pre><code class="language-python">channel_summary = (
    channel_summary
    .sort_values(
        "roas",
        ascending=False
    )
)
</code></pre>
<h3 id="heading-step-7-build-the-campaign-report">Step 7: Build the Campaign Report</h3>
<pre><code class="language-python">campaign_summary = (
    df.groupby("campaign")
    .agg({
        "impressions": "sum",
        "clicks": "sum",
        "conversions": "sum",
        "cost": "sum",
        "revenue": "sum"
    })
)
</code></pre>
<p>Then calculate:</p>
<pre><code class="language-python">campaign_summary["ctr"] = (
    campaign_summary["clicks"] /
    campaign_summary["impressions"] *
    100
)

campaign_summary["conversion_rate"] = (
    campaign_summary["conversions"] /
    campaign_summary["clicks"] *
    100
)

campaign_summary["roas"] = (
    campaign_summary["revenue"] /
    campaign_summary["cost"]
)

campaign_summary["cpa"] = (
    campaign_summary["cost"] /
    campaign_summary["conversions"]
)
</code></pre>
<p>Now you can rank campaigns by performance.</p>
<pre><code class="language-python">campaign_summary.sort_values(
    "roas",
    ascending=False
)
</code></pre>
<h3 id="heading-step-8-build-the-customer-report">Step 8: Build the Customer Report</h3>
<pre><code class="language-python">customer_summary = (
    df.groupby("customer_id")
    .agg({
        "revenue": "sum",
        "conversions": "sum",
        "campaign": "count"
    })
)
</code></pre>
<p>Rename the activity column:</p>
<pre><code class="language-python">customer_summary = (
    customer_summary
    .rename(
        columns={
            "campaign":
            "purchase_activity"
        }
    )
)
</code></pre>
<p>Calculate average value:</p>
<pre><code class="language-python">customer_summary[
    "average_order_value"
] = (
    customer_summary["revenue"] /
    customer_summary[
        "purchase_activity"
    ]
)
</code></pre>
<h3 id="heading-step-9-customer-segmentation">Step 9: Customer Segmentation</h3>
<p>Create RFM-style measurements.</p>
<pre><code class="language-python">rfm = customer_summary.copy()

rfm["frequency"] = (
    rfm["purchase_activity"]
)

rfm["monetary"] = (
    rfm["revenue"]
)
</code></pre>
<p>If your dataset contains actual purchase dates, add recency:</p>
<pre><code class="language-python">today = pd.Timestamp(
    "2026-09-05"
)

last_purchase = (
    df.groupby("customer_id")[
        "purchase_date"
    ].max()
)

rfm["recency"] = (
    today -
    last_purchase
).dt.days
</code></pre>
<p>Then rank customers.</p>
<pre><code class="language-python">rfm["monetary_score"] = pd.qcut(
    rfm["monetary"],
    5,
    labels=False,
    duplicates="drop"
) + 1
</code></pre>
<p>The same concept can be applied to frequency and recency.</p>
<h3 id="heading-step-10-create-customer-segments">Step 10: Create Customer Segments</h3>
<p>You could define simple behavioral groups.</p>
<p>For example:</p>
<pre><code class="language-python">def classify_customer(row):
    if (
        row["monetary"] &gt;= 5000 and
        row["frequency"] &gt;= 5
    ):
        return "High Value"

    if row["frequency"] &gt;= 5:
        return "Frequent"

    if row["monetary"] &gt;= 5000:
        return "High Spending"

    return "Developing"
</code></pre>
<p>Then:</p>
<pre><code class="language-python">rfm["segment"] = (
    rfm.apply(
        classify_customer,
        axis=1
    )
)
</code></pre>
<p>Summarize:</p>
<pre><code class="language-python">segment_summary = (
    rfm.groupby("segment")
    .agg({
        "monetary": "mean",
        "frequency": "mean"
    })
)
</code></pre>
<p>Now the marketing team can see the characteristics of each segment.</p>
<h3 id="heading-step-11-build-the-funnel">Step 11: Build the Funnel</h3>
<p>Add funnel information to your dataset.</p>
<p>For example:</p>
<pre><code class="language-python">funnel = {
    "Visitors": 50000,
    "Product Views": 32000,
    "Cart Adds": 9000,
    "Checkouts": 4500,
    "Purchases": 2700
}
</code></pre>
<p>Calculate stage-to-stage conversion:</p>
<pre><code class="language-python">funnel_rates = {}

previous = None

for stage, value in funnel.items():

    if previous is None:
        funnel_rates[stage] = 100
    else:
        funnel_rates[stage] = (
            value /
            previous *
            100
        )

    previous = value
</code></pre>
<p>This creates a simple funnel analysis.</p>
<h3 id="heading-step-12-create-visualizations">Step 12: Create Visualizations</h3>
<p>Revenue by channel:</p>
<pre><code class="language-python">import matplotlib.pyplot as plt

channel_summary[
    "revenue"
].plot(
    kind="bar"
)

plt.title(
    "Revenue by Marketing Channel"
)

plt.xlabel("Channel")
plt.ylabel("Revenue")

plt.tight_layout()
plt.show()
</code></pre>
<p>ROAS by channel:</p>
<pre><code class="language-python">channel_summary[
    "roas"
].plot(
    kind="bar"
)

plt.title(
    "ROAS by Marketing Channel"
)

plt.xlabel("Channel")
plt.ylabel("ROAS")

plt.tight_layout()
plt.show()
</code></pre>
<p>Customer value distribution:</p>
<pre><code class="language-python">plt.hist(
    rfm["monetary"],
    bins=30
)

plt.title(
    "Customer Monetary Value"
)

plt.xlabel("Customer Revenue")
plt.ylabel("Customers")

plt.tight_layout()
plt.show()
</code></pre>
<h3 id="heading-step-13-create-performance-alerts">Step 13: Create Performance Alerts</h3>
<p>Suppose ROAS below 1 is considered a warning.</p>
<pre><code class="language-python">alerts = []

for channel, row in (
    channel_summary.iterrows()
):

    if row["roas"] &lt; 1:
        alerts.append(
            f"{channel}: ROAS is below 1."
        )
</code></pre>
<p>Display the alerts:</p>
<pre><code class="language-python">for alert in alerts:
    print(alert)
</code></pre>
<p>You could also identify sudden changes in conversion rate or revenue.</p>
<h3 id="heading-step-14-create-recommendations">Step 14: Create Recommendations</h3>
<pre><code class="language-python">recommendations = []

for channel, row in (
    channel_summary.iterrows()
):

    if row["roas"] &gt;= 4:
        recommendations.append(
            f"{channel}: Strong ROAS. "
            "Investigate whether the channel "
            "can be scaled efficiently."
        )

    elif row["roas"] &lt; 1:
        recommendations.append(
            f"{channel}: ROAS is below break-even. "
            "Review targeting, creative, "
            "costs, and conversion performance."
        )

    else:
        recommendations.append(
            f"{channel}: Moderate performance. "
            "Continue testing and optimization."
        )
</code></pre>
<p>This gives the final report an interpretation layer.</p>
<h3 id="heading-step-15-add-machine-learning">Step 15: Add Machine Learning</h3>
<p>Once the analytical system works, we can add a predictive layer.</p>
<p>Suppose the dataset contains a <code>churned</code> column.</p>
<p>Select features:</p>
<pre><code class="language-python">features = [
    "purchase_frequency",
    "total_spend",
    "email_opens",
    "website_sessions"
]

X = df[features]
y = df["churned"]
</code></pre>
<p>Split:</p>
<pre><code class="language-python">from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = (
    train_test_split(
        X,
        y,
        test_size=0.2,
        random_state=42
    )
)
</code></pre>
<p>Train:</p>
<pre><code class="language-python">from sklearn.linear_model import LogisticRegression

model = LogisticRegression(
    max_iter=1000
)

model.fit(
    X_train,
    y_train
)
</code></pre>
<p>Predict:</p>
<pre><code class="language-python">predictions = model.predict(
    X_test
)
</code></pre>
<p>Evaluate:</p>
<pre><code class="language-python">from sklearn.metrics import classification_report

print(
    classification_report(
        y_test,
        predictions
    )
)
</code></pre>
<p>The model now becomes an additional layer of intelligence.</p>
<h3 id="heading-step-16-export-the-report">Step 16: Export the Report</h3>
<pre><code class="language-python">with pd.ExcelWriter(
    "marketing_intelligence_report.xlsx"
) as writer:

    df.to_excel(
        writer,
        sheet_name="Processed Data",
        index=False
    )

    channel_summary.to_excel(
        writer,
        sheet_name="Channels"
    )

    campaign_summary.to_excel(
        writer,
        sheet_name="Campaigns"
    )

    customer_summary.to_excel(
        writer,
        sheet_name="Customers"
    )

    rfm.to_excel(
        writer,
        sheet_name="Segments"
    )
</code></pre>
<p>Now the system produces a reusable report.</p>
<h3 id="heading-step-17-turn-the-project-into-a-pipeline">Step 17: Turn the Project Into a Pipeline</h3>
<p>The final step is combining everything.</p>
<p>The main program should eventually look conceptually like:</p>
<pre><code class="language-python">from src.data_loader import (
    load_marketing_data
)

from src.cleaning import (
    clean_marketing_data
)

from src.metrics import (
    calculate_metrics
)

from src.campaign_analysis import (
    analyze_campaigns
)

from src.channel_analysis import (
    analyze_channels
)

from src.customer_analysis import (
    analyze_customers
)


def main():

    df = load_marketing_data(
        "data/raw/marketing_data.csv"
    )

    df = clean_marketing_data(df)

    df = calculate_metrics(df)

    campaigns = analyze_campaigns(
        df
    )

    channels = analyze_channels(
        df
    )

    customers = analyze_customers(
        df
    )

    print(
        "Marketing intelligence analysis "
        "completed."
    )


if __name__ == "__main__":
    main()
</code></pre>
<p>This is the direction we want the capstone to reach.</p>
<p>Instead of one enormous notebook containing hundreds of disconnected cells, the system becomes a collection of reusable components.</p>
<h3 id="heading-what-makes-this-a-marketing-intelligence-system">What Makes This a Marketing Intelligence System?</h3>
<p>At this point, it's worth stepping back. We haven't just created a report. The system can do a whole bunch of things, like:</p>
<ul>
<li>Ingest data</li>
<li>Validate data</li>
<li>Clean data</li>
<li>Transform data</li>
<li>Calculate KPIs</li>
<li>Analyze channels</li>
<li>Analyze campaigns</li>
<li>Analyze customers</li>
<li>Segment customers</li>
<li>Examine funnels</li>
<li>Detect problems</li>
<li>Generate recommendations</li>
<li>Run predictive models</li>
<li>Export reports</li>
</ul>
<p>That combination is what makes the project an intelligence system rather than a simple analytics script.</p>
<p>The system takes raw information and creates a structured process for turning that information into decisions.</p>
<h3 id="heading-what-the-system-still-cant-do">What the System Still Can't Do</h3>
<p>Even a sophisticated marketing intelligence system has limitations.</p>
<ul>
<li>It can't automatically understand every reason a campaign succeeded.</li>
<li>It can't know whether a customer is happy simply because they purchased.</li>
<li>It can't guarantee that a machine learning prediction is correct.</li>
<li>It can't determine the perfect marketing strategy without business context.</li>
<li>It can't replace marketers.</li>
</ul>
<p>Instead, it provides evidence. That distinction should remain at the center of the project.</p>
<h3 id="heading-the-final-challenge">The Final Challenge</h3>
<p>Once you complete the basic capstone, there are various ways you can improve it. You could:</p>
<ul>
<li>Add a database</li>
<li>Connect an API</li>
<li>Add automated scheduling</li>
<li>Create a dashboard</li>
<li>Add cohort analysis</li>
<li>Improve the RFM segmentation</li>
<li>Train a churn model</li>
<li>Add model evaluation</li>
<li>Create automated alerts</li>
<li>Generate a PDF report</li>
<li>Send authorized notifications</li>
<li>Add unit tests</li>
<li>Create configuration files so thresholds can be changed without modifying the source code</li>
</ul>
<p>Eventually, the project should become something that could realistically serve as the foundation of an internal marketing analytics tool.</p>
<p>That's the real purpose of the capstone. It demonstrates that you can take the individual techniques learned throughout this book and combine them into a coherent system.</p>
<h2 id="heading-conclusion-next-steps">Conclusion / Next Steps</h2>
<p>Learning Python for marketing doesn't mean that you have to memorize Python. It just means that you need to learn to think differently about marketing problems.</p>
<p>A spreadsheet can tell you what happened, but Python can help you investigate why. An analytics dashboard can show that revenue fell, but a Python workflow can help determine which channel, campaign, customer segment, or time period contributed to the change. A manual report can summarize the past, but an automated intelligence system can continuously monitor what's happening and bring important changes to someone's attention.</p>
<p>That progression is the real opportunity.</p>
<h3 id="heading-continue-beyond-the-capstone">Continue Beyond the Capstone</h3>
<p>The capstone shouldn't be the final project you ever build. It should be the project that gives you enough confidence to build the next one.</p>
<p>Take the system apart, understand every function, change the metrics, and break the code intentionally.</p>
<p>Try different datasets, add features, and remove features.</p>
<p>Test your assumptions, then rebuild it. The goal is to develop the ability to solve new problems.</p>
<h3 id="heading-build-a-marketing-analytics-portfolio">Build a Marketing Analytics Portfolio</h3>
<p>Once you're comfortable with Python, consider building several smaller projects.</p>
<p>For example:</p>
<ol>
<li><strong>Campaign Performance Analyzer:</strong> Create a program that imports campaign data and automatically calculates KPIs.</li>
<li><strong>Customer Segmentation Tool:</strong> Build an RFM analysis system that categorizes customers based on behavior.</li>
<li><strong>Marketing Funnel Analyzer:</strong> Analyze where users drop out of a conversion process.</li>
<li><strong>A/B Testing Calculator:</strong> Create a tool that compares two experiment groups and reports relevant statistical measurements.</li>
<li><strong>Marketing Report Generator:</strong> Automatically generate a recurring marketing report.</li>
<li><strong>Customer Churn Predictor:</strong> Train a machine learning model that identifies customers who may be at risk of churning.</li>
</ol>
<p>Each project demonstrates a different skill. But together, they create a portfolio that shows you understand more than Python syntax.</p>
<h3 id="heading-keep-the-business-question-first">Keep the Business Question First</h3>
<p>One of the easiest mistakes to make when learning technology is starting with the tool.</p>
<p>You might think: "I learned pandas. What can I do with pandas?"</p>
<p>Instead ask: "What marketing problem could pandas help me solve?"</p>
<p>The same applies to machine learning.</p>
<p>Don't begin with: "I want to use machine learning."</p>
<p>Begin with: "We need to predict which customers are likely to churn."</p>
<p>Then determine whether machine learning is actually appropriate.</p>
<p>Technology should support the problem. The problem shouldn't exist simply to justify the technology.</p>
<h3 id="heading-data-literacy-is-a-marketing-skill">Data Literacy Is a Marketing Skill</h3>
<p>You don't need to become a data scientist to benefit from data literacy.</p>
<p>You should be comfortable asking:</p>
<ul>
<li>Where did this number come from?</li>
<li>What exactly does this metric measure?</li>
<li>What is the denominator?</li>
<li>How was the data collected?</li>
<li>What's missing?</li>
<li>Could there be bias?</li>
<li>Is this correlation or causation?</li>
<li>Is the sample large enough?</li>
<li>Does this result actually matter to the business?</li>
</ul>
<p>These questions are often more important than knowing another Python library.</p>
<h3 id="heading-python-gives-you-leverage">Python Gives You Leverage</h3>
<p>A marketer who can analyze a dataset manually can produce an analysis. But a marketer who can write Python can potentially turn that analysis into a reusable process.</p>
<p>Instead of analyzing one report, they can analyze hundreds. Instead of manually calculating a metric, they can build a function. Instead of manually checking performance every morning, they can create an automated monitoring system. Instead of simply reporting what happened, they can build models that help estimate what might happen next.</p>
<p>That's leverage.</p>
<h3 id="heading-the-future-of-marketing-analytics">The Future of Marketing Analytics</h3>
<p>Marketing technology will continue to change, new platforms will appear, and existing APIs will change.</p>
<p>Machine learning models will improve, and artificial intelligence will become increasingly integrated into marketing workflows.</p>
<p>But the fundamental skills will remain valuable: understanding data, asking good questions, designing experiments, interpreting results, writing reliable code, communicating insights, thinking critically about predictions, and protecting customer information.</p>
<p>These skills aren't tied to one specific platform.</p>
<h3 id="heading-final-thoughts">Final Thoughts</h3>
<p>You don't need to become a programmer before you can use Python. Start with one problem, find the data, write a small program, make a mistake, and fix it. Then make the program better.</p>
<p>Eventually, those small programs become workflows, those workflows become systems, and those systems can become powerful tools for understanding customers, improving campaigns, automating repetitive work, and making better decisions.</p>
<p>Python is the tool, marketing is the context, and data is the evidence. The real skill is connecting all three.</p>
<p>Happy coding!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Beginner’s Guide to Cloud Data Analytics ]]>
                </title>
                <description>
                    <![CDATA[ If you want to transform your career and become a data-driven decision maker, this course is for you. freeCodeCamp.org just published a comprehensive Google Cloud Data Analytics course on our YouTube channel. The course was developed by Google Cloud ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/beginners-guide-to-cloud-data-analytics/</link>
                <guid isPermaLink="false">685162a7b5948514b5ab9308</guid>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Tue, 17 Jun 2025 12:42:15 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1749071398844/dd78731e-80d1-4835-bc2b-cbec1ba9a9d3.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you want to transform your career and become a data-driven decision maker, this course is for you. freeCodeCamp.org just published a comprehensive <a target="_blank" href="https://youtu.be/GAdgTK2Esn4">Google Cloud Data Analytics course</a> on our YouTube channel. The course was developed by Google Cloud and helps people earn the Google Cloud Data Analytics Certificate.</p>
<h3 id="heading-why-learn-data-analytics-with-google-cloud">Why Learn Data Analytics with Google Cloud?</h3>
<p>Turning raw numbers into actionable insights is a skill that sets you apart in the job market. As a Cloud Data Analyst, you’ll be able to unlock the stories hidden within massive datasets, helping organizations make smarter, faster decisions.</p>
<p>This course will help you enter that world. It offers a blend of expert instruction, hands-on labs, and real-world projects that will help you build a portfolio to impress employers.</p>
<h3 id="heading-whats-in-the-course">What’s In the Course?</h3>
<p>This course is a carefully curated program developed by Google Cloud, designed to take you from beginner to job-ready. You’ll learn technical skills like SQL, data visualization, and cloud storage. And you’ll also learn how to communicate your findings and drive business impact.</p>
<p>The course is structured to help you build a portfolio of industry-relevant projects, so you can showcase your expertise to potential employers.</p>
<p>Here’s what you’ll learn:</p>
<p><strong>1. Introduction to Data Analytics in Google Cloud</strong><br>Get a solid foundation in cloud data analysis. You’ll define the field, explore the roles and responsibilities of a cloud data analyst, and understand how data analytics drives business value. This module sets the stage for your journey, introducing you to the tools and concepts you’ll use throughout the program.</p>
<p><strong>2. Data Management and Storage in the Cloud</strong><br>Dive into how data is structured, organized, and stored in the cloud. You’ll get hands-on with data lakehouse architecture and tools like BigQuery, learning how to manage data efficiently and securely. This section is crucial for understanding how to handle large-scale datasets in a modern cloud environment.</p>
<p><strong>3. Data Transformation in the Cloud</strong><br>Follow the journey of data from collection to insight. You’ll learn to use SQL and other tools to clean, transform, and prepare data for analysis. By mastering data transformation, you’ll be able to turn messy, raw data into clean, usable information.</p>
<p><strong>4. The Power of Storytelling: How to Visualize Data in the Cloud</strong><br>Master the art of data visualization. This course teaches you how to turn complex data into clear, compelling stories using cloud-based visualization tools, making your insights accessible to any audience. You’ll learn the five key stages of visualizing data in the cloud, from planning to building impactful dashboards.</p>
<p><strong>5. Put It All Together: Prepare for a Cloud Data Analyst Job</strong><br>Apply everything you’ve learned in a capstone project that simulates real-world challenges. You’ll combine your skills in analysis, visualization, and communication to solve a comprehensive data problem, building a portfolio piece that demonstrates your ability to analyze, visualize, and communicate data insights.</p>
<h3 id="heading-learn-by-doing">Learn by Doing</h3>
<p>The course is designed to be watched alongside <a target="_blank" href="https://www.cloudskillsboost.google/paths/420">the Google Cloud Skills Boost platform</a>, where you’ll find interactive labs and practice environments. You get 35 free credits per month for labs, and if you want to move faster, you can pay for unlimited access. These labs give you the chance to practice your skills in real cloud environments, reinforcing your learning with practical experience. Complete the program and you’ll earn a Google Cloud Data Analytics Certificate.</p>
<h3 id="heading-start-your-journey-today">Start Your Journey Today</h3>
<p>Whether you’re just starting out or looking to advance your career, this course is for anyone who wants to harness the power of data. If you’re interested in technology, business, or problem-solving, this course will give you the tools you need to succeed in the fast-growing field of data analytics.</p>
<p>Watch the <a target="_blank" href="https://youtu.be/GAdgTK2Esn4">full course on the freeCodeCamp.org YouTube channel</a> and begin your journey into cloud data analytics (10-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/GAdgTK2Esn4" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is a Kalman Filter? How to Simplify Noisy Data in Navigation and Finance ]]>
                </title>
                <description>
                    <![CDATA[ In a world where precision is key, handling noisy data effectively is crucial for solving complex problems. Whether you're trying to control a rocket or forecast the stock market, the ability to get good data from an uncertain environment is importan... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-a-kalman-filter-with-python-code-examples/</link>
                <guid isPermaLink="false">66ba5353f77647345442b9d5</guid>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Data Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tiago Capelo Monteiro ]]>
                </dc:creator>
                <pubDate>Wed, 07 Aug 2024 13:42:54 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/08/pexels-skitterphoto-63901.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In a world where precision is key, handling noisy data effectively is crucial for solving complex problems.</p>
<p>Whether you're trying to control a rocket or forecast the stock market, the ability to get good data from an uncertain environment is important.</p>
<p>This is exactly the problem Kalman filters help solve. Kalman filters offer a solution that help you deal with noisy data in many fields.</p>
<p>In this article, we'll discuss:</p>
<ul>
<li><a class="post-section-overview" href="#heading-driving-through-fog-kalman-filters-as-your-headlights">Driving Through Fog: Kalman Filters as Your Headlights</a></li>
<li><a class="post-section-overview" href="#heading-what-are-kalman-filters">What are Kalman Filters?</a></li>
<li><a class="post-section-overview" href="#heading-kalman-filters-in-action-a-step-by-step-code-tutorial">Kalman Filters in Action: A Step-by-Step Code Example</a></li>
<li><a class="post-section-overview" href="#heading-conclusion-navigating-nonlinear-data-with-advanced-techniques">Conclusion: Navigating Nonlinear Data with Advanced Techniques</a></li>
</ul>
<h2 id="Driving">Driving Through Fog: Kalman Filters as Your Headlights</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/08/pexels-eberhardgross-1287075.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by eberhard grossgasteiger: https://www.pexels.com/photo/forest-under-clouds-1287075/</em></p>
<p>Imagine you are driving through a dense fog with limited visibility.</p>
<p>To reach the destination, you rely on your senses and your car's navigation system that combines real-time data with a predetermined map.</p>
<p>As you move, the car navigation system is always constantly adjusting to get the destination, and you are always relying on your senses to drive the car well.</p>
<p>This process is very similar to how a Kalman Filter works.</p>
<p>It is constantly updating, and it refines estimates based on incoming data. Even though that data is full of noise and uncertainty.</p>
<p>By integrating past information with current information, a Kalman Filter gives you a clear picture of where you are and where you're headed.</p>
<h2 id="heading-what-are-kalman-filters">What are Kalman Filters?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/08/pexels-mikebirdy-170811.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by <a target="_blank" href="https://www.pexels.com/photo/blue-bmw-sedan-near-green-lawn-grass-170811/">Mike Bird on Pexels</a></em></p>
<p>A Kalman filter is a math algorithm used to find the state of a dynamic system from many noisy measurements.</p>
<p>It is often used for systems that change over time – like tracking the position of a moving object.</p>
<h3 id="heading-how-does-a-kalman-filter-work">How Does a Kalman Filter Work?</h3>
<p>The Kalman filter predicts your current state based on past data, like the map and your previous location.</p>
<p>When new data appears, like new GPS signals, the filter compares the new data with its prediction and adjusts its estimate.</p>
<p>Even if the data is noisy, the Kalman filter uses a smart averaging process to improve the estimation. Like how you balance what your navigation system tells you and what you see on the road.</p>
<p>By always integrating new data with past data, Kalman filters help you know where you are and where you are going. This way, it is possible to predict things even in uncertain conditions.</p>
<h3 id="heading-why-are-kalman-filters-used-in-engineering">Why are Kalman Filters used in engineering?</h3>
<p>Since Kalman filters are able to handle incomplete data, they are widely used to make good predictions even when the measurements are not certain.</p>
<p>This makes them very useful for:</p>
<ul>
<li><strong>Navigation Systems</strong>: Estimating the position and velocity of vehicles.</li>
<li><strong>Robotics</strong>: Helping robots understand their environment and position.</li>
<li><strong>Finance</strong>: Filtering out noise from stock price data to predict trends.</li>
</ul>
<p>This way, they are very adaptive and can process real-time information</p>
<h3 id="heading-what-problem-did-kalman-filters-solve">What problem did Kalman Filters solve?</h3>
<p>Kalman filters were developed by Rudolf Kalman in the early 1960s to solve the problem of managing uncertainty and noise in data</p>
<p>Nowadays, they are great for extracting meaningful information from noisy data.</p>
<p>Mathematically, Kalman Filters are called linear quadratic estimators.</p>
<p>This is because, in the process of estimating the future based on current and past data, Kalman filters use:</p>
<ul>
<li>Linear algebra: The study of vectors and matrices used to solve linear equations.</li>
<li>Quadratic optimization: Finding the optimal solution for problems with squared terms</li>
</ul>
<h2 id="Kalman">Kalman Filters in Action: A Step-by-Step Code Tutorial</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/08/pexels-captainsopon-3402846.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by capt.sopon: https://www.pexels.com/photo/gray-airplane-control-panel-3402846/</em></p>
<p>Kalman Filters were created to handle linear systems – that is, systems that follow predictable patterns.</p>
<p>In this code example, we will implement an Extended Kalman Filter. This is a variant that was created to handle non-linear data (in other words, systems that have unpredictable or changing patterns).</p>
<p>Here's the full code (which we'll break down below):</p>
<pre><code><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> filterpy.kalman <span class="hljs-keyword">import</span> ExtendedKalmanFilter <span class="hljs-keyword">as</span> EKF
<span class="hljs-keyword">from</span> filterpy.common <span class="hljs-keyword">import</span> Q_discrete_white_noise

def fx(x, dt):
    <span class="hljs-string">""</span><span class="hljs-string">" State transition function for the nonlinear system. "</span><span class="hljs-string">""</span>
    # Example: x<span class="hljs-string">' = [x[0] + x[1]*dt, x[1]]
    F = np.array([x[0] + x[1]*dt, x[1]])
    return F

def hx(x):
    """ Measurement function for the nonlinear system. """
    # Example: z = [x[0]]
    return np.array([x[0]])

def jacobian_F(x, dt):
    """ Jacobian of the state transition function. """
    return np.array([[1, dt],
                     [0, 1]])

def jacobian_H(x):
    """ Jacobian of the measurement function. """
    return np.array([[1, 0]])

# Initialize EKF
ekf = EKF(dim_x=2, dim_z=1)

# Initial state
ekf.x = np.array([0, 1])

# Initial state covariance
ekf.P = np.eye(2)

# Process noise covariance
ekf.Q = Q_discrete_white_noise(dim=2, dt=1, var=0.1)

# Measurement noise covariance
ekf.R = np.array([[0.1]])

# Define the state transition and measurement functions
ekf.F = jacobian_F
ekf.H = jacobian_H

# Control input
dt = 1.0  # time step

# Simulated measurements
measurements = [1, 2, 3, 4, 5]

for z in measurements:
    # Predict step
    ekf.predict_update(z, HJacobian=jacobian_H, Hx=hx, Fx=fx, args=(dt,), hx_args=())

    # Print the current state estimate
    print("Estimated state:", ekf.x)</span>
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/1-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Full code</em></p>
<p>Let's see the code block by block.</p>
<h3 id="heading-import-the-libraries">Import the Libraries</h3>
<pre><code><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> filterpy.kalman <span class="hljs-keyword">import</span> ExtendedKalmanFilter <span class="hljs-keyword">as</span> EKF
<span class="hljs-keyword">from</span> filterpy.common <span class="hljs-keyword">import</span> Q_discrete_white_noise
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/2-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Importing Libraries</em></p>
<p>In this part of the code we import the Python libraries we need:</p>
<ul>
<li><strong><code>import numpy as np</code></strong>: This imports a tool called <a target="_blank" href="https://numpy.org/">NumPy</a>, which helps us work with numbers and lists of numbers (like a spreadsheet).</li>
<li><strong><code>from [filterpy](https://filterpy.readthedocs.io/en/latest/).kalman import ExtendedKalmanFilter as EKF</code></strong>: This brings in a tool called <code>ExtendedKalmanFilter</code> from the <code>filterpy</code> library. We will use this tool, named <code>EKF</code> here, to track things that change over time in a way that's not straight-line simple.</li>
<li><strong><code>from [filterpy](https://filterpy.readthedocs.io/en/latest/).common import Q_discrete_white_noise</code></strong>: This imports a function that helps us set up noise, which is like the natural "fuzziness" or uncertainty in our system.</li>
</ul>
<h3 id="heading-define-how-the-system-works">Define How the System Works</h3>
<pre><code>def fx(x, dt):
    <span class="hljs-string">""</span><span class="hljs-string">" State transition function for the nonlinear system. "</span><span class="hljs-string">""</span>
    # Example: x<span class="hljs-string">' = [x[0] + x[1]*dt, x[1]]
    return np.array([x[0] + x[1]*dt, x[1]])

def hx(x):
    """ Measurement function for the nonlinear system. """
    # Example: z = [x[0]]
    return np.array([x[0]])</span>
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/3-3.png" alt="Image" width="600" height="400" loading="lazy">
<em>Define How the System Works</em></p>
<p>In this code we define how the system will work:</p>
<ul>
<li><strong><code>fx(x, dt)</code></strong>: This function describes how our system changes over time. It says the new position is the old position plus speed times time (<code>x[0] + x[1]*dt</code>). The speed (<code>x[1]</code>) stays the same.</li>
<li><strong><code>hx(x)</code></strong>: This function tells us what we can measure from the system. Here, it says we can measure the position (<code>x[0]</code>).</li>
</ul>
<h3 id="heading-define-how-changes-affect-the-system">Define How Changes Affect the System</h3>
<pre><code>def jacobian_F(x, dt):
    <span class="hljs-string">""</span><span class="hljs-string">" Jacobian of the state transition function. "</span><span class="hljs-string">""</span>
    <span class="hljs-keyword">return</span> np.array([[<span class="hljs-number">1</span>, dt],
                     [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>]])

def jacobian_H(x):
    <span class="hljs-string">""</span><span class="hljs-string">" Jacobian of the measurement function. "</span><span class="hljs-string">""</span>
    <span class="hljs-keyword">return</span> np.array([[<span class="hljs-number">1</span>, <span class="hljs-number">0</span>]])
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/4-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Define How the System Works</em></p>
<p>In this code we define how changes affect the system:</p>
<ul>
<li><strong><code>jacobian_F(x, dt)</code></strong>: This function shows us how sensitive the system is to changes in time and position. It helps the filter predict changes more accurately by considering these sensitivities.</li>
<li><strong><code>jacobian_H(x)</code></strong>: This function tells us how sensitive our measurement is to changes in position. It helps the filter adjust the prediction based on new measurements.</li>
</ul>
<h3 id="heading-set-up-the-kalman-filter">Set Up the Kalman Filter</h3>
<pre><code># Initialize EKF
ekf = EKF(dim_x=<span class="hljs-number">2</span>, dim_z=<span class="hljs-number">1</span>)

# Initial state
ekf.x = np.array([<span class="hljs-number">0</span>, <span class="hljs-number">1</span>])
print(<span class="hljs-string">"Initial state:"</span>, ekf.x)

# Initial state covariance
ekf.P = np.eye(<span class="hljs-number">2</span>)
print(<span class="hljs-string">"Initial state covariance:\n"</span>, ekf.P)
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/5-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Set Up the Kalman Filter</em></p>
<p>In this part of the code, we create a very simple Kalman filter:</p>
<ul>
<li><strong><code>ekf = EKF(dim_x=2, dim_z=1)</code></strong>: This creates an Extended Kalman Filter that tracks two things (position and speed) and one measurement (position).</li>
<li><strong><code>ekf.x = np.array([0, 1])</code></strong>: This sets the starting position to <code>0</code> and speed to <code>1</code>.</li>
</ul>
<p>It prints out:</p>
<pre><code>Initial state: [<span class="hljs-number">0</span> <span class="hljs-number">1</span>]
</code></pre><ul>
<li><strong><code>ekf.P = np.eye(2)</code></strong>: This is a way of saying we aren't very sure about our starting guesses. It's like saying "let's start from here, but we are open to changes."</li>
</ul>
<p>It prints out:</p>
<pre><code>Initial state covariance:
 [[<span class="hljs-number">1.</span> <span class="hljs-number">0.</span>]
 [<span class="hljs-number">0.</span> <span class="hljs-number">1.</span>]]
</code></pre><h3 id="heading-describe-uncertainty-in-the-system">Describe Uncertainty in the System</h3>
<pre><code># Process noise covariance
ekf.Q = Q_discrete_white_noise(dim=<span class="hljs-number">2</span>, dt=<span class="hljs-number">1</span>, <span class="hljs-keyword">var</span>=<span class="hljs-number">0.1</span>)
print(<span class="hljs-string">"Process noise covariance:\n"</span>, ekf.Q)

# Measurement noise covariance
ekf.R = np.array([[<span class="hljs-number">0.1</span>]])
print(<span class="hljs-string">"Measurement noise covariance:\n"</span>, ekf.R)
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/6-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Describe Uncertainty in the System</em></p>
<ul>
<li><strong><code>ekf.Q = Q_discrete_white_noise(dim=2, dt=1, var=0.1)</code></strong>: This sets how much randomness or unpredictability we expect in the system itself. It's like saying, "things might not move exactly as we think."</li>
</ul>
<p>It prints out:</p>
<pre><code>Process noise covariance:
 [[<span class="hljs-number">0.025</span> <span class="hljs-number">0.05</span> ]
 [<span class="hljs-number">0.05</span>  <span class="hljs-number">0.1</span>  ]]
</code></pre><ul>
<li><strong><code>ekf.R = np.array([[0.1]])</code></strong>: This sets how much we trust our measurements. A smaller number means we trust them more.</li>
</ul>
<pre><code>Measurement noise covariance:
 [[<span class="hljs-number">0.1</span>]]
</code></pre><h3 id="heading-simulate-data-and-initial-state">Simulate Data and Initial State</h3>
<pre><code># Control input
dt = <span class="hljs-number">1.0</span>  # time step

# Simulated measurements
measurements = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]

# True initial state <span class="hljs-keyword">for</span> comparison (not used <span class="hljs-keyword">in</span> the EKF)
true_state = np.array([<span class="hljs-number">0</span>, <span class="hljs-number">1</span>])
print(<span class="hljs-string">"\nTrue initial state:"</span>, true_state)
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/7-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Simulate Data and Initial State</em></p>
<ul>
<li><strong><code>dt = 1.0</code></strong>: This is the time between each step of our simulation.</li>
<li><strong><code>measurements = [1, 2, 3, 4, 5]</code></strong>: These are the pretend measurements we will use to test the filter.</li>
<li><strong><code>true_state = np.array([0, 1])</code></strong>: This is the real starting position and speed of our system, used for comparison.</li>
</ul>
<p>It gives:</p>
<pre><code>True initial state: [<span class="hljs-number">0</span> <span class="hljs-number">1</span>]
</code></pre><h3 id="heading-simulate-real-system-changes">Simulate Real System Changes</h3>
<pre><code># Simulate the <span class="hljs-literal">true</span> state evolution (<span class="hljs-keyword">for</span> comparison)
true_states = [true_state[<span class="hljs-number">0</span>]]
<span class="hljs-keyword">for</span> _ <span class="hljs-keyword">in</span> range(len(measurements) - <span class="hljs-number">1</span>):
    true_state = fx(true_state, dt)
    true_states.append(true_state[<span class="hljs-number">0</span>])

print(<span class="hljs-string">"\nSimulated true states (for reference):"</span>, true_states)
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/8-1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Simulate Real System Changes</em></p>
<ul>
<li><strong>Simulating True States</strong>: This part calculates what the real position should be over time using the way the system works (<code>fx</code>). It's like having a perfect GPS to check against our estimates.</li>
</ul>
<pre><code>Simulated <span class="hljs-literal">true</span> states (<span class="hljs-keyword">for</span> reference): [<span class="hljs-number">0</span>, <span class="hljs-number">1.0</span>, <span class="hljs-number">2.0</span>, <span class="hljs-number">3.0</span>, <span class="hljs-number">4.0</span>]
</code></pre><h3 id="heading-filter-steps-to-estimate-the-state">Filter Steps to Estimate the State</h3>
<pre><code><span class="hljs-keyword">for</span> i, z <span class="hljs-keyword">in</span> enumerate(measurements):
    print(f<span class="hljs-string">"\nStep {i+1}:"</span>)
    print(<span class="hljs-string">"Measurement:"</span>, z)

    # Predict step
    ekf.predict(u=<span class="hljs-number">0</span>)  # Use predict_x <span class="hljs-keyword">if</span> you need to customize the prediction
    print(<span class="hljs-string">"Predicted state before update:"</span>, ekf.x)

    # Update step
    ekf.update(z, HJacobian=jacobian_H, Hx=hx, args=(), hx_args=())
    print(<span class="hljs-string">"Updated state after measurement:"</span>, ekf.x)
    print(<span class="hljs-string">"State covariance after update:\n"</span>, ekf.P)
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2024/08/9.png" alt="Image" width="600" height="400" loading="lazy">
<em>Filter Steps to Estimate the State</em></p>
<p><strong>Loop Through Measurements</strong>: This loop goes through each fake measurement one by one.</p>
<ul>
<li><strong>Predict Step (<code>ekf.predict(u=0)</code>)</strong>: Before looking at the new measurement, the filter makes a guess about where the position and speed are now.</li>
<li><strong>Update Step (<code>ekf.update</code>)</strong>: After the guess, the filter sees the new measurement and adjusts its guess to be closer to this measurement, balancing the new information with what it previously predicted.</li>
</ul>
<p>Here are the results:</p>
<pre><code>Step <span class="hljs-number">1</span>:
Measurement: <span class="hljs-number">1</span>
Predicted state before update: [<span class="hljs-number">0.</span> <span class="hljs-number">1.</span>]
Updated state after measurement: [<span class="hljs-number">0.91111111</span> <span class="hljs-number">1.04444444</span>]
State covariance after update:
 [[<span class="hljs-number">0.09111111</span> <span class="hljs-number">0.00444444</span>]
 [<span class="hljs-number">0.00444444</span> <span class="hljs-number">1.09777778</span>]]

Step <span class="hljs-number">2</span>:
Measurement: <span class="hljs-number">2</span>
Predicted state before update: [<span class="hljs-number">0.91111111</span> <span class="hljs-number">1.04444444</span>]
Updated state after measurement: [<span class="hljs-number">1.49614396</span> <span class="hljs-number">1.31876607</span>]
State covariance after update:
 [[<span class="hljs-number">0.05372751</span> <span class="hljs-number">0.0251928</span> ]
 [<span class="hljs-number">0.0251928</span>  <span class="hljs-number">1.1840617</span> ]]

Step <span class="hljs-number">3</span>:
Measurement: <span class="hljs-number">3</span>
Predicted state before update: [<span class="hljs-number">1.49614396</span> <span class="hljs-number">1.31876607</span>]
Updated state after measurement: [<span class="hljs-number">2.15857605</span> <span class="hljs-number">1.95145631</span>]
State covariance after update:
 [[<span class="hljs-number">0.0440489</span>  <span class="hljs-number">0.0420712</span> ]
 [<span class="hljs-number">0.0420712</span>  <span class="hljs-number">1.25242718</span>]]

Step <span class="hljs-number">4</span>:
Measurement: <span class="hljs-number">4</span>
Predicted state before update: [<span class="hljs-number">2.15857605</span> <span class="hljs-number">1.95145631</span>]
Updated state after measurement: [<span class="hljs-number">2.91071524</span> <span class="hljs-number">2.95437384</span>]
State covariance after update:
 [[<span class="hljs-number">0.04084552</span> <span class="hljs-number">0.05446424</span>]
 [<span class="hljs-number">0.05446424</span> <span class="hljs-number">1.30228131</span>]]

Step <span class="hljs-number">5</span>:
Measurement: <span class="hljs-number">5</span>
Predicted state before update: [<span class="hljs-number">2.91071524</span> <span class="hljs-number">2.95437384</span>]
Updated state after measurement: [<span class="hljs-number">3.74022237</span> <span class="hljs-number">4.27039095</span>]
State covariance after update:
 [[<span class="hljs-number">0.03970292</span> <span class="hljs-number">0.06298888</span>]
 [<span class="hljs-number">0.06298888</span> <span class="hljs-number">1.33648045</span>]]
</code></pre><h2 id="Beyond">Conclusion: Navigating Nonlinear Data with Advanced Techniques</h2>

<p><img src="https://www.freecodecamp.org/news/content/images/2024/08/pexels-noellegracephotos-906055.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by <a target="_blank" href="https://www.pexels.com/photo/close-up-photography-of-magnifying-glass-906055/">Noelle Otto on Pexels</a></em></p>
<p>Kalman Filters are a powerful tool for extracting accurate estimates from noisy and incomplete data. </p>
<p>Variants like the Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF) have been developed to address non-linearities in data. </p>
<p>However, these variants can still face challenges related to stability and accuracy when applied to complex non-linear systems. </p>
<p>This is due to their reliance on linear approximations, which may not capture the full dynamics of highly non-linear processes.</p>
<p>To overcome these limitations, alternative methods such Neural Network-based approaches have gained attention. </p>
<p>Neural Networks can learn complex patterns directly from data, offering a robust solution for highly non-linear scenarios.</p>
<p>Despite these advancements, Kalman Filters remain an important tool in various fields of science and economics due to their simplicity, efficiency, and effectiveness in a wide range of applications. </p>
<p>As technology continues to evolve, the integration of Kalman Filters with other advanced techniques will likely enhance their capability to navigate the challenges of non-linear data more effectively.</p>
<p>Here is the full code:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/tiagomonteiro0715/freecodecamp-my-articles-source-code">https://github.com/tiagomonteiro0715/freecodecamp-my-articles-source-code</a></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Unlock the Power of Data Analytics with Free Google Services ]]>
                </title>
                <description>
                    <![CDATA[ The ability to analyze and interpret data is indispensable across many different industries. And you don't even need to buy any software to expertly analyize data. We just posted a course on the freeCodeCamp.org YouTube channel that will teach you ab... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/data-analytics-with-google-stack/</link>
                <guid isPermaLink="false">66b201f4a2135cc2539a2169</guid>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Mon, 25 Mar 2024 19:57:04 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/03/dataanalytics.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The ability to analyze and interpret data is indispensable across many different industries. And you don't even need to buy any software to expertly analyize data.</p>
<p>We just posted a course on the freeCodeCamp.org YouTube channel that will teach you about data analytics through hands-on projects, leveraging a suite of free Google services. This course from Analyst Adithya offers a practical approach to understanding and applying data analytics tools.</p>
<h4 id="heading-data-analysis-with-google-sheets">Data Analysis with Google Sheets</h4>
<p>The course starts with Google Sheets, a versatile tool that goes beyond basic spreadsheet functionalities. You will learn how to perform sophisticated data analysis tasks, manipulate data sets, and employ formulas and functions to uncover insights. Google Sheets' accessibility and user-friendly interface make it an excellent starting point for those new to data analytics, providing a solid foundation in data manipulation and analysis.</p>
<h4 id="heading-sql-with-google-bigquery">SQL with Google BigQuery</h4>
<p>As you progress, you are introduced to Google BigQuery, a powerful tool for querying massive datasets using SQL (Structured Query Language). This segment of the course is designed to bridge the gap between traditional spreadsheet analysis and more advanced database management. By exploring BigQuery, you will gain proficiency in SQL, learning how to execute complex queries, join tables, and extract meaningful information from large data sets.</p>
<h4 id="heading-python-with-google-colab">Python with Google Colab</h4>
<p>The course then teaches Python programming with Google Colab, an environment that allows users to write and execute Python code through their browsers. This section is particularly exciting for those looking to harness the power of Python for data analysis, offering a hands-on experience with coding, data manipulation, and the application of libraries like Pandas and NumPy. Google Colab's collaborative features also introduce learners to the concept of shared, interactive computing.</p>
<h4 id="heading-data-visualization-with-google-looker-studio">Data Visualization with Google Looker Studio</h4>
<p>Finally, the course ends with data visualization using Google Looker Studio (formerly known as Google Data Studio), where learners will discover how to transform their analyzed data into compelling, interactive reports and dashboards. This module emphasizes the importance of data storytelling, teaching participants how to present their findings visually to communicate insights effectively and influence decision-making.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p> By covering a range of Google services, the course provides a broad perspective on data analytics, ensuring that you are well-versed in various tools and methodologies. </p>
<p>Watch the full course on <a target="_blank" href="https://www.youtube.com/watch?v=NnSIKA77pD8">the freeCodeCamp.org YouTube channel</a> (3-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/NnSIKA77pD8" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Learn Data Analytics with New Advanced Certifications from Google ]]>
                </title>
                <description>
                    <![CDATA[ Google has been growing a list of certifications for the past few years. And they've just added some advanced coursework to the repertoire.  In this article, I'll introduce you to the Google Certifications and detail what's new. I'll focus on the Dat... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/starting-and-excelling-in-data-analytics/</link>
                <guid isPermaLink="false">66b8de24abe19f6180038a35</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Google ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Eamonn Cottrell ]]>
                </dc:creator>
                <pubDate>Fri, 07 Apr 2023 20:47:20 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/04/Data-Analytics-Advanced-Certifications.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Google has been growing a list of certifications for the past few years. And they've just added some advanced coursework to the repertoire. </p>
<p>In this article, I'll introduce you to the Google Certifications and detail what's new. I'll focus on the Data Analytics pathway, but will include resources to their other programs.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/learn.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-video-walkthrough">Video Walkthrough</h2>
<p>Here's a video walkthrough of what we'll discuss below.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/dogpnO3IU_8" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-grow-with-google-overview">Grow With Google Overview</h2>
<p>Career Certifications from Google are a part of their "Grow with Google" initiative. A portion of their <a target="_blank" href="https://grow.google/our-mission/">mission page</a> is in the picture below 👇. </p>
<p>Grow with Google is an assortment of training and learning resources for small business owners, job seekers, veterans, educators, developers and startups to learn vital digital skills.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-42.png" alt="Image" width="600" height="400" loading="lazy">
<em>From Grow with Google's mission: https://grow.google/our-mission/</em></p>
<p>Part of Grow with Google are the <a target="_blank" href="https://grow.google/certificates/#?modal_active=none">Career Certificates pathways</a> which offer flexible online training programs in <a target="_blank" href="https://grow.google/certificates/digital-marketing-ecommerce/#?modal_active=none">Digital Marketing &amp; E-commerce</a>, <a target="_blank" href="https://grow.google/certificates/it-support/#?modal_active=none">IT Support</a>, <a target="_blank" href="https://grow.google/certificates/data-analytics/#?modal_active=none">Data Analytics</a>, <a target="_blank" href="https://grow.google/certificates/project-management/#?modal_active=none">Project Management</a>, and <a target="_blank" href="https://grow.google/certificates/ux-design/#?modal_active=none">UX Design</a>.👇</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-47.png" alt="Image" width="600" height="400" loading="lazy">
<em>picture of Grow with Google's Career Certificates page</em></p>
<p>The proposition is attractive: no experience necessary to begin the programs, learn at your own pace, have a well-regarded certification from Google at the end of it and be qualified for a new entry-level job in careers with a median salary of $72,000 across the certificate fields. </p>
<p>The median salaries range from $57,000 for <a target="_blank" href="https://grow.google/certificates/it-support/#?modal_active=none">IT Support</a> to $112,000 for <a target="_blank" href="https://grow.google/certificates/ux-design/#?modal_active=none">UX Design</a>.</p>
<p>The entire certificate program is a partnership between Google, who has crafted the courses, and Coursera, which is one of the OG MOOCS that hosts the coursework. </p>
<p>This of course begs the question: how much does it cost? 🤔</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/howmuch.gif" alt="Image" width="600" height="400" loading="lazy">
<em>gif of man saying, how much money?</em></p>
<p>The good news is that you can nab the knowledge for free. And if you fork over a little bit, you can have the official certificate to display proudly on that portion of your LinkedIn page rarely ever scrolled to. 😀</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-58.png" alt="Image" width="600" height="400" loading="lazy">
<em>pic of my LinkedIn licenses &amp; certifications</em></p>
<h3 id="heading-the-free-version">The Free Version:</h3>
<p>Yes, the knowledge is free. You can audit any of these courses at Coursera for free. So, while there's not an option to audit the whole certificate, you can click into the individual courses and audit them one by one.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/audit.png" alt="Image" width="600" height="400" loading="lazy">
<em>picture of audit option in coursera courser</em></p>
<p> I've clicked into the Foundations of Data Science course and selected audit. In the screenshot below, you can see that I now have access to all the coursework.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-62.png" alt="Image" width="600" height="400" loading="lazy">
<em>screenshot of Foundations of Data Science coursework on coursera</em></p>
<p>What don't you get with the free version?</p>
<p>Well, you don't get that nice certificate "proving" you did the work. But if you've got the knowledge, you can muster together projects that will do a better job of proving that anyway. </p>
<p>And you also may not be able to turn in certain assignments for grades, depending on the course.</p>
<h3 id="heading-the-not-free-version">The Not Free Version:</h3>
<p>Coursera costs $39 a month for any of the individual Google certificates, including the new advanced ones. And since it's at your own pace, if you work fast, you can finish in one, two, or three months instead of the projected six...saving you some $$$. 💵💰</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-59.png" alt="Image" width="600" height="400" loading="lazy">
<em>pic of Coursera's individual course pricing</em></p>
<p>As is now common, Coursera also offers a more expensive Plus program for $59 a month or $399 a year. This gives unlimited access to courses and could be a better deal if you plan on plowing through many courses during a year.</p>
<p>But, you'd have to be flying through them for this to be valuable considering you could by 10 individual courses for $390.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-60.png" alt="Image" width="600" height="400" loading="lazy">
<em>pic of coursera plus costs</em></p>
<p>My opinion: if you're strapped for cash, start knocking out the free audit versions. But, it's pretty cheap to grab a certificate if that's important to you. Particularly if you work hard and fast 👉 it could cost as little as one month's $39 fee.</p>
<h2 id="heading-my-experience-with-the-data-analytics-cert">My Experience with the Data Analytics Cert</h2>
<p>I took the Data Analytics Certification a while back, and can attest that it was a fantastic overview of the field. I'd been using Excel heavily before taking the course, and was familiar with programming and database concepts, so I was able to move at a brisk pace.</p>
<p>I spent 2-3 months working through the "6 month" course, and certainly could have gone faster. Six months is conservative, even for a novice, in my opinion.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-57.png" alt="Image" width="600" height="400" loading="lazy">
<em>screenshot of my data analytics certificate</em></p>
<p>This certificate took some flak because it used R instead of Python for the programming portion. But I thought it was well laid out and offered a good introduction to data analytics.</p>
<p>Would it make someone hirable? </p>
<p>Well, it's just one piece in that puzzle. Relying on any of these certifications alone to land a job is perhaps unwise. It will take a combination of the skills learned, the networking you're willing to do, and your continued work through projects to prove your skills and land a job.</p>
<p>On the whole, I recommend it, especially if you're new to Excel, SQL, or programming.</p>
<p>And if you're wondering, yes, I ponied up the cash and enrolled in the program. It took me a little over two months and so I paid $117 +tax.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-63.png" alt="Image" width="600" height="400" loading="lazy">
<em>My payment history for Data Analytics coursework</em></p>
<h2 id="heading-advanced-certificates">Advanced Certificates</h2>
<p>My foray into the data analytics was one of curiosity more than anything. I was not actively seeking new employment – I simply wanted to sharpen and expand my skills. And that's exactly what piqued my interest in the new, advanced certificates that are now available.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/advanced.png" alt="Image" width="600" height="400" loading="lazy">
<em>pic of banner advertising new advanced Certificates</em></p>
<p>In addition to Industry Specializations (<a target="_blank" href="https://blog.google/outreach-initiatives/grow-with-google/industry-specializations/">added in October 2022</a>), there are now three advanced certificates (<a target="_blank" href="https://blog.google/outreach-initiatives/grow-with-google/advanced-google-data-analytics-career-certificates/">as of April 2023</a>) with more likely in the future: <a target="_blank" href="https://grow.google/certificates/data-analytics/?advanced#?modal_active=none">Advanced Data Analytics</a>, <a target="_blank" href="https://grow.google/certificates/data-analytics/?advanced#?modal_active=none">Business Intelligence</a>, and <a target="_blank" href="https://grow.google/certificates/it-support/?advanced#?modal_active=none">IT Automation with Python</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-64.png" alt="Image" width="600" height="400" loading="lazy">
<em>pic of advanced certificate listings from Grow with Google</em></p>
<p>According to Google's announcement post, the Data Analytics Certificate program was the most popular professional certificate on Coursera, so it's unsurprising that this field has received the first advanced follow-up courses. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/popular-2.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excerpt from announcement post</em></p>
<p>And the field is well paid, making it an attractive aspiration for career transitioners and students alike.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-65.png" alt="Image" width="600" height="400" loading="lazy">
_pic of advanced data analytics certificate details from https://grow.google/certificates/data-analytics/?advanced#?modal<em>active=none</em></p>
<p>Of particular note, Google has wisely opted to go with Python and Jupyter Notebook (industry standard tools) as detailed in the above card for the Advanced Data Analytics Certificate.</p>
<p>Below, you can see similar details for the Business Intelligence Certificate which focuses more heavily on modeling, dashboards, and engaging with stakeholders via SQL, Tableau, and BigQuery.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-67.png" alt="Image" width="600" height="400" loading="lazy">
_pic of details from business intelligence certificate from https://grow.google/certificates/data-analytics/?advanced#?modal<em>active=none</em></p>
<p>I'm excited to try out both courses and see how deep they go after the introductory, pretty surface level course. And right now, it has that same fresh, new, adventurous feel as when a new WoW server launches 🧙‍♂️. Only 3 enrolled in the Data Analytics Advanced degree!😲😅</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/start.png" alt="Image" width="600" height="400" loading="lazy">
<em>pic of advanced data analytics certificate page on Coursera</em></p>
<p>And there are only 4 in the Business Intelligence program! This is sure to change quickly, and indeed, there are a few hundred in the individual courses already. Looks like many will indeed opt to audit the courses before jumping into the paid program.</p>
<h2 id="heading-coursework-overview">Coursework Overview</h2>
<p>Here are the respective courses in the two new advanced certificates. I encourage you to go check them out yourselves for further details, or watch my <a target="_blank" href="https://youtu.be/dogpnO3IU_8">video walkthrough</a>, but this will give you an idea of what to expect.</p>
<h3 id="heading-data-analytics-courses">Data Analytics Courses</h3>
<p><a target="_blank" href="https://www.coursera.org/google-certificates/advanced-data-analytics-certificate?utm_source=google&amp;utm_medium=institutions&amp;utm_campaign=gwgsite">Go here</a> to check out the overview of each data analytics course.</p>
<p>Click into each course below to explore in more detail and see all the modules within each course. This program is estimated by Google to take six months to complete.</p>
<ol>
<li><a target="_blank" href="https://www.coursera.org/learn/foundations-of-data-science?specialization=advanced-data-analytics-certificate">Foundations of Data Science</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/get-started-with-python?specialization=advanced-data-analytics-certificate">Get Started with Python</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/go-beyond-the-numbers-translate-data-into-insight?specialization=advanced-data-analytics-certificate">Go Beyond the Numbers: Translate Data into Insights</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/the-power-of-statistics?specialization=advanced-data-analytics-certificate">The Power of Statistics</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/regression-analysis-simplify-complex-data-relationships?specialization=advanced-data-analytics-certificate">Regression Analysis: Simplify Complex Data Relationships</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/the-nuts-and-bolts-of-machine-learning?specialization=advanced-data-analytics-certificate">The Nuts and Bolts of Machine Learning</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/google-advanced-data-analytics-capstone?specialization=advanced-data-analytics-certificate">Google Advanced Data Analytics Capstone</a></li>
</ol>
<p>You can see from the screenshot below the estimated hours to complete each module as well as the higher $118,000 median salary for entry-level roles:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-68.png" alt="Image" width="600" height="400" loading="lazy">
<em>screenshot of coursework for Advanced Data Analytics</em></p>
<h3 id="heading-business-intelligence-courses">Business Intelligence Courses</h3>
<p><a target="_blank" href="https://www.coursera.org/professional-certificates/google-business-intelligence">Go here</a> to check out the overview of each business intelligence course.</p>
<p>Click into each course below to explore in more detail and see all the modules within each course. This shorter program is estimated by Google to take two months to complete.</p>
<ol>
<li><a target="_blank" href="https://www.coursera.org/learn/foundations-of-business-intelligence?specialization=business-intelligence-certificate">Foundations of Business Intelligence</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/the-path-to-insights-data-models-and-pipelines?specialization=business-intelligence-certificate">The Path to Insights: Data Models and Pipelines</a></li>
<li><a target="_blank" href="https://www.coursera.org/learn/decisions-decisions-dashboards-and-reports?specialization=business-intelligence-certificate">Decisions, Decisions: Dashboards and Reports</a></li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/04/image-69.png" alt="Image" width="600" height="400" loading="lazy">
<em>screenshot of Business Intelligence certificate coursework</em></p>
<h2 id="heading-after-the-certificate">After the Certificate</h2>
<p>Google has also developed an <a target="_blank" href="https://grow.google/employers/#?modal_active=none">employer consortium</a> of over 150 companies which will consider recent graduates of Google's programs for hiring. While this is certainly no guarantee of employment, if you're in the market it is a nice touch, and will be another helpful tool in your search.</p>
<h2 id="heading-summary">Summary</h2>
<p>I hope this has been a helpful overview for you! </p>
<p>I make weekly spreadsheet and coding videos on my <a target="_blank" href="https://www.youtube.com/@eamonncottrell?sub_confirmation=1">YouTube channel</a>. Come check it out if you find this helpful! Here's a link to my Google Sheets playlist where I walk through basic and advanced topics alike:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/undefined" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p>You can also find me on <a target="_blank" href="https://www.linkedin.com/in/eamonncottrell/">LinkedIn</a>. Have a great one!👋</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Get Started in Data Analytics – A Roadmap for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ Hello and welcome to the world of data analysis! If you're considering a career in this field, you're in good company. Data analysis is a growing and exciting field that's becoming increasingly important in today's data-driven world. Let's face it, w... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/data-analytics-roadmap/</link>
                <guid isPermaLink="false">66d46097f855545810e934bf</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jeremiah Oluseye ]]>
                </dc:creator>
                <pubDate>Thu, 23 Mar 2023 00:06:48 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/03/dataa.JPG" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Hello and welcome to the world of data analysis! If you're considering a career in this field, you're in good company. Data analysis is a growing and exciting field that's becoming increasingly important in today's data-driven world.</p>
<p>Let's face it, we're all drowning in data these days. From social media posts to financial transactions to medical records, there's no shortage of information to sift through.</p>
<p>That's where data analysts come in. They're the ones who help us make sense of all that data and turn it into valuable insights.</p>
<p>And those insights can be game-changing. They can help businesses improve their products and services, governments make more informed policy decisions, and individuals make better choices in their personal and professional lives.</p>
<p>But it's not just about the impact. Data analysis can also be quite lucrative. According to recent studies, the median salary for a data analyst in the US is around $70,000 per year, and that number can climb even higher with experience and expertise.</p>
<p>Of course, like any profession, data analysis has its challenges. There's the occasional headache-inducing data set, the ever-present threat of imposter syndrome, and the endless debates over the best programming language or data visualization tool. But hey, if you're up for a challenge, this could be the field for you.</p>
<p>So if you're trying to be a Data Analyst, this article is for you. Hopefully, it saves you a lot of time and effort and you don't have to waste your time learning a whole lot of irrelevant things like I once did.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/03/tenor-1.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-step-1-get-to-know-the-role-of-a-data-analyst">Step 1: Get to Know the Role of a Data Analyst</h2>
<p>Are you considering a career as a data analyst? That's fantastic! Let's take a moment to grasp the gist of it before moving forward.</p>
<p>You see, a data analyst's job involves more than just crunching figures and creating charts (although those things can be pretty cool, too). It involves leveraging data to find insights and address issues. This means coming up with the correct questions, organizing and evaluating the data, and explaining your conclusions to others.</p>
<p>Some core skills and activities that a data analyst typically performs include:</p>
<ul>
<li><p>Collecting and analyzing large data sets to identify patterns, trends, and insights that can inform business decisions.</p>
</li>
<li><p>Using statistical tools and techniques to draw insights from data.</p>
</li>
<li><p>Developing and implementing data collection systems and other strategies that optimize efficiency and data quality.</p>
</li>
<li><p>Collaborating with other teams to identify business needs and develop data solutions that address them.</p>
</li>
<li><p>Communicating findings and insights to stakeholders in a clear and actionable way.</p>
</li>
</ul>
<p>So if you're not a math prodigy or a computer whiz, don't worry. Statistics, computer science, and business are just a few of the numerous disciplines that are incorporated into the multidisciplinary topic of data analysis. Everyone who enjoys learning, solving problems, and making a difference can really enjoy it.</p>
<p>So how can you find out more about what a data analyst does? You can start by looking through the numerous free resources that are accessible online. For example, <a target="_blank" href="https://www.freecodecamp.org/news/what-does-a-data-analyst-do-data-analyst-job-description/">here an article that discusses what data analysts actually do</a>. And <a target="_blank" href="https://www.freecodecamp.org/news/data-analyst-vs-data-scientist-whats-the-difference/">here's one that discusses data analyst vs data science roles</a>.</p>
<p>Many blogs, podcasts, and YouTube channels offer entertaining and informative content on the subject of data analysis. I will be dropping some YouTube channels that have helped me over the years below.</p>
<p>To gain a feel of the skills and qualities needed, you can also network with other data analysts, go to meetings or seminars, and study job descriptions.</p>
<p>Don't forget to consider whether dealing with data is something you enjoy. Do you enjoy finding patterns and solving puzzles? Do you want to change the world for the better? Data analysis may be the ideal career choice for you if the answer is yes.</p>
<p>The first step in your path is to understand what a data analyst does. Enjoy yourself, take your time, and don't be hesitant to ask questions.</p>
<h2 id="heading-step-2-explore-job-requirements-for-data-analyst-roles">Step 2: Explore Job Requirements for Data Analyst Roles</h2>
<p>Now that you have a better understanding of the role of a data analyst, it's time to start looking at what employers are looking for. After all, you want to make sure that your skills and knowledge match up with what's required in the job market.</p>
<p>But before you start panicking about not having enough experience, remember that every company is different. Some may prioritize programming skills, while others may value communication and business acumen. That's why it's important to do your research and find out what specific skills and qualifications are most in demand in your desired industry or company.</p>
<p>So how do you go about finding this information? Well, one great place to start is by checking out job listings and descriptions on job boards like LinkedIn, Indeed, or Glassdoor. This can give you a good sense of the key requirements and qualifications for different data analyst roles.</p>
<p>Some examples of what job listings might ask for include:</p>
<ul>
<li><p>Proficiency in SQL and experience working with large datasets</p>
</li>
<li><p>Familiarity with Python and data visualization tools like Tableau or Power BI</p>
</li>
<li><p>Strong analytical skills and the ability to draw insights from complex data</p>
</li>
<li><p>Experience with statistical analysis and modeling techniques</p>
</li>
<li><p>Excellent communication skills and the ability to explain complex findings to both technical and non-technical audiences</p>
</li>
</ul>
<p>But don't stop there! You can also reach out to people who work in the field or who have job titles that interest you. Ask them about their experience and what skills they think are most important for success in their role. You might even want to consider setting up informational interviews to learn more about the field and get advice on how to get started.</p>
<p>And speaking of getting started, it's important to remember that there's no substitute for hands-on experience. As tempting as it may be to spend all your time watching tutorials, you'll learn much more quickly and effectively by actually building things and working on real data analysis projects.</p>
<p>So take some time to explore job requirements, but don't forget to keep building your skills and gaining practical experience. With a little effort and a lot of curiosity, you'll be well on your way to becoming a successful data analyst.</p>
<h2 id="heading-step-3-get-comfortable-with-math-and-statistics">Step 3: Get Comfortable with Math and Statistics</h2>
<p>Okay, I know what you're thinking. Math and statistics? Yikes!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/03/im-out-gif-11-1.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<p>But hear me out before you run for the hills. For a data analyst to be able to make sense of data and derive valuable insights from it, having a fundamental understanding of these concepts is essential.</p>
<p>So what fundamental statistical concepts and formulas should you be familiar with?</p>
<p>Now, to start, there are measures of central tendency known as mean, median, and mode, which can give you an idea of the typical value in a dataset. You should know how to calculate them.</p>
<p>The standard deviation is a measure of how widely distributed the data are from the average, and you should be able to calculate it.</p>
<p>And in order to find relationships between variables and generate predictions based on those associations, you should also be familiar with correlation and regression.</p>
<p>But it's not just about numbers. You'll also need a rudimentary understanding of linear algebra, which is employed in many data analysis approaches. <a target="_blank" href="https://www.freecodecamp.org/news/linear-algebra-full-course/">Here's an in-depth course (and textbook)</a> to get you started.</p>
<p>You may need to employ matrices to modify and manipulate data, or you may need to use <a target="_blank" href="https://www.freecodecamp.org/news/data-science-with-python-8-ways-to-do-linear-regression-and-measure-their-speed-b5577d75f8b/">linear regression</a> to forecast future values based on historical trends.</p>
<p>If you don't have a solid math background, this may seem difficult. But don't be concerned! There are numerous resources available to assist you in your learning.</p>
<p>For example, Khan Academy offers lessons and practice tasks in math and statistics. If you prefer books, "Data Science for Beginners" by Andrew Park is an excellent resource that covers both statistical and mathematical principles in an accessible manner.</p>
<p>freeCodeCamp is developing a math curriculum <a target="_blank" href="https://www.freecodecamp.org/news/freecodecamp-foundational-math-curriculum/">which you can read about here</a>.</p>
<p>And <a target="_blank" href="https://www.freecodecamp.org/news/statistics-for-data-science/">here's a guide on the statistics you need to know</a> to get into data science and pursue fields like Machine Learning.</p>
<p>The key is to start small and build up your knowledge gradually. Don't be afraid to ask questions or seek help when you need it. With a little practice and persistence, you'll soon find that math and statistics are actually kind of fun (no, seriously!).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/03/raw.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-step-4-master-excel-for-data-analysis">Step 4: Master Excel for Data Analysis</h2>
<p>Excel is a vital tool in a data analyst's arsenal. It's used by virtually every organization out there, and mastering it will help you clean, manipulate, and analyze data with ease.</p>
<p>With Excel, you can create formulas and functions to perform calculations, pivot tables and charts to visualize data, and use data analysis tools to make predictions and identify patterns. Excel is particularly useful for regression analysis, forecasting, and scenario analysis.</p>
<p>If you're serious about becoming a data analyst, it's essential to master Excel. Fortunately, there are plenty of online resources available to help you learn. Check out <a target="_blank" href="https://www.youtube.com/@excelisfun">ExcelIsFun</a>, <a target="_blank" href="https://www.youtube.com/playlist?list=PLmejDGrsgFyCZ4YC5s8mgdQztj7zt5to5">Excel Chandoo</a>, <a target="_blank" href="https://www.youtube.com/playlist?list=PLWPirh4EWFpEpO6NjjWLbKSCb-wx3hMql">Tutorials Point,</a> <a target="_blank" href="https://www.youtube.com/@AshutoshKumaryt">Ashutosh Kumar</a> , and <a target="_blank" href="https://www.youtube.com/@MyOnlineTrainingHub">MyOnlineTrainingHub</a> for tutorials on Youtube. Also, the following courses will guide you on how to get the most out of Excel.</p>
<ol>
<li><p><a target="_blank" href="https://www.coursera.org/learn/excel-data-analysis?irclickid=WskXxw2EKxyNRBjSCewfUQQZUkARwUz2LzeJ2A0&amp;irgwc=1&amp;utm_medium=partners&amp;utm_source=impact&amp;utm_campaign=1359419&amp;utm_content=b2c">Introduction to Data Analysis Using Excel</a> by Coursera</p>
</li>
<li><p><a target="_blank" href="https://www.freecodecamp.org/news/data-analysis-with-python-for-excel-users-course/">Data Analysis with Python for Excel Users</a> on freeCodeCamp's YouTube channel</p>
</li>
<li><p><a target="_blank" href="https://www.coursera.org/specializations/excel?irclickid=WskXxw2EKxyNRBjSCewfUQQZUkARwUQvLzeJ2A0&amp;irgwc=1&amp;utm_medium=partners&amp;utm_source=impact&amp;utm_campaign=1359419&amp;utm_content=b2c">Excel Skills for Business Specialization</a> by Coursera</p>
</li>
<li><p><a target="_blank" href="https://www.edx.org/course/analyzing-and-visualizing-data-with-excel-2?irclickid=RrSQ3tWpyxyNTDdSXVVnIRUdUkARwR0WLzeJ2A0&amp;utm_source=affiliate&amp;utm_medium=guru99&amp;utm_campaign=Online%20Tracking%20Link_&amp;utm_content=ONLINE_TRACKING_LINK&amp;irgwc=1">Analyzing and Visualizing Data with Excel</a> by EdX</p>
</li>
</ol>
<p>Remember, Excel is just one tool in your data analysis toolkit. But it's a crucial one that you'll use daily as a data analyst. By mastering Excel, you'll be well-equipped to handle any data-related task that comes your way.</p>
<p>Now let's move on to the next skill and also one of the most important skills you'll need as a data analyst.</p>
<h2 id="heading-step-5-master-sql-for-data-extraction">Step 5: Master SQL for Data Extraction</h2>
<p>SQL (Structured Query Language) is a critical tool in data analysis. As a data analyst, one of your primary responsibilities is to extract data from databases, and SQL is the language used to do so.</p>
<p>SQL is more than just running basic queries like SELECT, FROM, and WHERE. It's a complex language that allows you to manipulate and transform data in countless ways. SQL is used for joining data from multiple tables, filtering and aggregating data, and creating new tables and views.</p>
<p>To be an effective data analyst, it's essential to master SQL. You should be comfortable with writing queries, creating tables, and understanding how to optimize your queries for performance.</p>
<p>Fortunately, there are many resources available to help you learn SQL. Some great places to start are <a target="_blank" href="https://www.khanacademy.org/computing/computer-programming/sql/">Khan Academy SQL</a>, W3Schools, <a target="_blank" href="https://sqlzoo.net/wiki/SQL_Tutorial">SQLZoo</a>, <a target="_blank" href="https://sqlbolt.com/">SQLbolt</a>, <a target="_blank" href="https://www.youtube.com/@LukeBarousse">Luke Barousse</a>, <a target="_blank" href="https://www.youtube.com/@AlexTheAnalyst">Alex the Analyst</a>, <a target="_blank" href="https://www.youtube.com/@TheOyinbooke">Microsoft Power Tools</a>, and finally some SQL games like SQL island and SQL Murder.</p>
<p>Additionally, there are many online courses and books available that cover SQL in-depth. Here are a few to get you started:</p>
<ol>
<li><p><a target="_blank" href="https://www.freecodecamp.org/news/sql-and-databases-full-course/">Learn SQL and Databases – Full Course for Beginners</a></p>
</li>
<li><p><a target="_blank" href="https://www.freecodecamp.org/news/learn-sql-free-relational-database-courses-for-beginners/#relational-database-freecodecamp-curriculum">Relational Database curriculum from freeCodeCamp</a></p>
</li>
<li><p><a target="_blank" href="https://www.freecodecamp.org/news/learn-sql-free-relational-database-courses-for-beginners/">Collection of free relational database courses</a></p>
</li>
</ol>
<p>By mastering SQL, you'll be able to extract valuable insights from databases and manipulate data in ways that provide meaningful business insights.</p>
<h2 id="heading-step-6-learn-python-for-data-analysis">Step 6: Learn Python for Data Analysis</h2>
<p>I know there's a lot of speculation as to whether or not a data analyst needs Python – some say they do while some say they don't.</p>
<p>For me, I'd like to say it depends on the company you're working for – but it's nice to have an edge by learning Python as it's one of the most widely used programming languages in the world of data analysis. Python is known for its simplicity, readability, and versatility, making it a popular choice for data analysts.</p>
<p>Python has a <a target="_blank" href="https://www.freecodecamp.org/news/python-data-science-course-matplotlib-pandas-numpy/">vast array of libraries and tools</a> that can make data analysis easier, such as Pandas for data manipulation and analysis, NumPy for scientific computing, and Matplotlib for data visualization. It also has the <a target="_blank" href="https://www.freecodecamp.org/news/python-automation-scripts/">ability to automate tasks</a>, making data analysis more efficient and effective.</p>
<p><a target="_blank" href="https://www.freecodecamp.org/news/learn-data-analysis-with-python-course/">Learning Python for data analysis</a> is a great investment in your career as a data analyst. Not only will it allow you to work with powerful libraries, but it will also open up many opportunities to work with larger datasets and more complex analyses.</p>
<p>There are many resources available to help you learn Python, from free online courses to paid online programs and textbooks. Some resources include <a target="_blank" href="https://www.youtube.com/@freecodecamp">freeCodeCamp</a>, DataCamp, <a target="_blank" href="https://www.youtube.com/@codebasics">CodeBasis</a>, <a target="_blank" href="https://www.youtube.com/@programmingwithmosh">Programming with Mosh</a> and <a target="_blank" href="https://learn.microsoft.com?wt.mc_id=studentamb_207021">Microsoft Learn.</a></p>
<p>By learning Python, you'll be able to perform more complex data analysis, automate tasks, and work with a broader range of datasets, making you a valuable asset in any data-focused organization.</p>
<h2 id="heading-step-7-master-a-data-visualization-tool">Step 7: Master a Data Visualization Tool</h2>
<p>As a data analyst, it's essential to be able to communicate your findings in a clear and concise manner. One way to do this is through data visualization. Data visualization tools like <a target="_blank" href="https://www.freecodecamp.org/news/python-in-powerbi/">PowerBI</a> and Tableau can help you create interactive charts, graphs, and dashboards that make it easy for others to understand your findings. We'll talk about them more in a minute.</p>
<p>Here's a <a target="_blank" href="https://www.freecodecamp.org/news/tableau-for-data-science-and-data-visualization-crash-course/">Tableau for Data Science and Data Visualization course</a> you can check out.</p>
<p>While SQL is great for querying and manipulating data, it can't fully bring your data to life. This is where a data visualization tool comes in. These tools allow you to transform your data into insightful and easy-to-understand visualizations that can be shared with stakeholders.</p>
<p>You can <a target="_blank" href="https://www.freecodecamp.org/news/learn-data-visualization-in-this-free-17-hour-course/">learn data visualization basics in this in-depth free course</a> on freeCodeCamp's YouTube channel.</p>
<p>PowerBI is a great choice for data visualization as it is easy to learn and integrate with other Microsoft products. This makes it an ideal tool for organizations that use Microsoft Office. Tableau is also a popular choice and has a strong community of users and a wide range of features.</p>
<p>Learning a data visualization tool like PowerBI or Tableau will enable you to create compelling visualizations that help you better understand your data and communicate your findings to others. There are many online courses and tutorials available to help you learn these tools, such as the official <a target="_blank" href="https://learn.microsoft.com/en-us/training/modules/get-started-with-power-bi/">Microsoft PowerBI training</a> and <a target="_blank" href="https://trailheadacademy.salesforce.com/classes/TVA101-Tableau-Visual-Analytics">Tableau's own training courses</a>.</p>
<p>By mastering a data visualization tool, you'll be able to create interactive and engaging visualizations that will help you better understand your data and communicate your findings to others, making you an invaluable asset to any data-focused organization.</p>
<p>You can also dive into other popular data viz tools like D3.js - <a target="_blank" href="https://www.freecodecamp.org/news/data-visualization-using-d3-course/">here's a course on it to get you started</a>.</p>
<h2 id="heading-step-8-network-with-other-data-analysts-and-developers">Step 8: Network with Other Data Analysts and Developers</h2>
<p>Networking is an essential part of any profession, and data analytics is no exception. By networking with other data analysts and developers, you can learn from their experiences, get insights on the latest industry trends and technologies, and potentially find job opportunities.</p>
<p>Here are a few ways to network with others in the field:</p>
<ol>
<li><p>Attend industry events: Look for conferences, meetups, and other events related to data analytics and attend them. This is a great way to meet others in the field and learn about new developments and technologies.</p>
</li>
<li><p>Join online communities: There are many online communities for data analysts and developers, such as forums, LinkedIn groups, and social media groups. Join these communities and participate in discussions to connect with others in the field.</p>
</li>
<li><p>Reach out to others: Don't be afraid to reach out to other data analysts and developers, whether through social media, email, or in person. Introduce yourself, ask for advice, and build relationships.</p>
</li>
</ol>
<p>Remember, networking is a two-way street. Be willing to offer help and advice to others in the field as well. By building a strong network of contacts in the data analytics field, you can enhance your career opportunities and stay up to date on the latest industry trends and technologies.</p>
<h2 id="heading-step-9-dont-forget-about-soft-skills">Step 9: Don't Forget about "Soft Skills"</h2>
<p>One final skill that I think needs to be worked on before you can be a great DA is your soft skills which involves your ability to communicate, solve problems etc</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/03/Analyst.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>After all is said and done, practice and practice and build projects.</p>
<h2 id="heading-conclusion">Conclusion.</h2>
<p>Becoming a data analyst requires dedication, hard work, and a passion for data analysis. Following the steps outlined in this roadmap will help you gain the necessary skills and knowledge to become a successful data analyst.</p>
<p>From understanding the role of a data analyst, to mastering SQL and Python, to networking with other developers, each step is crucial to achieving success in this field.</p>
<p>Remember to stay curious, never stop learning, and always be willing to adapt to new technologies and methodologies. With determination and persistence, you can achieve your goal of becoming a proficient data analyst and unlock a world of exciting career opportunities.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is Data Analytics? Data Analysis and Definition for Beginners ]]>
                </title>
                <description>
                    <![CDATA[ Data analytics is the process of collecting, organizing, and analyzing raw data from different sources. You can then gain insights that'll help organizations make important predictions and decisions.  Data analytics mostly involves studying data tren... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-data-analytics-data-analysis-and-definition-for-beginners/</link>
                <guid isPermaLink="false">66b0a389b23875658c0760c9</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ihechikara Abba ]]>
                </dc:creator>
                <pubDate>Fri, 18 Nov 2022 21:55:08 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/11/stephen-dawson-qwtCeJ5cLYs-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Data analytics is the process of collecting, organizing, and analyzing raw data from different sources. You can then gain insights that'll help organizations make important predictions and decisions. </p>
<p>Data analytics mostly involves studying data trends over a given period, and then extracting useful information from these trends. </p>
<h2 id="heading-why-is-data-analytics-important">Why Is Data Analytics Important?</h2>
<p><strong>More precise decision making process:</strong> Data analytics helps organizations make more accurate decisions based on the insights gotten from data trends over time. </p>
<p>For example, a company selling different products can figure out what time of the year different products sell higher. This will enable them boost production of such products at the required time. </p>
<p>A better decision making process will eliminate the need for guess work, and minimize losses and avoidable risks. </p>
<p><strong>Improved customer satisfaction:</strong> When you're able to serve customers, you retain them and keep business going. Insights gotten from data analytics can help you understand exactly what your customers want and when to act. </p>
<p>Data analytics also enables businesses to identify their target audience easily.</p>
<p><strong>Improved business strategy:</strong> Data analytics helps organizations channel their resources towards the most efficient strategies. </p>
<p><strong>Performance evaluation:</strong> Data analytics can help organizations evaluate how well or badly they've performed over a specified period. This will enable them make important decisions for the future of the organization. </p>
<p>Although the points listed above seem to be from the business point of view, that's not the only industry where data analytics is important. </p>
<p>You can see data analytics being used in healthcare, education, agriculture, and so on. </p>
<h2 id="heading-types-of-data-analytics">Types of Data Analytics</h2>
<p>There are mainly four different types of data analytics:</p>
<ul>
<li><strong>Descriptive analytics:</strong> This type of analytics has to do with <strong>what</strong> happened with analyzed data over a specified period of time. </li>
<li><strong>Diagnostic analytics:</strong> Diagnostic data analytics shows the "<strong>why</strong>" in a data trend. This involves having a deeper look into why certain patterns were present in the data.</li>
<li><strong>Predictive analytics:</strong> The goal here is to foretell what is <strong>expected to happen</strong> in the future based on the outcomes of analyzed data over time. </li>
<li><strong>Prescriptive analytics:</strong> In prescriptive analytics, the results from data analysis is used to make recommendations on <strong>what to do next</strong>.</li>
</ul>
<h2 id="heading-what-is-the-difference-between-data-analysis-and-data-analytics">What Is the Difference Between Data Analysis and Data Analytics?</h2>
<p>You'll come across different definitions of data analytics and data analysis. </p>
<p>Some sources would define data analytics and data analysis as the same. Others would use them interchangeably. </p>
<p>Although, they are closely related, these terms have slightly different meanings. They are similar because they aid in the decision making process.</p>
<h3 id="heading-what-is-data-analysis">What Is Data Analysis?</h3>
<p>Data analysis is the process of studying what has happened in the past in a dataset. There is no need to extend this definition. </p>
<p>Data analysis studies the <strong>why</strong> and <strong>how</strong> of data trends. Yes, it involves data collection, organization, and "analysis". </p>
<p>"How did the users respond to a new feature?".</p>
<p>"Why did the rate of purchase of a product fall during a particular period?".</p>
<p>Data analysts can make use of programming languages when analyzing data or <a target="_blank" href="https://www.freecodecamp.org/news/data-visualization-tools-guide/">data visualization tools</a>. </p>
<h3 id="heading-what-is-data-analytics">What Is Data Analytics?</h3>
<p>Data analytics is the process of taking insights gained from the analysis of past data trends, and making predictions or decisions for the future. </p>
<p>In the beginning of the article, we defined data analytics to include both analysis and analytics. This is mainly as a convention. </p>
<p>Analytics is used to proffer solutions or make recommendations. </p>
<h2 id="heading-summary">Summary</h2>
<p>There is data everywhere. We create them on a daily basis. But data in its raw form has no real meaning. </p>
<p>In order to understand the behavior of data over time, we have to group the data together, study them, and derive useful insights.</p>
<p>This article explained what data analytics is, the importance of data analytics, and the types of data analytics. </p>
<p>We also explained the difference between data analysis and data analytics. </p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Data Analyst VS Data Scientist – What's the Difference? ]]>
                </title>
                <description>
                    <![CDATA[ Data analyst and data scientist are two career paths in big data. And while they do have similarities, each requires different skills.  The basic difference between the two is that a data scientist works to capture data while a data analyst tries to ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/data-analyst-vs-data-scientist-whats-the-difference/</link>
                <guid isPermaLink="false">66adf0a53bf50764799b9ca7</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Data Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data scientist ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Thu, 17 Nov 2022 16:18:21 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/11/web-g1c2368440_1280.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Data analyst and data scientist are two career paths in big data. And while they do have similarities, each requires different skills. </p>
<p>The basic difference between the two is that a data scientist works to capture data while a data analyst tries to gain insights from that data.</p>
<p>This article is for you if you’re interested in a career in big data and you don’t know whether you'd want to be a data analyst or data scientist. It will also help you if you just want to know the differences between a data analyst and a data scientist. </p>
<h2 id="heading-what-well-cover">What We'll Cover</h2>
<ul>
<li><a class="post-section-overview" href="#heading-what-is-data-analytics-and-who-is-a-data-analyst">What is Data Analytics and Who is a Data Analyst?</a><ul>
<li><a class="post-section-overview" href="#heading-what-does-a-data-analyst-do">What does a Data Analyst Do?</a>  </li>
<li><a class="post-section-overview" href="#heading-how-to-become-a-data-analyst">How to Become a Data Analyst</a></li>
</ul>
</li>
<li><a class="post-section-overview" href="#heading-what-is-data-science-and-who-is-a-data-scientist">What is Data Science and Who is a Data Scientist? </a><ul>
<li><a class="post-section-overview" href="#heading-what-does-a-data-scientist-do">What does a Data Scientist Do?</a></li>
<li><a class="post-section-overview" href="#heading-how-to-become-a-data-scientist">How to Become a Data Scientist</a> </li>
</ul>
</li>
<li><a class="post-section-overview" href="#heading-what-are-the-differences-between-data-analyst-and-data-scientist">What are the Differences between Data Analyst and Data Scientist?</a></li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ul>
<h2 id="heading-what-is-data-analytics-and-who-is-a-data-analyst">What is Data Analytics and Who is a Data Analyst?</h2>
<p><strong>Data analytics</strong> bridges the gap between <strong>data science</strong> and <strong>business analytics</strong>. It is the systematic approach of processing raw data and subsequently extracting meaningful information from it. </p>
<p>The information extracted from the raw data is the focus of data analysis. The professional who does this analysis is a <strong>data analyst</strong>.</p>
<h3 id="heading-what-does-a-data-analyst-do">What does a Data Analyst Do?</h3>
<p>Data analysts make use of statistical and logical techniques to evaluate data. They use tools such as SQL to query databases and extract the needed information that can help companies make better decisions. </p>
<p>To dig into and assess the information from this data, a data analyst uses programming languages like R, SAS, and Python, and tools like <a target="_blank" href="https://www.freecodecamp.org/news/data-visualization-using-d3-course/">D3</a>, <a target="_blank" href="https://www.freecodecamp.org/news/tableau-for-data-science-and-data-visualization-crash-course/">Tableau</a>, and <a target="_blank" href="https://powerbi.microsoft.com/en-us/">Power BI</a>.</p>
<p>In addition, a data analyst cleans up the database by getting rid of redundant and unusable data.</p>
<h3 id="heading-how-to-become-a-data-analyst">How to Become a Data Analyst</h3>
<p>To become a data analyst, you can earn a relevant degree from an accredited college or university, attend a bootcamp, or learn it yourself. </p>
<p>You can learn to become a data analyst yourself because building a career in a certain field in tech is all about <strong>skills</strong>. Once you have those skills and you can put them into practical use, then you can become a data analyst. </p>
<p>Some job requirements for data analysts include degrees and some don’t. So there’s room for anyone who doesn’t have a degree but has the skills.</p>
<p>As a data analyst, the skills you need are: </p>
<ul>
<li>Soft skills (critical thinking, communication, and others)</li>
<li>Data visualization (D3, Tableau, Power BI)</li>
<li>SQL and (probably) NoSQL</li>
<li>Statistics </li>
<li>Spreadsheets (Excel, Google Sheets, and others)</li>
<li>A few programming languages like Python, R, SAS, and JavaScript for D3</li>
<li>Machine learning </li>
</ul>
<p>It doesn’t end there. You should try to work on projects that make you appear employable to recruiters. You should also try to get an entry-level job that can help you put those skills into real-world practice. And if you can’t find an entry-level job, then you can consider volunteering. </p>
<p>Here are a few resources you can use to get started:</p>
<ol>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-data-analysis-with-python-course/">Learn Data Analysis with Python</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/exploratory-data-analysis-with-numpy-pandas-matplotlib-seaborn/">What is Data Analysis? Full Handbook</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/data-analysis-with-python-for-excel-users-course/">Data Analysis with Python for Excel Users</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/what-does-a-data-analyst-do-data-analyst-job-description/">What does a Data Analyst Do?</a></li>
</ol>
<h2 id="heading-what-is-data-science-and-who-is-a-data-scientist">What is Data Science and Who is a Data Scientist?</h2>
<p>Data science is the development of strategies for capturing data and preparing it for analysis. It also involves processing and developing data models with programming languages like R and Python, then deploying those models into applications. The professional who develops these strategies is called a data scientist.</p>
<h3 id="heading-what-does-a-data-scientist-do">What does a Data Scientist Do?</h3>
<p>A data scientist is more focused on developing and implementing tools that help data analysts analyze the data and extract the needed information from it. </p>
<p>This means data scientists spend their time developing models and preparing algorithms. And if the organization needs to deploy a model, data scientists are in charge of that.</p>
<h3 id="heading-how-to-become-a-data-scientist">How to Become a Data Scientist</h3>
<p>Most data science job openings require a relevant degree such as Statistics and Computer Science. But on a personal note, I’ve seen data science openings that don’t require degrees. </p>
<p>Towards the end of this article, I will link an article that shows you where to see those data science job openings. </p>
<p>Once again, what matters is the skills. Once you have those skills and can put them into use, then you can get a job as a data scientist. </p>
<p>Some of the skills you need to become a data scientist are:</p>
<ul>
<li>Mathematics</li>
<li>Programming (Python, R, SAS)</li>
<li>Statistics</li>
<li>Linear algebra</li>
<li>Machine learning</li>
<li>Cloud computing</li>
<li>SQL and NoSQL (Most openings won’t require NoSQL but it’s a good skill to learn)</li>
<li>Apache Hadoop</li>
<li>Calculus</li>
</ul>
<p>Here are some resources to get you started:</p>
<ol>
<li><a target="_blank" href="https://www.freecodecamp.org/news/hands-on-data-science-course/">Learn the Basics of Data Science - Hands-On Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/python-data-science-course-matplotlib-pandas-numpy/">Python for Data Science Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/top-statistics-concepts-to-know-before-getting-into-data-science/">Top Statistics Concepts to Know Before Getting Into Data Science</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/23-common-data-science-interview-questions-for-beginners/">Data Science Interview Questions for Beginners</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/first-steps-to-learn-data-science-or-ml-after-the-roadmap/">Programming, Math, and Science Concepts to Know for Data Science</a></li>
</ol>
<h2 id="heading-what-are-the-differences-between-data-analyst-and-data-scientist">What are the Differences between Data Analyst and Data Scientist?</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Basis</td><td>Data Scientist</td><td>Data Analyst</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Programming</strong></td><td>Advance use of languages like Python, R, and SAS</td><td>Basic Knowledge of Python, R, and SAS</td></tr>
<tr>
<td><strong>Skills</strong></td><td>Advanced programming languages, Statistics, Machine learning, cloud computing</td><td>Basic programming languages, statistics, probability, Spreadsheets, Visualization tools</td></tr>
<tr>
<td><strong>Work</strong></td><td>Spend more time developing models, tools, and creating algorithms to ease analysis</td><td>Spend more time writing queries to retrieve data and process data into meaningful information</td></tr>
<tr>
<td><strong>Degree</strong></td><td>Foundational technical background with Bachelor's degree in Computer Science, Statistics, or Infomation systems. Master's degree in Data Science.</td><td>Foundational technical background with Bachelor's degree in Computer Science, Statistics, or Infomation systems. Master's degree in Data Analytics</td></tr>
<tr>
<td><strong>Salary</strong></td><td>$144,729 /year base pay in the US (Indeed)</td><td>$71,717 /year base pay in the US (Indeed)</td></tr>
</tbody>
</table>
</div><h2 id="heading-conclusion">Conclusion</h2>
<p>Data scientist and data analyst are both in-demand career paths you can follow in big data. If you’re confused about which to take get into between the two, here are some things to consider:</p>
<ul>
<li>if you’re well-versed in Mathematics, Statistics, and computer science, either of the two is good for you</li>
<li>if you want to create advanced machine learning models, you should consider getting into <strong>data science</strong></li>
<li>if you are interested in analytics, you’d probably make a great <strong>data analyst</strong>.</li>
</ul>
<p>There’s no black-and-white guide to help you choose between becoming a data scientist and a data analyst. And it's not helpful to say one is better than the other. </p>
<p>In the end, what matters is solving problems and helping humanity learn and improve, not how much a data analyst makes or how much a data scientist makes.</p>
<h3 id="heading-more-general-readings">More General Readings</h3>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-find-remote-jobs/">freeCodeCamp article on how to find remote jobs</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/what-is-data-science-what-a-data-scientist-actually-does/">What is Data Science</a></li>
<li><a target="_blank" href="https://ischoolonline.berkeley.edu/data-science/what-is-data-analytics/">What is Data Analytics</a> </li>
</ul>
<p>Thank you for reading. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Read and Write Data using Azure Databricks ]]>
                </title>
                <description>
                    <![CDATA[ Azure Databricks is a data analytics platform hosted on Microsoft Azure that helps you analyze data using Apache Spark.  Databricks helps you create data apps more quickly. This in turn brings to light valuable insights from your data and helps you c... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-read-and-write-data-using-azure-databricks/</link>
                <guid isPermaLink="false">66ba2dd292031ccc9bfc64d6</guid>
                
                    <category>
                        <![CDATA[ Azure ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Salim Oyinlola ]]>
                </dc:creator>
                <pubDate>Mon, 12 Sep 2022 18:49:37 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/09/download--1-.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Azure Databricks is a data analytics platform hosted on Microsoft Azure that helps you analyze data using Apache Spark. </p>
<p>Databricks helps you create data apps more quickly. This in turn brings to light valuable insights from your data and helps you create robust Artificial Intelligence solutions. </p>
<p>Azure Databricks also combines the strength of Databricks as an end-to-end Apache Spark platform with the scalability and security of Microsoft's Azure platform. </p>
<p>In this tutorial, you will learn how to get started with the platform in Microsoft Azure and see how to perform data interactions including reading, writing, and analyzing datasets. By the end of this tutorial, you will be able to use Azure Databricks to read multiple file types, both with and without a schema. </p>
<h3 id="heading-prerequisites"><strong>Prerequisites</strong></h3>
<p>You will need a valid and active Microsoft Azure account.</p>
<ul>
<li><a target="_blank" href="https://azure.microsoft.com/en-us/free/">Free Azure Trial</a>: With this option, you will start with $100 Azure credit and will have 30 days to use it in addition to free services.</li>
<li><a target="_blank" href="https://azure.microsoft.com/en-us/free/students/">Azure for Students</a>: This offer is available for students only. With this option, you will start with $100 Azure credit with no credit card required. You'll get access to popular services for free whilst you have your credit.</li>
</ul>
<h2 id="heading-how-to-create-your-databricks-workspace"><strong>How to Create Your Databricks Workspace</strong></h2>
<p>You must create an Azure Databricks workspace in your Azure subscription before you can utilize Azure Databricks. Go to the <a target="_blank" href="https://portal.azure.com/">Azure portal</a> to do this. As long as you've created a valid and active Microsoft Azure account, this will function.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-137.png" alt="Image" width="600" height="400" loading="lazy">
<em>The Microsoft Azure Home Page</em></p>
<p>Once there, click the <code>Create a resource</code> button.</p>
<p>On the search prompt in the Create a resource page, search for <code>Azure Databricks</code> and select the <code>Azure Databricks</code> option.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-138.png" alt="Image" width="600" height="400" loading="lazy">
<em>The Microsoft Azure page showing the list of popular resources</em></p>
<p>Open the <code>Azure Databricks</code> tab and create an instance. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-140.png" alt="Image" width="600" height="400" loading="lazy">
<em>The Azure Databricks pane.</em></p>
<p>Click the blue <code>Create</code> button (arrow pointed at it) to create an instance. </p>
<p>Then enter the project details before clicking the <code>Review + create</code> button.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-142.png" alt="Image" width="600" height="400" loading="lazy">
<em>The Azure Databricks configuration page</em></p>
<p>It is important to note that the <code>Subscription</code> option shown above will differ from yours. It will depend on the Azure subscription you have available on your account. </p>
<p>Fill the <code>Workspace name</code> field with a globally unique name. Mine is named <code>salim-freeCodeCamp-databricks1</code>. </p>
<p>Enter the location closest to where you are in the <code>Region</code> option. A region is a set of physical data centers that serve as servers. Since I am based in Lagos, Nigeria, I selected <code>South Africa North</code>. </p>
<p>Select the <code>Standard</code> option which includes Apache Spark with Azure AD in the <code>Pricing Tier</code> option. </p>
<p>With all the configurations set, click the <code>Review + create</code> button. The validation process usually takes about two minutes. </p>
<p>With the validation and deployment processes completed for the workspace, launch the workspace using the <code>Launch Workspace</code> button that appears. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-144.png" alt="Image" width="600" height="400" loading="lazy">
<em>The home page for the created instance of Azure databricks - <code>salim-freeCodeCamp-databricks</code></em></p>
<p>Click on the button and you will automatically be signed in using the Azure Directory Single Sign On.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-145.png" alt="Image" width="600" height="400" loading="lazy">
<em>Signing into the workspace of the integration of Microsoft Azure and Databricks</em></p>
<p>The Microsoft Azure Databricks home page will come up in a new tab as shown below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-146.png" alt="Image" width="600" height="400" loading="lazy">
<em>The Microsoft Azure Databricks home page</em></p>
<p>With the workspace launch, create a cluster using the <code>Create a cluster</code> option on the left of the page.</p>
<p>After you have clicked the button and you have created any prior, you will pick one and build on it. Else, you will have to create a new cluster using the <code>Create Cluster</code> button. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-148.png" alt="Image" width="600" height="400" loading="lazy">
<em>Set the configurations for the Azure Databricks cluster</em></p>
<p>To create the cluster, you have to set the configurations. Choose the <code>Single node</code> option, changing from the <code>Multi node</code> default option, and maintain the other options as default. </p>
<p>Click the <code>Create Cluster</code> button at the bottom of the page. Note that this will take a few minutes and that if the dataset is large, you can explore the <code>Multi node</code> option. </p>
<p>Having created the cluster, import some ready-to-use notebooks by navigating to <code>Workspace</code> <code>&gt;</code> <code>Users</code> <code>&gt;</code> <code>your_account</code> on the left taskbar.</p>
<p>Right-click and select the <code>Import</code> option on the dropdown menu.</p>
<p>With the cluster created, you will then have to import some ready to use notebooks. </p>
<p>To do this, using the left taskbar, you will navigate through <code>Workspace</code> <code>&gt;</code> <code>Users</code> <code>&gt;</code> <code>your_account</code> . Then right-click to see the dropdown menu. You will then select the <code>Import</code> option on the dropdown menu.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-150.png" alt="Image" width="600" height="400" loading="lazy">
<em>The <code>import</code> button will be used to import the dataset to be used</em></p>
<p>Once you click on the <code>Import</code> button, you will then select the <code>URL</code> option and paste the following URL:</p>
<pre><code>https:<span class="hljs-comment">//github.com/salimcodes/microsoft-learning-paths-databricks-notebooks/blob/master/data-engineering/DBC/03-Reading-and-writing-data-in-Azure-Databricks.dbc</span>
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-151.png" alt="Image" width="600" height="400" loading="lazy">
<em>The database folder named <code>03-Reading-and-writing-data-in-Azure-Databricks.dbc</code> will be used,</em></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-152.png" alt="Image" width="600" height="400" loading="lazy">
<em>You will see he list of files in the <code>03-Reading-and-writing-data-in-Azure-Databricks.dbc</code> database folder</em></p>
<p>The image above is what the workspace will like after downloading the file. As such, you have created a Databricks workspace. </p>
<h2 id="heading-how-to-read-the-data-in-csv-format"><strong>How to Read the Data in CSV Format</strong></h2>
<p>Open the file named <code>Reading Data - CSV</code>.</p>
<p>Upon opening the file, you will see the notebook shown below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-153.png" alt="Image" width="600" height="400" loading="lazy">
<em>You will see that the cluster created earlier has not been attached.</em></p>
<p>On the top left corner, you will change the dropdown which initially shows <code>Detached</code> to your cluster's name. Mine is named <code>Salim Oyinlola's freeCodeCamp Cluster</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/10/image-154.png" alt="Image" width="600" height="400" loading="lazy">
<em>The cluster initially created is now attahed to the python notebook</em></p>
<p>With your cluster attached, you will then run all the cells one after the other.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-261.png" alt="image-261" width="600" height="400" loading="lazy">
<em>Running the first cell of the python notebook will initialize the classroom variables &amp; function, mount the dataset and create user-specific database</em></p>
<p>At its core, the notebook simply reads the data in <code>csv</code> format. Then it adds an option that tells the reader that the data contains a header and to use that header to determine our column names. </p>
<p>You can also add an option that tells the reader to infer each column's data types (also known as a schema).</p>
<p>It is important to note that data can be read in different formats such as JSON (with or without schemas), parquet, and table and views. To achieve this, you can simply run the respective notebooks for each format.</p>
<h2 id="heading-how-to-write-data-into-a-parquet-file"><strong>How to Write Data into a Parquet File</strong></h2>
<p>Just as there are many ways to read data, there are many ways to write data. But in this notebook, we'll get a quick peek of how to write data back out to Parquet files.</p>
<p>Apache Parquet is a column storage file format that Hadoop systems (such as Spark and Hive) use. The file format is cross-platform, language independent, and it stores data in a column layout using a binary representation.</p>
<p>Parquet files, which effectively store large datasets, have the extension <code>.parquet</code>.</p>
<p>Like what you did when reading data, you will also run the cells one after the other.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-275.png" alt="image-275" width="600" height="400" loading="lazy">
<em>The cell to write data into a parquet file</em></p>
<p>Integral to writing into the parquet file is creating a DataFrame. You will be creating one by running this cell.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-276.png" alt="image-276" width="600" height="400" loading="lazy">
<em>This cell shows that the existing files are being overwritten</em></p>
<p>The <code>.mode"overwrite"</code> method shown below implies that by writing DataFrame to parquet files, you are replacing existing files.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-277.png" alt="image-277" width="600" height="400" loading="lazy">
<em>The file has been written and saved in an output location.</em></p>
<p>At its core, the notebook reads a <code>.tsv</code> file (the same used to read for the <code>.csv</code> file) and writes it back out as a Parquet file.</p>
<h2 id="heading-how-to-delete-the-azure-databricks-instance-optional"><strong>How to Delete the Azure Databricks Instance (Optional)</strong></h2>
<p>Finally, the Azure resources that you created in this tutorial can incur ongoing costs. To avoid such costs, it is important to delete the resource or resource group that contains all those resources. You can do that by using the Azure portal.</p>
<ul>
<li>Navigate to the Azure portal.</li>
<li>Navigate to the resource group that contains your Azure Databricks instance.</li>
<li>Select <code>Delete resource group</code>.</li>
<li>Type the name of the resource group in the confirmation text box.</li>
<li>Select <code>Delete</code>.</li>
</ul>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>In this tutorial, you have learned the basics about reading and writing data in Azure Databricks.</p>
<p>You now understand the basics of Azure Databricks, including what it is, how to install it, how to read CSV and parquet files, and how to read parquet files into the Databricks file system (DBFS) using compression options.</p>
<p>Finally, I share my writings on <a target="_blank" href="https://twitter.com/SalimOpines">Twitter</a> if you enjoyed this article and want to see more.</p>
<p>Thank you for reading :)</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Perform Data Augmentation in NLP Projects ]]>
                </title>
                <description>
                    <![CDATA[ By Davis David In machine learning, you need to have a large amount of data in order to achieve strong model performance.  Using a method known as data augmentation, you can create more data for your machine learning project. Data augmentation is a c... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-perform-data-augmentation-in-nlp-projects/</link>
                <guid isPermaLink="false">66d84eb9ef84e4cc27cfbe33</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Machine Learning ]]>
                    </category>
                
                    <category>
                        <![CDATA[ natural language processing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ nlp ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 24 Jun 2022 15:33:57 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/06/1_eproIleJllsp0enh6HA2Hw.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Davis David</p>
<p>In machine learning, you need to have a large amount of data in order to achieve strong model performance. </p>
<p>Using a method known as data augmentation, you can create more data for your machine learning project. Data augmentation is a collection of techniques that manage the process of automatically generating high-quality data on top of existing data.</p>
<p>In computer vision applications, augmenting approaches are quite common. If you are working on a computer vision project (like image classification), for instance, you can apply dozens of techniques to each image: shift, modify color intensities, scale, rotate, crop, and more.</p>
<p>If you have a tiny dataset for your ML project or wish to reduce overfitting in your machine learning models, it may be a good idea to apply data augmentation approaches.</p>
<blockquote>
<p>“We don’t have better algorithms. We just have more data.”- Peter <a target="_blank" href="https://research.google/people/author205/?ref=hackernoon.com">Norvig</a></p>
</blockquote>
<p>In the field of Natural Language Processing (NLP), the tremendous complexity of language makes it difficult to augment the text. The process of augmenting text data is more challenging and not as straightforward as you might expect.</p>
<p>In this article, you will learn how to use a library called <a target="_blank" href="https://github.com/QData/TextAttack?ref=hackernoon.com">TextAttack</a> to improve data for natural language processing.</p>
<h2 id="heading-what-is-textattack">What is TextAttack?</h2>
<p>TextAttack is a Python framework that was built by the <a target="_blank" href="https://qdata.github.io/qdata-page/?ref=hackernoon.com">QData team</a> for the purpose of conducting adversarial attacks, adversarial training, and data augmentation in natural language processing. </p>
<p>TextAttack has components that can be utilized independently for a variety of basic natural language processing tasks, including sentence encoding, grammar checking, and word substitution.</p>
<p>TextAttack excels in performing the following three functions:</p>
<ol>
<li>Adversarial attacks (Python: <code>**textattack.Attack**</code>, Bash: <code>**textattack attack**</code>).</li>
<li>Data augmentation (Python: <code>**textattack.augmentation.Augmenter**</code>, Bash: <code>**textattack augment**</code>).</li>
<li>Model training (Python: <code>**textattack.Trainer**</code>, Bash: <code>**textattack train**</code>).</li>
</ol>
<p>For this article, we will focus on how to use the TextAttack library for data augmentation.</p>
<h2 id="heading-how-to-install-texattack">How to Install TexAttack</h2>
<p>To use this library, make sure you have Python 3.6 or above in your environment.</p>
<p>Run the following command to install textAttack:</p>
<pre><code class="lang-python">pip install textattack
</code></pre>
<p><strong>Note:</strong> Once you have installed TexAttack, you can run it via the Python module or via the command line.</p>
<h2 id="heading-data-augmentation-techniques-for-text-data">Data Augmentation Techniques for Text Data</h2>
<p>The TextAttack library has various augmentation techniques that you can use in your NLP project to add more text data. </p>
<p>Here are some of the techniques that you can apply:</p>
<h3 id="heading-charswapaugmenter-technique"><code>CharSwapAugmenter</code> technique</h3>
<p>This technique augments words by swapping characters out for other characters.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> textattack.augmentation <span class="hljs-keyword">import</span> CharSwapAugmenter

text = <span class="hljs-string">"I have enjoyed watching that movie, it was amazing."</span>

charswap_aug = CharSwapAugmenter()

charswap_aug.augment(text)
</code></pre>
<p>[‘I have enjoyed watching that omvie, it was amazing.’]</p>
<p>The Augmenter has swapped the word <strong>“movie”</strong> for <strong>“omvie”</strong>.</p>
<h3 id="heading-deletionaugmenter-technique"><code>DeletionAugmenter</code> technique</h3>
<p>This one augments the text by deleting some parts of the text to make new text.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> textattack.augmentation <span class="hljs-keyword">import</span> DeletionAugmenter

text = <span class="hljs-string">"I have enjoyed watching that movie, it was amazing."</span>

deletion_aug = DeletionAugmenter()

deletion_aug.augment(text)
</code></pre>
<p>[‘I have watching that, it was amazing.’]</p>
<p>This method has removed the word <strong>“enjoyed”</strong> to create a new augmented text.</p>
<h3 id="heading-easydataaugmenter-technique"><code>EasyDataAugmenter</code> technique</h3>
<p>This augments the text with a combination of different methods, such as:</p>
<ul>
<li>Randomly swapping the positions of the words in the sentence.</li>
<li>Randomly removing words from the sentence.</li>
<li>Randomly inserting a random synonym of a random word at a random location.</li>
<li>Randomly replacing words with their synonyms.</li>
</ul>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> textattack.augmentation <span class="hljs-keyword">import</span> EasyDataAugmenter

text = <span class="hljs-string">"I was billed twice for the service and this is the second time it has happened"</span>

eda_aug = EasyDataAugmenter()

eda_aug.augment(text)
</code></pre>
<p>[‘I was billed twice for the service and this is the second time it has happen’, ‘I was billed twice for the one service and this is the second time it has happened’, ‘I billed twice for the service and this is the second time it has happened’,<br>‘I was billed twice for the this and service is the second time it has happened’]</p>
<p>As you can see from the augmented texts, it shows different results based on the methods applied. For example in the first augmented text, the last word has been modified from <strong>“happened”</strong> to <strong>“happen”</strong>.</p>
<h3 id="heading-wordnetaugmenter-technique"><code>WordNetAugmenter</code> technique</h3>
<p>This technique can augment the text by replacing it with synonyms from the WordNet thesaurus.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> textattack.augmentation <span class="hljs-keyword">import</span> WordNetAugmenter

text = <span class="hljs-string">"I was billed twice for the service and this is the second time it has happened"</span>

wordnet_aug = WordNetAugmenter()

wordnet_aug.augment(text)
</code></pre>
<p>[‘I was billed twice for the service and this is the second time it has pass’]</p>
<p>This method has changed the word <strong>“happened”</strong> to <strong>“pass”</strong> in order to create a new augmented text.</p>
<h3 id="heading-how-to-create-your-own-augmenter">How to Create Your Own Augmenter</h3>
<p>Importing transformations and constraints from <code>textattack.transformations</code> and <code>textattack.constraints</code> allows you to build your own augmenter from the ground up. </p>
<p>The following is an illustration of the use of the <code>WordSwapRandomCharacterDeletion</code> algorithm to produce augmentations of a string:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> textattack.transformations <span class="hljs-keyword">import</span> WordSwapRandomCharacterDeletion
<span class="hljs-keyword">from</span> textattack.transformations <span class="hljs-keyword">import</span> CompositeTransformation
<span class="hljs-keyword">from</span> textattack.augmentation <span class="hljs-keyword">import</span> Augmenter

my_transformation = CompositeTransformation([WordSwapRandomCharacterDeletion()])
augmenter = Augmenter(transformation=my_transformation, transformations_per_example=<span class="hljs-number">3</span>)

text = <span class="hljs-string">'Siri became confused when we reused to follow her directions.'</span>

augmenter.augment(text)
</code></pre>
<p>[‘Siri became cnfused when we reused to follow her directions.’, ‘Siri became confused when e reused to follow her directions.’, ‘Siri became confused when we reused to follow hr directions.’]</p>
<p>The output shows different augmented texts after implementing the <code>WordSwapRandomCharacterDeletion</code> method. For example, in the first augmented text, the method randomly removes the character “<strong>o”</strong> in the word “<strong>confused”.</strong></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article, you have learned the significance of data augmentation for your Machine Learning projects. You've also learned how to execute data augmentation for textual data using the TextAttack library.</p>
<p>To the best of my knowledge, these techniques are the most effective approaches available to do the task for your NLP project. Hopefully they’ll be of use to you in your work.</p>
<p>You can also try to use other available augmentation techniques from the TextAttack library such as:</p>
<ul>
<li>EmbeddingAugmenter</li>
<li>CheckListAugmenter</li>
<li>CLAREAugmenter</li>
</ul>
<p>If you learned something new or enjoyed reading this article, please share it so that others can see it. Until then, see you in the next post!</p>
<p>You can also find me on Twitter <a target="_blank" href="https://twitter.com/Davis_McDavid?ref=hackernoon.com">@Davis_McDavid</a>.</p>
<p>And you can read more articles like this <a target="_blank" href="https://hackernoon.com/u/davisdavid">here</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What Does a Data Analyst Do? Data Analyst Job Description ]]>
                </title>
                <description>
                    <![CDATA[ We live in a digital world, and with each passing day, we create 2.5 quintillion bytes of data. That amount of data is generated by activities like browsing the web, using social media sites and streaming platforms, and communicating via instant mess... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-does-a-data-analyst-do-data-analyst-job-description/</link>
                <guid isPermaLink="false">66b1e4ca96a9e0a75592bbdd</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Data Science ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Dionysia Lemonaki ]]>
                </dc:creator>
                <pubDate>Mon, 06 Jun 2022 20:44:16 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/06/carlos-muza-hpjSkU2UYSU-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>We live in a digital world, and with each passing day, we create 2.5 <em>quintillion</em> bytes of data.</p>
<p>That amount of data is generated by activities like browsing the web, using social media sites and streaming platforms, and communicating via instant messaging applications with friends and family. </p>
<p>These are just a few of the online activities we take part in on a daily basis.</p>
<p>And that means data is everywhere.</p>
<p>Because of how present data is in our lives and how it affects and powers most of the things we do nowadays, companies have found ways and strategies to use data to process information, predict future trends, and accelerate their growth and profit.</p>
<p>An example of this is that a company will use data to understand the appropriate audience for its product/service. </p>
<p>Then, it will use data to target that audience with content and advertisements to drive sales.</p>
<p>Behind those strategies are data analysts. Their job is to solve problems using data.  </p>
<p>They gather the available data and clean it. Then they process and interpret it and make correlations and relationships between the different data points.</p>
<p>Finally, they make decisions based on the analysis results, which will help solve the problem at hand.</p>
<p>In this article, I will first explain what data analysis is, what data analysts do on a day-to-day basis on their job, as well as the qualifications and technical skills you need to become a data analyst yourself. </p>
<p>Here is what we will cover:</p>
<ol>
<li><a class="post-section-overview" href="#definition">What is data analysis?</a></li>
<li><a class="post-section-overview" href="#responsibilities">What does a data analyst do on a day to day basis?</a><ol>
<li><a class="post-section-overview" href="#business-needs">Understand business needs</a></li>
<li><a class="post-section-overview" href="#gather-data">Gather data</a></li>
<li><a class="post-section-overview" href="#rel-databases">Work with relational databases</a></li>
<li><a class="post-section-overview" href="#organize-data">Organize and clean data</a></li>
<li><a class="post-section-overview" href="#patterns">Analyze and identify patterns in data</a></li>
<li><a class="post-section-overview" href="#visualize">Visualize and Present Data</a></li>
<li><a class="post-section-overview" href="#reports">Conduct Reports On Data Analysis Results</a></li>
</ol>
</li>
<li><a class="post-section-overview" href="#skills">What skills and qualifications do you need to become a data analyst?</a></li>
</ol>
<h2 id="heading-what-is-data-analysis">What Is Data Analysis? <a></a></h2>
<p>Data analysis is the process of analyzing and turning raw data into practical insights. By utilizing those insights, businesses and organizations can make more informed decisions.</p>
<p>In more detail, data analysis includes:</p>
<ul>
<li>Identifying a problem and then identifying the kind and type of data needed for the analysis. This stage also involves creating various hypotheses.</li>
<li>Extracting and gathering information from multiple sources.</li>
<li>Cleaning the extracted data. Data is usually raw and messy, and is not usable in that form. This stage involves fixing typos, correcting errors, filling in missing values, and standardizing the data.</li>
<li>Analyzing data to confirm the initial hypotheses.</li>
<li>Interpreting the results to understand the problem at hand and what is going on. This stage involves presenting the findings and results of the analysis to business executives, key stakeholders, and decision-makers clearly and concisely. Data analysts will use the data to tell a compelling story that will determine the future and next steps for the business.</li>
</ul>
<p>To learn more about data analysis, the data analysis process, and why data analysis is beneficial for businesses, <a target="_blank" href="https://www.freecodecamp.org/news/what-is-data-analysis/">read this article which covers these topics in more detail</a>.</p>
<h2 id="heading-what-does-a-data-analyst-do-on-a-day-to-day-basis">What Does A Data Analyst Do On A Day to Day Basis? <a></a></h2>
<p>In the following sections, I've listed some of the daily tasks and responsibilities of a data analyst.</p>
<p>These will depend on the company (size and sector) and the team the data analyst is on.</p>
<h3 id="heading-understand-business-needs">Understand Business Needs <a></a></h3>
<p>Data analysts need to understand how the business is currently performing and what the current business needs are.</p>
<p>They need to understand what problem the business is trying to solve and what direction it wants to head in the future.</p>
<p>Trying to figure out all those needs will involve working with management and different departments in the company.</p>
<p>It will also involve asking questions about why the data analyst is conducting the analysis in the first place and turning all the questions into hypotheses and actionable tasks.</p>
<h3 id="heading-gather-data">Gather Data <a></a></h3>
<p>Data analysts typically find data themselves and collect it from multiple sources.</p>
<p>The method of gathering data will depend on the type of data they are using.  The way of extracting data will depend on whether the data is quantitative (numerical) or qualitative (non-numerical).</p>
<p>The data that needs to be collected should be relevant to the problem at hand.</p>
<p>Some of the ways of gathering information are:</p>
<ul>
<li>Conducting surveys on user satisfaction</li>
<li>Viewing customer feedback</li>
<li>Tracking website visits and social media analytics</li>
<li>Querying for the most searched keywords</li>
<li>Checking which ads get clicked on the most</li>
</ul>
<p>A data analyst is also responsible for improving the existing processes for gathering and collecting data and looking for ways that the process can be streamlined and more effective.</p>
<h3 id="heading-work-with-relational-databases">Work With Relational Databases <a></a></h3>
<p>When looking for, pulling, and storing information, data analysts will mostly query and work with relational databases using SQL (Structured Query Language) - the language used for communicating with relational databases.</p>
<p>In relational databases, data is stored in rows and columns, and all data points have defined and pre-established relationships with one another.</p>
<p>Data analysts will also be involved in developing and improving the systems and structure of the relational database by modeling the data and defining the schema, which is the behind-the-scenes logic in relational databases.</p>
<h3 id="heading-organize-and-clean-data">Organize and Clean Data <a></a></h3>
<p>When data analysts first gather the required data, most often than not, it will not be in a usable state.</p>
<p>Data analysts will improve the quality and format of the data by filling in missing values, removing duplicates, and identifying outliers and errors.</p>
<p>Cleaning is one of the most necessary tasks in the data analyst’s job since the analysis results will depend on it. </p>
<p>If data is not cleaned, there is a very high chance that the results of the analysis will be skewed.</p>
<h3 id="heading-analyze-and-identify-patterns-in-data">Analyze and Identify Patterns In Data <a></a></h3>
<p>A big part of a data analyst’s job is to interpret complex data and find patterns.</p>
<p>Data analysts connect the dots between a problem and the data available.</p>
<p>Their job is to predict future trends and translate those predictions into something useful, such as answering questions and coming up with actionable next steps for the company.</p>
<h3 id="heading-visualize-and-present-data">Visualize and Present Data <a></a></h3>
<p>A big part of the job of a data analyst is to visualize data with graphs and charts that will answer the initial questions and problems defined in the early stages of the analysis.</p>
<p>Visualizing data is achieved by developing and maintaining dashboards and using data visualization tools such as Tableau.</p>
<p>Visualizing data is a way of communicating findings and presenting data and valuable business insights to the company, which includes stakeholders, leaders, and executives, in a way that is clear and easily understood by non-technical folks.</p>
<p>The presentation will inform business decisions and play a big part in the company's strategy.</p>
<h3 id="heading-conduct-reports-on-data-analysis-results">Conduct Reports On Data Analysis Results <a></a></h3>
<p>Once the data analysis process has come to an end, the data analyst needs to build and write reports that summarize the key findings and insights gathered.</p>
<h2 id="heading-what-skills-and-qualifications-do-you-need-to-become-a-data-analyst">What Skills and Qualifications Do You Need To Become A Data Analyst? <a></a></h2>
<p>One of the first questions you may have about starting a career in data analysis is whether you need a university degree to enter the field.</p>
<p>Although it is not necessary per se, the majority of companies list a university degree as one of the minimum requirements for the job. And that degree could be in computer science, math, statistics, finance, or business.</p>
<p>So, although you can learn the hard technical skills needed for a data analyst job on your own, having a university degree in one of those disciplines definitely wouldn't hurt.</p>
<p>The next question you may have is, what are the hard skills necessary for the job?</p>
<p>Some of them include:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-microsoft-excel/">Microsoft Excel skills</a> and <a target="_blank" href="https://www.freecodecamp.org/news/learn-google-sheets/">Google Sheets skills</a>. Excel and Google Sheets are two spreadsheet tools used for extracting insights and figuring out patterns from data.</li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-sql-in-10-minutes/">Knowledge of SQL</a>. As mentioned earlier, SQL is a database query language and is used for interacting with data stored in relational databases. As a data analyst, you need to know how to use SQL to perform CRUD (Create Read Update Delete) operations on the data stored in relational databases.</li>
<li>Knowledge of a data visualization tool. A data visualization tool such as <a target="_blank" href="https://www.freecodecamp.org/news/tableau-for-data-science-and-data-visualization-crash-course/">Tableau</a> is used for presenting data insights by creating interactive dashboards.</li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/free-statistics-course/">Knowledge of statistcs</a>. As a data analyst, a big part of the job is working with numbers, so you need to know at least the basics of statistics by taking an intro to statistics course. And some <a target="_blank" href="https://www.freecodecamp.org/news/learn-algebra-to-improve-your-programming-skills/">foundational knowledge in math</a> can be of great help too.</li>
<li>Knowledge of a programming language. Knowing a programming language will help data analysts pull data from various sources, automate repetitive data analysis tasks, and analyze and visualize data to spot patterns to extract meaning.<a target="_blank" href="https://www.freecodecamp.org/learn/scientific-computing-with-python/">Python</a> is a beginner-friendly programming language and is popular for data analysis. <a target="_blank" href="https://www.freecodecamp.org/news/r-programming-course/">Another language commonly used is R</a>, which was specifically designed for performing statistical analysis. That said, it has a steep learning curve.</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Hopefully, you found this guide helpful and got some insight into what the role of a data analyst entails and how you can get started with data analysis.</p>
<p>To learn more, check out freeCodeCamp's <a target="_blank" href="https://www.freecodecamp.org/learn/data-analysis-with-python/">data analysis with Python certification</a>. You will learn data analysis concepts using Python and Python libraries such as NumPy and Pandas. In the end, you will also build 5 projects to claim your certification.</p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is Data Analysis? ]]>
                </title>
                <description>
                    <![CDATA[ Data are everywhere nowadays. And with each passing year, the amount of data we are producing will only continue to increase. There is a large amount of data available, but what do we do with all that data? How is it all used? And what does all that ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-data-analysis/</link>
                <guid isPermaLink="false">66b1e4e9ab763c1471e56798</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Dionysia Lemonaki ]]>
                </dc:creator>
                <pubDate>Tue, 31 May 2022 15:59:04 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/05/luke-chesser-JKUTrJ4vK00-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Data are everywhere nowadays. And with each passing year, the amount of data we are producing will only continue to increase.</p>
<p>There is a large amount of data available, but what do we do with all that data? How is it all used? And what does all that data mean?</p>
<p>It’s not much use if we just collect and store data in a spreadsheet or database and don't look at it, explor it, or research it.</p>
<p>Data analysts use tools and processes to derive meaning from data. They are responsible for collecting, manipulating, investigating, analyzing,  gathering insights, and gaining knowledge from it. </p>
<p>This is one of the reasons data analysts are very high in demand: they play an integral role in business and science.</p>
<p>In this article, I will first go over what data analysis means as a term and explain why it is so important.</p>
<p>I will also break down the data analysis process and list some of the necessary skills required for conducting data analysis.</p>
<p>Here is an overview of what we will cover:</p>
<ol>
<li><a class="post-section-overview" href="#data-intro">What is data?</a></li>
<li><a class="post-section-overview" href="#data-analysis-intro">What is data analysis?</a></li>
<li><a class="post-section-overview" href="#importance">Why is data analysis important?</a><ol>
<li><a class="post-section-overview" href="#targeting">Effective  customer targeting</a></li>
<li><a class="post-section-overview" href="#performance">Measure success and performance</a></li>
<li><a class="post-section-overview" href="#problem-solving">Problem solving</a></li>
</ol>
</li>
<li><a class="post-section-overview" href="#overview">An overview of the data analysis process</a><ol>
<li><a class="post-section-overview" href="#step-1">Step 1: recognising and identifying the questions that need answering</a></li>
<li><a class="post-section-overview" href="#step-2">Step 2: collecting  raw data</a></li>
<li><a class="post-section-overview" href="#step-3">Step 3: cleaning the data</a></li>
<li><a class="post-section-overview" href="#step-4">Step 4:  analyzing the data</a></li>
<li><a class="post-section-overview" href="#step-5">Step 5:  sharing the results</a></li>
</ol>
</li>
<li><a class="post-section-overview" href="#skills">What skills are required for data analysis?</a><ol>
<li><a class="post-section-overview" href="#maths">A good grasp of  maths and statistics</a></li>
<li><a class="post-section-overview" href="#sql">Knowledge of SQL and Relational Databases</a></li>
<li><a class="post-section-overview" href="#programming-language">Knowledge of a programming language</a></li>
<li><a class="post-section-overview" href="#data-viz">Knowledge of data visualization tools</a></li>
<li><a class="post-section-overview" href="#excel">Knowledge of Excel</a></li>
</ol>
</li>
</ol>
<h2 id="heading-what-is-data-meaning-and-definition-of-data">What Is Data? Meaning and Definition of Data <a></a></h2>
<p>Data refers to collections of facts and individual pieces of information.</p>
<p>Data is vital for decision-making, planning, and even telling a story.</p>
<p>There are two broad and general types of data:</p>
<ul>
<li>Qualitative data</li>
<li>Quantitative data</li>
</ul>
<p><strong>Qualitative data</strong> is data expressed in non-numerical characters. </p>
<p>It is expressed as images, videos, text documents, or audio.</p>
<p>This type of data can’t be measured or counted. </p>
<p>It is used to determine how people feel about something – it’s about people's feelings, motivations, opinions, perceptions and involves bias. </p>
<p>It is descriptive and aims to answer questions such as ‘Why’, ‘How’, and ‘What’.</p>
<p>Qualitative data is gathered from observations, surveys, or user interviews.</p>
<p><strong>Quantitative data</strong> is expressed in numerical characters.</p>
<p>This type of data is countable, measurable, and comparable.</p>
<p>It is about amounts of numbers and involves things such as quantity and the average of numbers.</p>
<p>It aims to answer questions such as  ‘How much, ‘How many’, ‘How often’, ‘and 'How long’.</p>
<p>The act of collecting, analyzing, and interpreting quantitative data is known as performing statistical analysis. </p>
<p>Statistical analysis helps uncover underlying patterns and trends in data.</p>
<h2 id="heading-what-is-data-analysis-a-definition-for-beginners">What Is Data Analysis? A Definition For Beginners <a></a></h2>
<p>Data analysis is the act of turning raw, messy data into useful insights by cleaning the data up, transforming it, manipulating it, and inspecting it. </p>
<p>The insights gathered from the data are then presented visually in the form of charts, graphs, or dashboards.</p>
<p>The insights discovered can help aid the company’s or organization’s growth. Decision-makers will be able to come to an actionable conclusion and make the right business decisions.</p>
<p>Extracting knowledge from raw data will help the company/organization take steps towards achieving greater customer reach, improving performance, and increasing profit.</p>
<p>At its core, data analysis is about identifying and predicting trends and figuring out patterns, correlations, and relationships in the available data, and finding solutions to complex problems.</p>
<h2 id="heading-why-is-data-analysis-important">Why Is Data Analysis Important? <a></a></h2>
<p>Data equals knowledge.</p>
<p>This means that data analysis is integral for every business.</p>
<p>It can be useful and greatly beneficial for every department, whether it's administration, accounting, logistics, marketing, design, or engineering, to name a few.</p>
<p>Below I will explain why exploring data and giving data context and meaning is really important.</p>
<h3 id="heading-data-analysis-improves-customer-targeting">Data Analysis Improves Customer Targeting <a></a></h3>
<p>By analyzing data, you understand your competitors, and you will be able to match your product/service to the current market needs.</p>
<p>It also helps you determine the appropriate audience and demographic best suited to your product or service.</p>
<p>This way, you will be able to come up with an effective pricing strategy to make sure that your product/service will be profitable. </p>
<p>You will also be able to create more targeted campaigns and know what methods and forms of advertising and content to use to reach your audience directly and effectively. </p>
<p>Knowing the right audience for your product or service will transform your whole strategy. It will become more customer-oriented and customized to fit customers' needs.</p>
<p>Essentially, with the appropriate information and tools, you will be able to figure out how your product or service can be of value and high quality.</p>
<p>You'll also be able to make sure that your product or service helps solve a problem for your customers. </p>
<p>This is especially important in the product development phases since it cuts down on expenses and saves time.</p>
<h3 id="heading-data-analysis-measures-success-and-performance">Data Analysis Measures Success and Performance <a></a></h3>
<p>By analyzing data, you can measure how well your product/service performs in the market compared to others.</p>
<p>You are able to identify the stronger areas that have seen the most success and desired results. And you will be able to identify weaker areas that are facing problems.</p>
<p>Additionally, you can predict what areas could possibly face problems before the problem actually occurs. This way, you can take action and prevent the problem from happening.</p>
<p>Analyzing data will give you a better idea of what you should focus more on and what you should focus less on going forward.</p>
<p>By creating performance maps, you can then go on to set goals and identify potential opportunities.</p>
<h3 id="heading-data-analysis-can-aid-problem-solving">Data Analysis Can Aid Problem Solving <a></a></h3>
<p>By performing data analysis on relevant, correct, and accurate data, you will have a better understanding of the right choices you need to make and how to make more informed and wiser decisions. </p>
<p>Data analysis means having better insights, which helps improve decision-making and leads to solving problems.</p>
<p>All the above will help a business grow.</p>
<p>Not analyzing data, or having insufficient data, could be one of the reasons why your business is not growing. </p>
<p>If that is the case, performing data analysis will help you come up with a more effective strategy for the future. </p>
<p>And if your business is growing, analyzing data will help it grow even further. </p>
<p>It will help reach its full potential and meet different goals – such as boosting customer retention, finding new customers, or providing a smoother and more pleasant customer experience.</p>
<h2 id="heading-an-overview-of-the-data-analysis-process">An Overview Of The Data Analysis Process <a></a></h2>
<h3 id="heading-step-1-recognising-and-identifying-the-questions-that-need-answering">Step 1: Recognising and Identifying The Questions That Need Answering <a></a></h3>
<p>The first step in the data analysis process is setting a clear objective.</p>
<p>Before setting out to gather a large amount of data, it is important to think of why you are actually performing the data analysis in the first place.</p>
<p>What problem are you trying to solve? </p>
<p>What is the purpose of this data analysis?</p>
<p>What are you trying to do?</p>
<p>What do you want to achieve? </p>
<p>What is the end goal? </p>
<p>What do you want to gain from the analysis? </p>
<p>Why do you even need data analysis?</p>
<p>At this stage, it is paramount to have an insight and understanding of your business goals.</p>
<p>Start by defining the right questions you want to answer and the immediate and long-term business goals. </p>
<p>Identify what is needed for the analysis, what kind of data you would need, what data you want to track and measure, and think of a specific problem you want to solve.</p>
<h3 id="heading-step-2-collecting-raw-data">Step 2: Collecting  Raw Data <a></a></h3>
<p>The next step is to identify what type of data you want to collect – whether it will be qualitative (non-numerical, descriptive ) or quantitative (numerical).</p>
<p>The way you go about collecting the data and the sources you gather from will depend on whether it is qualitative or quantitative.</p>
<p>Some of the ways you could collect relevant and suitable data are:</p>
<ul>
<li>By viewing the results of user groups, surveys, forms, questionnaires, internal documents, and interviews that have already been conducted in the business.</li>
<li>By viewing customer reviews and feedback on customer satisfaction.</li>
<li>By viewing transactions and purchase history records, as well as sales and financial figure reports created by the finance or marketing department of the business.</li>
<li>By using a customer relationship management system (CRM) in the company.</li>
<li>By monitoring website and social media activity and monthly visitors.</li>
<li>By monitoring social media engagement.</li>
<li>By tracking commonly searched keywords and search queries.</li>
<li>By checking which ads are regularly clicked on.</li>
<li>By checking customer conversion rates.</li>
<li>By checking email open rates.</li>
<li>By comparing the company’s data to competitors using third-party services.</li>
<li>By querying a database.</li>
<li>By gathering data through open data sets using web scraping. <a target="_blank" href="https://www.freecodecamp.org/news/how-to-scrape-websites-with-python-2/">Web scraping</a> is the act of extracting and collecting data and content from websites.</li>
</ul>
<h3 id="heading-step-3-cleaning-the-data">Step 3: Cleaning The Data <a></a></h3>
<p>Once you have gathered the data from multiple sources, it is important to understand the structure of that data.</p>
<p>It is also important to check if you have gathered all the data you needed and if any crucial data is missing.</p>
<p>If you used multiple sources for the data collection, your data will likely be unstructured. </p>
<p>Raw, unstructured data is not usable. Not all data is necessarily good data.</p>
<p>Cleaning data is the most important part of the data analysis process and one on which data analysts spend most of their time.</p>
<p>Data needs to be cleaned, which means correcting errors, polishing, and sorting through the data. </p>
<p>This could include:</p>
<ul>
<li>Looking for <a target="_blank" href="https://www.freecodecamp.org/news/what-is-an-outlier-definition-and-how-to-find-outliers-in-statistics/">outliers</a> (values that are unusually big or small).</li>
<li>Fixing typos.</li>
<li>Removing errors.</li>
<li>Removing duplicate data.</li>
<li>Managing inconsistencies in the format.</li>
<li>Checking for missing values or correcting incorrect data.</li>
<li>Checking for inconsistencies</li>
<li>Getting rid of irrelevant data and data that is not useful or needed for the analysis.</li>
</ul>
<p>This step will ensure that you are focusing on and analyzing the correct and appropriate data and that your data is high-quality.</p>
<p>If you analyze irrelevant or incorrect data, it will affect the results of your analysis and have a negative impact overall.</p>
<p>So, the accuracy of your end analysis will depend on this step.</p>
<h3 id="heading-step-4-analyzing-the-data">Step 4: Analyzing The Data <a></a></h3>
<p>The next step is to analyze the data based on the questions and objectives from step 1.</p>
<p>There are four different data analysis techniques used, and they depend on the goals and aims of the business:</p>
<ul>
<li><strong>Descriptive Analysis</strong>: This step is the initial and fundamental step in the analysis process. It provides a summary of the collected data and aims to answer the question: “<strong>What</strong> happened?”. It goes over the key points in the data and emphasizes what has already taken place.</li>
<li><strong>Diagnostic Analysis</strong>: This step is about using the collected data and trying to understand the cause behind the issue at hand and identify patterns. It aims to answer the question: “<strong>Why</strong> has this happened?”.</li>
<li><strong>Predictive Analysis</strong>: This step is about detecting and predicting future trends and is important for the future growth of the business. It aims to answer the question: “<strong>What is likely to happen</strong> in the future?</li>
<li><strong>Prescriptive Analysis:</strong> This step is about gathering all the insights from the three previous steps, making recommendations for the future, and creating an actionable plan. It aims to answer the question: “<strong>What needs to be done?</strong>”</li>
</ul>
<h3 id="heading-step-5-sharing-the-results">Step 5: Sharing The Results <a></a></h3>
<p>The last step is to interpret your findings. </p>
<p>This is usually done by creating reports, charts, graphs, or interactive dashboards using data visualization tools.</p>
<p>All the above will help support the presentation of your findings and the results of your analysis to stakeholders, business executives, and decision-makers.</p>
<p>Data analysts are storytellers, which means having strong communication skills is important.</p>
<p>They need to showcase the findings and present the results in a clear, concise, and straightforward way by taking the data and creating a narrative. </p>
<p>This step will influence decision-making and the future steps of the business.</p>
<h2 id="heading-what-skills-are-required-for-data-analysis">What Skills Are Required For Data Analysis? <a></a></h2>
<h3 id="heading-a-good-grasp-of-maths-and-statistics">A Good Grasp Of Maths And Statistics <a></a></h3>
<p>The amount of maths you will use as a data analyst will vary depending on the job. Some jobs may require working with maths more than others. </p>
<p>You don’t necessarily need to be a math wizard, but with that said, having at least a fundamental understanding of math basics can be of great help.</p>
<p>Here are some math courses to get you started:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-algebra-to-improve-your-programming-skills/">College Algebra – Learn College Math Prerequisites with this Free 7-Hour Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/precalculus-learn-college-math-prerequisites-with-this-free-5-hour-course/">Precalculus – Learn College Math Prerequisites with this Free 5-Hour Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/maths-for-programmers/">Math for Programmers Course</a></li>
</ul>
<p>Data analysts need to have good knowledge of statistics and probability for gathering and analyzing data, figuring out patterns, and drawing conclusions from the data. </p>
<p>To get started, take an intro to statistics course, and then you can move on to more advanced topics:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/free-statistics-course/">Learn College-level Statistics in this free 8-hour course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/if-you-want-to-learn-data-science-take-a-few-of-these-statistics-classes-9bbabab098b9#.esdiw8wnk">If you want to learn Data Science, take a few of these statistics classes</a></li>
</ul>
<h3 id="heading-knowledge-of-sql-and-relational-databases">Knowledge of SQL and Relational Databases <a></a></h3>
<p>Data analysts need to know how to interact with relational databases to extract data.</p>
<p>A database is an electronic storage localization for data. Data can be easily retrieved and searched through.</p>
<p>A relational database is structured in format and all data items stored have pre-defined relationships with each other.</p>
<p>SQL stands for <strong>S</strong>tructured <strong>Q</strong>uery <strong>L</strong>anguage and is the language used for querying and interacting with relational databases.</p>
<p>By writing SQL queries you can perform CRUD (Create, Read, Update, and Delete) operations on data.</p>
<p>To learn SQL, check out the following resources:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-sql-in-10-minutes/">SQL Commands Cheat Sheet – How to Learn SQL in 10 Minutes</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-sql-free-relational-database-courses-for-beginners/">Learn SQL – Free Relational Database Courses for Beginners</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/learn/relational-database/">Relational Database Certification</a></li>
</ul>
<h3 id="heading-knowledge-of-a-programming-language">Knowledge Of A Programming Language <a></a></h3>
<p>To further organize and manipulate databases, data analysts benefit from knowing a programming language.</p>
<p>Two of the most popular ones used in the data analysis field are Python and R.</p>
<p>Python is a general-purpose programming language, and it is very beginner-friendly thanks to its syntax that resembles the English language. It is also one of the most used technical tools for data analysis.</p>
<p>Python offers a wealth of packages and libraries for data manipulation, such as Pandas and NumPy, as well as for data visualization, such as Matplotlib.</p>
<p>To get started, <a target="_blank" href="https://www.freecodecamp.org/news/how-to-learn-python/">first see how to go about learning Python as a complete beginner</a>.</p>
<p>Once you understand the fundamentals, you can move on to learning about Pandas, NumPy, and Matplotlib.</p>
<p>Here are some resources to get you started:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/python-pandas-functions/">How to Get Started with Pandas in Python – a Beginner's Guide</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/the-ultimate-guide-to-the-pandas-library-for-data-science-in-python/">The Ultimate Guide to the Pandas Library for Data Science in Python</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/the-ultimate-guide-to-the-numpy-scientific-computing-library-for-python/">The Ultimate Guide to the NumPy Package for Scientific Computing in Python</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/numpy-python-tutorial/">Learn NumPy and start doing scientific computing in Python</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-analyze-data-with-python-pandas/">How to Analyze Data with Python, Pandas &amp; Numpy - 10 Hour Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/matplotlib-course-learn-python-data-visualization/">Matplotlib Course – Learn Python Data Visualization</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/python-data-science-course-matplotlib-pandas-numpy/">Python Data Science – A Free 12-Hour Course for Beginners. Learn Pandas, NumPy, Matplotlib, and More.</a></li>
</ul>
<p>R is a language used for statistical analysis and data analysis. That said, it is not as beginner-friendly as Python.</p>
<p>To get started learning it, check out the following courses:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/r-programming-language-explained/">R Programming Language Explained</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/r-programming-course/">Learn R programming language basics in just 2 hours with this free course on statistical programming</a></li>
</ul>
<h3 id="heading-knowledge-of-data-visualization-tools">Knowledge of data visualization tools <a></a></h3>
<p>Data visualization is the graphical interpretation and presentation of data. </p>
<p>This includes creating graphs, charts, interactive dashboards, or maps that can be easily shared with other team members and important stakeholders.</p>
<p>Data visualization tools are essentially used to tell a story with data and drive decision-making.</p>
<p>One of the most popular data visualization tools used is Tableau.</p>
<p>To learn Tableau, check out the following course:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/tableau-for-data-science-and-data-visualization-crash-course/">Tableau for Data Science and Data Visualization - Crash Course</a></li>
</ul>
<h3 id="heading-knowledge-of-excel">Knowledge of Excel <a></a></h3>
<p>Excel is one of the most essential tools used in Data analysis.</p>
<p>It is used for storing, structuring, and formatting data, performing calculations, summarizing data and identifying trends, sorting data into categories, and creating reports. </p>
<p>You can also use Excel to create charts and graphs.</p>
<p>To learn how to use Excel, check out the following courses:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-microsoft-excel/">Learn Microsoft Excel - Full Video Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/excel-classes-online-free-excel-training-courses/">Excel Classes Online – 11 Free Excel Training Courses</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/data-analysis-with-python-for-excel-users-course/">Data Analysis with Python for Excel Users Course</a></li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This marks the end of the article – thank you so much for making it to the end!</p>
<p>Hopefully this guide was helpful, and it gave you some insight into what data analysis is, why it is important, and what skills you need to enter the field.</p>
<p>Thank you for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Use Object Storage for Data Parallelization and Experimentation ]]>
                </title>
                <description>
                    <![CDATA[ By using big data, companies can learn a lot about how their businesses are performing. Analytics on sales, churn rates, and other basic metrics are available in almost real time as data comes in.  Then there are more complex analyses that you'll nee... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-object-storage-for-parallelization-and-experimentation/</link>
                <guid isPermaLink="false">66bb5252b0a396d22e4116fa</guid>
                
                    <category>
                        <![CDATA[ big data ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ storage ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ry Vee ]]>
                </dc:creator>
                <pubDate>Mon, 27 Sep 2021 14:09:57 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/09/article-cover-pic.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By using big data, companies can learn a lot about how their businesses are performing. Analytics on sales, churn rates, and other basic metrics are available in almost real time as data comes in. </p>
<p>Then there are more complex analyses that you'll need to do. At times relationships between two seemingly unrelated data sets can provide surprising insights and unveil important opportunities for the organization.</p>
<p>Data scientists and engineers are continuing to improve how they break down and work on data. Experimentation entails discovering the right correlations among data points. </p>
<p>This means they also need to do some sort of parallelization of such data and resulting models. Parallelization simply means that the same data set is being operated upon in many different ways without damaging the integrity of the original data.</p>
<p>In this article we are going to talk about how you can make sure you're doing such experimentation and parallel processing efficiently and that it provides the maximum insights. We will be tackling different concepts related to data storage and data versioning.</p>
<h1 id="heading-block-storage-vs-object-storage">Block Storage vs Object Storage</h1>
<p>For the uninitiated, we first must understand the difference between block and object storage and why the latter is the better option when dealing with data experimentation.</p>
<p><img src="https://lh4.googleusercontent.com/p8F4n7jqjmQtqquQasDGPEj1eRdxhNIsdMFxX9gIM03w6r6u-VRzU6rn2gMqdF1U3lrGOrjWEPwlBFzR-0cYVHWBWF7tigFiS4m_EtYjw0bU4tPATeWsZNYTFwpZTbyLBAzxqmbX=s0" alt="Image" width="1000" height="500" loading="lazy">
_<a target="_blank" href="https://res.cloudinary.com/practicaldev/image/fetch/s--PYImgKrK--/c_imagga_scale,f_auto,fl_progressive,h_500,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4519hl0nf6aze73pyvsr.png">Image source</a>_</p>
<h2 id="heading-what-is-block-storage">What is Block Storage?</h2>
<p>It is called “block storage” (also known as <a target="_blank" href="https://www.snia.org/education/storage_networking_primer/san/what_san">SAN</a>) because each dataset (in the form of files) is grouped into blocks stored in disks. </p>
<p>A classic example of block storage is the file system on your personal computer. For enterprise-level use-cases, it is scaled through a network of hard drives connected through fiber optic cables. </p>
<p>There are a few disadvantages to using block storage. First, if a sector (or a block) becomes corrupted, it can damage the files. Another problem is the lack of scalability (expanding the network of fiber optic cables is costly).</p>
<h2 id="heading-what-is-object-storage">What is Object Storage?</h2>
<p>In object storage, data is stored as objects. Each object contains the actual data, called the blob, a unique identifier (UUID), and metadata, which contains information about the object (such as timestamp, version, and author).</p>
<p>Object storage makes it cost-effective to scale your data store—you don’t need complex hardware for this. It also makes data retrieval faster as each object can be retrieved through its UUID. </p>
<p>This is in contrast to block storage, where each data location needs to be identified before the actual information can be retrieved.</p>
<p>One disadvantage of using object storage is that data can only be written once and cannot be updated. But this isn’t really a disadvantage as we will see further on in this article.</p>
<h2 id="heading-what-problems-does-object-storage-solve">What Problems Does Object Storage Solve?</h2>
<p>As we have already seen, data retrieval can be incredibly fast with object storage (no matter the size of the data store). But when it comes to data experimentation and data parallelization, object storage shines the brightest.</p>
<p>As mentioned before, you can't overwrite any data already stored as an object. This ensures object storage is protected from unwanted (or unauthorized) data destruction or updating. That’s great to know if you do a lot of data processing where accidental corruption of information could happen.</p>
<p>One other problem that object storage can solve is that it doesn’t require data to be structured. As companies produce and consume tremendous amounts of information every moment, often non-structured data (such as PDFs, videos, images) are not so easily processed into useful forms (such as for analytics or dashboards). </p>
<p>With object storage, this is now possible. You can now use non-structured data to develop machine learning models.</p>
<p>With data storage, it’s possible to have different versions of the same blob (with different metadata). As there is Git for code version control, we can have similar ways of managing different versions of the same data.</p>
<p>This brings us to the concept of data lakes.</p>
<h2 id="heading-what-are-data-lakes">What are Data Lakes?</h2>
<p>Data lakes are central repositories of data that don’t care which format such data is in. </p>
<p>Companies produce and consume tremendous amounts of data. Such data traditionally sits in silos because they belong to different departments or are in different forms (for example, videos aren’t stored in the same directory as the data in the MySQL database). </p>
<p>With data lakes, any department in the enterprise can store information without the need to pre-process it. Likewise, any data can be retrieved and analyzed by anybody from any department.</p>
<p>Data lakes are important because they make data analytics extremely fast and convenient.</p>
<h2 id="heading-how-data-experimentation-and-parallelization-work-with-object-storage">How Data Experimentation and Parallelization Work with Object Storage</h2>
<p>As with developing software, working with data requires us to utilize tools that can aid us in our workflow. A powerful open source tool for experimenting with data and performing parallelization (that is working on the same data to create different sets of machine learning models) is LakeFS.</p>
<p>LakeFS is an open source platform that provides Git-like capabilities when working with data. This means you can create branches (allowing you to experiment with data) and commit versions of data (and data models).</p>
<h3 id="heading-why-is-this-git-like-feature-important">Why is this Git-like feature important?</h3>
<p>First, you need to make sure that your data lake is <a target="_blank" href="https://mariadb.com/resources/blog/acid-compliance-what-it-means-and-why-you-should-care/">ACID</a> compliant. This means that your data changes can happen in isolation (in branches). Thus, the integrity of the data is maintained in the master branch (until such changes are ready to be merged).</p>
<p>Another important feature of LakeFS is continuous integration of data (again, much like in software development). Enterprises need to incorporate new data quickly and without being disrupted. Therefore, this ability to have a <a target="_blank" href="https://www.infoworld.com/article/3271126/what-is-cicd-continuous-integration-and-continuous-delivery-explained.html">CI/CD</a> workflow is invaluable. </p>
<p>So, let’s see how we can get started with using LakeFS with our object storage experimentation and parallelization.</p>
<h3 id="heading-how-to-install-lakefs">How to Install LakeFS</h3>
<p>Locally you can install LakeFS by running the following command in your terminal:*  </p>
<p><img src="https://lh4.googleusercontent.com/pTYRbQlB2_Mp8j_XGxUOvBI0PLf5kuuT1tYV5AxcPmrnq8K5sjLCUBwQqp4klk4rnraQnK9OD5hrudEFUwBLNcvmyNGQqDPkLQ_DkVBoVgCUfITIFdS6d1RxtkTFG_T40ZV0ia0L=s0" alt="Image" width="501" height="111" loading="lazy">
<em><a target="_blank" href="https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&amp;t=seti&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=curl%2520https%253A%252F%252Fcompose.lakefs.io%2520%257C%2520docker-compose%2520-f%2520-%2520up%250A">Code source</a></em></p>
<p>_*This is assuming you have Docker and Docker-Compose installed in your system. If you don’t have Docker and Docker-Compose, you may try other installation methods <a target="_blank" href="https://docs.lakefs.io/quickstart/more_quickstart_options.html">here</a>._</p>
<p>Now visit <a target="_blank" href="http://127.0.0.1:8000/setup">http://127.0.0.1:8000/setup</a> in your browser to verify you have installed it correctly.</p>
<h3 id="heading-how-to-create-a-repository-in-lakefs">How to Create a Repository in LakeFS</h3>
<p>Once you’ve verified that LakeFS is installed correctly, go ahead and create an admin user.</p>
<p><img src="https://lh5.googleusercontent.com/kRpsNjJe60f7fiIEFC0O5ZbY88F9g-F4X-GRtl8L8WiVJ_sDiKcnz-0jmprZc-bVkfq029fYhq4K-jdBXyBQttc012Nv4v6j2vbJvk4jnbs71BF9Wulo_5JwsvmSjRE1nkQ-ltRe=s0" alt="Image" width="1627" height="923" loading="lazy">
<em><a target="_blank" href="https://docs.lakefs.io/assets/img/setup.png">Image source</a></em></p>
<p><img src="https://lh3.googleusercontent.com/oez-1Q1JH6Q_cqUh0tKE1bW-IbEXg92UP4NVkTy_o-vVETELASw8R8CoPS5ogWDZNl4hH8W3cb68_PvEECO1os9U1sgfJFA2PMnc1J57wEjomp9SrN0ZZK-OXoOjJpZcF-LPZlhu=s0" alt="Image" width="1627" height="921" loading="lazy">
_<a target="_blank" href="https://docs.lakefs.io/assets/img/setup_done.png">Image source</a>_</p>
<p>Click on the login link and log in as an administrator. </p>
<p>On the page to which you get redirected, click on Create Repository. A popup will appear:</p>
<p><img src="https://lh6.googleusercontent.com/2abxJeRjLk7IRzhohW7jlG3cKQKH4kRCjIyVbQkHe_Fa9qdcGPdrbcTsFRhW7lv3S5LQtfa4xBmnNu0wRqhFSvwi1hp5_ARB_fRJlcLgz1TmDa_a9DQ-apmcIiclMLwsgfuyoD9P=s0" alt="Image" width="1622" height="907" loading="lazy">
_<a target="_blank" href="https://docs.lakefs.io/assets/img/create_repo_local.png">Image source</a>_</p>
<p>Congratulations! You now have your first repository. This is the main “bucket” in which you are going to store your data. </p>
<p>Next, we’ll start adding some data.</p>
<h3 id="heading-how-to-add-data-to-your-lakefs-repository">How to Add Data to your LakeFS Repository</h3>
<p>Visit <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html">here</a> to install AWS CLI.</p>
<p>With the credentials created during the admin-user creation phase, configure a new connection profile:</p>
<p><img src="https://lh5.googleusercontent.com/D9FDuc11VgqsUr5LfN2UE_zTQYSKinNHB_saQxvr0MJj2yurnDCTqEC0cWA-dvOj3TYGMxJq52Una4zpaG6hrImrAaOWA43V1nMsUg0NpI9XIj8lKF6THD3ZoC0BNMqd-uRUsS6p=s0" alt="Image" width="645" height="204" loading="lazy">
<em><a target="_blank" href="https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&amp;t=seti&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=aws%2520configure%2520--profile%2520local%250A%2523%2520output%253A%250A%2523%2520AWS%2520Access%2520Key%2520ID%2520%255BNone%255D%253A%2520AKIAJVHTOKZWGCD2QQYQ%250A%2523%2520AWS%2520Secret%2520Access%2520Key%2520%255BNone%255D%253A%2520****************************************%250A%2523%2520Default%2520region%2520name%2520%255BNone%255D%253A%250A%2523%2520Default%2520output%2520format%2520%255BNone%255D%253A%250A">Code source</a></em></p>
<p>To test if the connection is working, run the following:</p>
<p><img src="https://lh5.googleusercontent.com/oP-iisEz7w9qQM-zQaAUcdhXj_YMRGamhV-AwwNfFsDVm_p4HcKlGsw0sVD0aJS-Q-3rCy3VlhtcvtBxJgFCrHQLXrPB7ZyHVril1iGeWKP_mqPPrxizpw8NNAGWdNc2ZF36mfX4=s0" alt="Image" width="560" height="148" loading="lazy">
<em><a target="_blank" href="https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&amp;t=seti&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=aws%2520--endpoint-url%253Dhttp%253A%252F%252Flocalhost%253A8000%2520--profile%2520local%2520s3%2520ls%250A%2523%2520output%253A%250A%2523%25202021-06-15%252013%253A43%253A03%2520example-repo%250A">Code source</a></em></p>
<p>Now, to copy files into the main branch:</p>
<p><img src="https://lh5.googleusercontent.com/Z_3sbfX6IMJzPkYeejJ1O9ftjkO3c4kPk_rlCJ1iOP2FgTnJTZ03cB8C8Ml2u4bet4cvBS60rHt7Ns-xgLWix422-w3ZvpGQCyeGKgBDd0Oog-sV-E4XSpV4ARpoYeQhR2INZV_H=s0" alt="Image" width="847" height="148" loading="lazy">
<em><a target="_blank" href="https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&amp;t=seti&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=aws%2520--endpoint-url%253Dhttp%253A%252F%252Flocalhost%253A8000%2520--profile%2520local%2520s3%2520cp%2520.%252Ffoo.txt%2520s3%253A%252F%252Fexample-repo%252Fmain%252F%250A%2523%2520output%253A%250A%2523%2520upload%253A%2520.%252Ffoo.txt%2520to%2520s3%253A%252F%252Fexample-repo%252Fmain%252Ffoo.txt%250A">Code source</a></em></p>
<p>Just note that we need to prefix the path with the name of the branch we want to use.</p>
<p>Now, we will see the file we’ve added in the UI:</p>
<p><img src="https://lh6.googleusercontent.com/F8UCd8s43wM0y4WgRhHWy04p2rzBQ1ccvUZhppCzl30fE0FJEpMQb7Y1X06x-WDx3J9I5LELQv4FtFKOYWJqU2E9dENB5MMqjsv-MYfLI-oCEXLekhWH9xTcazm1-_Fmo4NxgDb_=s0" alt="Image" width="1627" height="934" loading="lazy">
_<a target="_blank" href="https://docs.lakefs.io/assets/img/object_added.png">Image source</a>_</p>
<p>Next, we will need to know how to commit and create branches. To do that, we will need to install the LakeFS CLI.</p>
<h3 id="heading-how-to-install-the-lakefs-cli">How to Install the LakeFS CLI</h3>
<p>You need to first download the binary file <a target="_blank" href="https://docs.lakefs.io/#downloads">here</a>. </p>
<p>Again, we need to use the earlier created admin credentials:</p>
<p><img src="https://lh4.googleusercontent.com/KQntIwi6YaOyp2kKvKLxeYs4Il4czCGCv8fj2_PFhg2Bqy2RRGNNQtLsCxS8YT57DEH-Q63obz7emujS5tST4aoPx0qb4XLjJV3AeKEwRwQGATfJd6us3BA5Svo7Lz_i3k_Smy7N=s0" alt="Image" width="552" height="204" loading="lazy">
<em><a target="_blank" href="https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&amp;t=seti&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=lakectl%2520config%250A%2523%2520output%253A%250A%2523%2520Config%2520file%2520%252Fhome%252Fjanedoe%252F.lakectl.yaml%2520will%2520be%2520used%250A%2523%2520Access%2520key%2520ID%253A%2520AKIAJVHTOKZWGCD2QQYQ%250A%2523%2520Secret%2520access%2520key%253A%2520****************************************%250A%2523%2520Server%2520endpoint%2520URL%253A%2520http%253A%252F%252Flocalhost%253A8000%252Fapi%252Fv1%250A">Code source</a></em></p>
<p>Here are some of the commands we can run to try it out:</p>
<p><img src="https://lh4.googleusercontent.com/4HuuBJwfpif6TzMS5spkzhkLQf_TC-rZ6WMjAiOOrsv3z8iF2vaTtKTjzicnm5qDjXmLq_aSGqXvAF7RE43BWd9hGB7gUSb76w1bt6ntyLJgAVFBMLwP7uYRPLFUd-1G27kVER7O=s0" alt="Image" width="721" height="521" loading="lazy">
<em><a target="_blank" href="https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&amp;t=seti&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=lakectl%2520branch%2520list%2520lakefs%253A%252F%252Fexample-repo%250A%2523%2520output%253A%250A%2523%2520%252B----------%252B------------------------------------------------------------------%252B%250A%2523%2520%257C%2520REF%2520NAME%2520%257C%2520COMMIT%2520ID%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257C%250A%2523%2520%252B----------%252B------------------------------------------------------------------%252B%250A%2523%2520%257C%2520main%2520%2520%2520%2520%2520%257C%2520a91f56a7e11be1348fc405053e5234e4af7d6da01ed02f3d9a8ba7b1f71499c8%2520%257C%250A%2523%2520%252B----------%252B------------------------------------------------------------------%252B%250A%2520%2520%2520%2520%2520%250Alakectl%2520commit%2520lakefs%253A%252F%252Fexample-repo%252Fmain%2520-m%2520%27added%2520our%2520first%2520file%21%27%250A%2523%2520output%253A%250A%2523%2520Commit%2520for%2520branch%2520%2522main%2522%2520done.%250A%2523%2520%250A%2523%2520ID%253A%2520901f7b21e1508e761642b142aea0ccf28451675199655381f65101ea230ebb87%250A%2523%2520Timestamp%253A%25202021-06-15%252013%253A48%253A37%2520%252B0300%2520IDT%250A%2523%2520Parents%253A%2520a91f56a7e11be1348fc405053e5234e4af7d6da01ed02f3d9a8ba7b1f71499c8%250A%2520%2520%250Alakectl%2520log%2520lakefs%253A%252F%252Fexample-repo%252Fmain%250A%2523%2520output%253A%2520%2520%250A%2523%2520commit%2520901f7b21e1508e761642b142aea0ccf28451675199655381f65101ea230ebb87%250A%2523%2520Author%253A%2520Example%2520User%2520%253Cuser%2540example.com%253E%250A%2523%2520Date%253A%25202021-06-15%252013%253A48%253A37%2520%252B0300%2520IDT%250A%2520%2520%2520%2520%2520%2520%2520%250A%2520%2520%2520%2520%2520%2520added%2520our%2520first%2520file%21%250A%2520%2520%2520%2520%2520%2520%2520">Code source</a></em></p>
<p>You can find all the other commands, such as branch creation, and so on, <a target="_blank" href="https://docs.lakefs.io/reference/commands.html">online</a>.</p>
<p>There you have it! Now, you can work with your data any way you like. Experiment without guilt and create multiple versions of your data models.</p>
<h2 id="heading-in-closing">In Closing</h2>
<p>In this article, we covered a bit of ground. We learned the different kinds of data storage mechanisms and why object storage has a lot of edge when dealing with data experimentations and parallelism. </p>
<p>Next, we looked into data lakes and LakeFS, which is a powerful tool for working with data.</p>
<p>At first, it might seem a daunting task. But, as we’ve shown here, with the right set of tools and knowledge, there’s a lot you can accomplish.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Google BigQuery Beginner's Guide – How to Analyze Large Datasets ]]>
                </title>
                <description>
                    <![CDATA[ By Ambreen Khan Gone are the days of storing your data in a CSV file or an Excel spreadsheet. If you want to quickly analyze millions of data rows in seconds, BigQuery is the way to go. In this getting started guide, we'll learn about BigQuery and ho... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/google-bigquery-beginners-guide/</link>
                <guid isPermaLink="false">66d45d99aad1510d0766b5e3</guid>
                
                    <category>
                        <![CDATA[ bigquery ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Google ]]>
                    </category>
                
                    <category>
                        <![CDATA[ google cloud ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 12 Jul 2021 11:26:39 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/07/web-1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Ambreen Khan</p>
<p>Gone are the days of storing your data in a CSV file or an Excel spreadsheet. If you want to quickly analyze millions of data rows in seconds, BigQuery is the way to go.</p>
<p>In this getting started guide, we'll learn about BigQuery and how we can use it to query and analyze data.</p>
<h2 id="heading-what-is-bigquery">What is BigQuery?</h2>
<p>BigQuery is an enterprise data warehouse that many companies use who need a fully-managed cloud based solution for their massive datasets. </p>
<p>BigQuery's serverless architecture allows you to quickly execute standard SQL queries and analyze millions of data rows in seconds.  You can then store your data both in Google Cloud Storage in files and buckets or in BigQuery storage. </p>
<p>BigQuery also has excellent integrations with other GCP products, like Data Flow and Data Studio that makes it a great choice for data analytics tasks.</p>
<h2 id="heading-before-you-begin">Before You Begin:</h2>
<p>We are going to query tables in a public dataset that Google has provided to try out BigQuery using the Google Cloud Platform. Therefore, this guide assumes that:</p>
<ul>
<li>You have an access on <a target="_blank" href="https://cloud.google.com/free/?gclid=CjwKCAjw55-HBhAHEiwARMCsziVtllCq8mRIWlXVVztmn6HkzAlkuajtZeYMInLQmykNGfbEjz2tfRoCFs0QAvD_BwE&amp;gclsrc=aw.ds">Google Cloud Platform</a>.</li>
<li>You have already created a <a target="_blank" href="https://cloud.google.com/bigquery/docs/quickstarts/quickstart-web-ui#before-you-begin">Google Cloud project</a>.</li>
<li>Google sandbox environment is up and running. </li>
</ul>
<h2 id="heading-how-to-access-a-public-dataset">How to Access a Public Dataset</h2>
<p>A public dataset is available to the general public through the <a target="_blank" href="https://cloud.google.com/public-datasets">Google Cloud Public Dataset Program</a>. We'll use a Hacker News dataset that contains all stories and comments from Hacker News from its launch in 2006 to present. Let's get started.</p>
<p>Navigate to <a target="_blank" href="https://console.cloud.google.com/marketplace/product/y-combinator/hacker-news">Hacker News dataset</a> and click the VIEW DATASET button. It will take you to the Google Cloud Platform login screen. Login to the account and it will open the BigQuery Editor window with the dataset. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-51.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-the-bigquery-interface-is-organized">How the BigQuery Interface Is Organized</h2>
<p>BigQuery is structured as a hierarchy with 4 levels:</p>
<ul>
<li>Projects: Top-level containers that store the data</li>
<li>Datasets: Within projects, datasets allow you to organize your data and hold one or more tables of data</li>
<li>Tables: Within datasets, tables hold actual data.</li>
<li>Jobs: task performed on data such as running queries, loading data, and exporting data.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-53.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><strong>Note:</strong> Please note that while working with tables, you'll also notice that:</p>
<ul>
<li>Tables are broken out by day meaning that you will need to use a wildcard, or * to pull a larger date range.</li>
<li>There is also an “intraday” table that will give you data for the last 24 hours.</li>
</ul>
<h2 id="heading-how-to-check-the-table-schema">How to Check the Table Schema</h2>
<p>Click on the table name. This will allow you to see what columns are in the table, as well as some buttons to perform various operations on the table.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-55.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-preview-the-data">How to Preview the Data</h2>
<p>Use the preview button to get a sample of some rows in the table. <a target="_blank" href="https://cloud.google.com/bigquery/docs/best-practices-costs#avoid_select_">Don’t do a <code>SELECT *</code> in BigQuery</a>:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-56.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-query-big-data">How to Query Big Data</h2>
<p>SQL statements are used to perform various database tasks, such as querying data, creating tables, and updating databases.</p>
<h3 id="heading-basic-queries">Basic Queries</h3>
<p>Basic queries contain the following components:</p>
<ul>
<li><code>SELECT</code> (required): identifies the columns to be included in the query</li>
<li><code>FROM</code> (required): the table that contains the columns in the SELECT statement</li>
<li><code>WHERE</code>: a condition for filtering records</li>
<li><code>ORDER BY</code>: Used to sort the result-set in ascending or descending order.</li>
<li><code>GROUP BY</code>: how to aggregate data in the result set</li>
</ul>
<h2 id="heading-how-to-compose-a-query-in-bigquery">How to Compose a Query in BigQuery</h2>
<p>For our first query, let’s find out what are the top 5 domains shared in Hacker News in year 2021 so far (query executed on July 9th 2021).</p>
<p>Click the <strong>Compose New query</strong> button. It will open the editor tab.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-41.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Write your first query as below:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span> REGEXP_EXTRACT(<span class="hljs-keyword">url</span>, <span class="hljs-string">'//([^/]*)/?'</span>) <span class="hljs-keyword">domain</span>, <span class="hljs-keyword">COUNT</span>(*) total
<span class="hljs-keyword">FROM</span> <span class="hljs-string">`bigquery-public-data.hacker_news.full`</span>
<span class="hljs-keyword">WHERE</span> <span class="hljs-keyword">url</span>!=<span class="hljs-string">''</span> <span class="hljs-keyword">AND</span> <span class="hljs-keyword">EXTRACT</span>(<span class="hljs-keyword">YEAR</span> <span class="hljs-keyword">FROM</span> <span class="hljs-built_in">timestamp</span>)=<span class="hljs-number">2021</span>
<span class="hljs-keyword">GROUP</span> <span class="hljs-keyword">BY</span> <span class="hljs-keyword">domain</span> <span class="hljs-keyword">ORDER</span> <span class="hljs-keyword">BY</span> total <span class="hljs-keyword">DESC</span> <span class="hljs-keyword">LIMIT</span> <span class="hljs-number">5</span>
</code></pre>
<p>You'll notice that BigQuery debugs your code as you construct it. If the query is valid, then a check mark appears along with the amount of data that the query will process. This helps you determine the cost of running the query. </p>
<p>If the query is invalid, then an exclamation point appears along with an error message.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-59.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>To run this query, click on the Run button. In a few seconds, you should see results returned from the query:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-60.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can click on the <strong>JSON</strong> tab if you want the results in JSON format. You'll also find interesting details under the 'Execution details' column.</p>
<h2 id="heading-how-to-query-multiple-tables-using-a-wildcard-table"><strong>How to Query Multiple Tables Using a Wildcard Table</strong></h2>
<p>Wildcard tables enable you to query multiple tables using concise SQL statements. A wildcard table represents a union of all the tables that match the wildcard expression:</p>
<p><code>FROM</code>tablename.stories_*`` </p>
<h3 id="heading-tablesuffix-pseudo-column">_TABLE_SUFFIX Pseudo Column</h3>
<p>Queries with wildcard tables support the <code>_TABLE_SUFFIX</code> pseudo column in the <code>WHERE</code> clause. To restrict a query so that it scans only a specified set of tables, use the <code>_TABLE_SUFFIX</code> pseudo column in a <code>WHERE</code> clause with a condition that is a constant expression.</p>
<p>Using <code>_TABLE_SUFFIX</code> can greatly reduce the number of bytes scanned, which helps reduce the cost of running your queries.</p>
<h3 id="heading-how-to-get-data-by-providing-a-date-range">How to Get Data by Providing a Date Range</h3>
<pre><code>WHERE _TABLE_SUFFIX BETWEEN
    FORMAT_DATE(‘%Y%m%d’,DATE_SUB(CURRENT_DATE(), INTERVAL <span class="hljs-number">36</span> MONTH))
    AND
    FORMAT_DATE(‘%Y%m%d’,DATE_SUB(CURRENT_DATE(), INTERVAL <span class="hljs-number">1</span> DAY))
</code></pre><h3 id="heading-how-to-use-unnest-to-flatten-the-date">How to Use UNNEST to Flatten the Date</h3>
<p>To convert an <code>ARRAY</code> into a set of rows, also known as "flattening," use the <a target="_blank" href="https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#unnest_operator"><code>UNNEST</code></a> operator. <code>UNNEST</code> takes an <code>ARRAY</code> and returns a table with a single row for each element in the <code>ARRAY</code>:</p>
<pre><code>SELECT * FROM UNNEST ([<span class="hljs-string">'Ambreen'</span>, <span class="hljs-string">'Abdul'</span>, <span class="hljs-string">'Adam'</span>, <span class="hljs-string">'David'</span>]) AS names;
</code></pre><p><img src="https://www.freecodecamp.org/news/content/images/2021/07/image-45.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-save-and-share-queries">How to Save and Share Queries</h2>
<p>You can save your queries for later use. There are 3 types of saved queries:</p>
<ul>
<li><strong>Private:</strong> Private saved queries are visible only to the user who creates them.</li>
<li><strong>Project-level:</strong> Project-level saved queries are visible to members of the predefined BigQuery IAM roles with the required <a target="_blank" href="https://cloud.google.com/bigquery/docs/saving-sharing-queries#permissions">permissions</a>.</li>
<li><strong>Public:</strong> Public saved queries are visible to anyone with a link to the query.</li>
</ul>
<h2 id="heading-summary">Summary</h2>
<p>BigQuery is much more sophisticated than what we explored in this simple tutorial. You can also export Firebase Analytics data to BigQuery, which will let you run sophisticated ad hoc queries against your analytics data. </p>
<p>And with BigQuery ML, you can create and execute machine learning models using standard SQL queries. </p>
<p>If you’re feeling excited and want to learn more about BigQuery, check out the links below.</p>
<h2 id="heading-resources">Resources:</h2>
<ul>
<li><a target="_blank" href="https://support.google.com/analytics/answer/4419694?hl=en#zippy=%2Cin-this-article">BigQuery cookbook</a> </li>
<li><a target="_blank" href="https://cloud.google.com/bigquery/docs/querying-wildcard-tables#filtering_selected_tables_using_table_suffix">Filtering selected tables using _TABLE_SUFFIX</a> </li>
<li><a target="_blank" href="https://firebase.googleblog.com/2017/03/bigquery-tip-unnest-function.html">BigQuery Tip: The UNNEST Function</a></li>
<li><a target="_blank" href="https://towardsdatascience.com/bigquery-unnest-how-to-work-with-nested-data-in-bigquery-f27006a64c3">BigQuery UNNEST: How to work with nested data in BigQuery</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Why You Should Learn Data Analytics ]]>
                </title>
                <description>
                    <![CDATA[ Ok. I'm not suggesting that everyone needs to become a fully-credentialed data scientist. But these days, learning core data skills may provide as much value as basic financial literacy or knowledge of a simple coding language. This isn't just about ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/why-you-should-learn-data-analytics/</link>
                <guid isPermaLink="false">66b9967817d9592471979c33</guid>
                
                    <category>
                        <![CDATA[ data ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ David Clinton ]]>
                </dc:creator>
                <pubDate>Mon, 28 Jun 2021 13:44:39 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/06/statistic-1820320_640.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Ok. I'm not suggesting that <em>everyone</em> needs to become a fully-credentialed data scientist. But these days, learning <em>core</em> data skills may provide as much value as basic financial literacy or knowledge of a simple coding language.</p>
<p>This isn't just about your career: data has grown far beyond the world of IT professionals. It's getting harder to imagine <em>any</em> significant life events that analytics can't help secure and enhance.</p>
<p>And the good news is that acquiring those basic data skills doesn't have to cost you any money or take much time. There's a lot of sophisticated number crunching going on using plain old spreadsheets, for instance.</p>
<p>But even getting up to speed with the far more versatile world of Python and Jupyter Notebooks can happen faster than you might think. </p>
<p><a target="_blank" href="https://www.youtube.com/watch?v=jcTj6FgWOpo">freeCodeCamp's YouTube channel is host to a quick and dirty course of my own</a> that'll get you started. The <a target="_blank" href="https://stories.thedataproject.net/">rest of the course curriculum that's available (for free) on my website</a> can finish the job.</p>
<p>But why should you bother?</p>
<h2 id="heading-who-needs-data-analytics">Who needs data analytics?</h2>
<p>Operations and business decision making of all kinds depend heavily on understanding data. Professionals in the security, administration, business intelligence, scientific research, insurance, and engineering fields would accomplish precious little without their data insights.</p>
<p>There's a constant torrent of data being automatically generated daily by billions of events executed through millions of devices. Whether the data comes from credit card transactions, environmental sensors installed in cars, or system activity on your laptop, there's no end to the stories it could be telling us.</p>
<p>It's the job of an analyst to capture and manipulate data until it yields useful interpretations. That might mean:</p>
<ul>
<li>Identifying and blocking suspicious behavior on distributed IT system infrastructure</li>
<li>Understanding and fixing performance choke points within complex multi-level business processes</li>
<li>Discovering drug interactions with biological pathogens</li>
<li>Detecting patterns and predicting events within financial markets</li>
<li>Integrating online data with real-world operations (through technologies like augmented reality)</li>
</ul>
<p>...Or countless other applications, most of which haven't yet been imagined.</p>
<h2 id="heading-how-will-data-fit-into-your-life">How will data fit into your life?</h2>
<p>Smart use of publicly-accessible data can help you with important decisions. Searching for the right career? Try crunching government data, like that of the US Bureau of Labor Statistics – something I partially demonstrate <a target="_blank" href="https://stories.thedataproject.net/docs/1-cpi_content/">here</a>.</p>
<p>Facing some salary negotiation with your boss? You'd be surprised how much helpful geo-specific salary information there is available.</p>
<p>Not sure which way housing availability and prices in your city are likely to move in the next couple of years? You guessed it, there's almost certainly a public data source to answer all your questions.</p>
<p>Sometimes, of course, the data you're after won't exist in exactly the format you need. Rather than give up, you can crowd source the problem. </p>
<p>That, for example, is what's behind my <a target="_blank" href="https://thedataproject.net/index.php/take-survey-fix-world/">online "Consumer Product Durability" survey</a>. If I'm successful in that particular project, I'll be able to convert the actual experiences of thousands of living, breathing consumers into practical guidance, to help people know when to pay the big bucks for name brands, and when "no-name" is just as good.</p>
<p>The bottom line is that endless streams of data are sitting there, waiting for you to capitalize on them. Whether your goals are personal or professional, if you don't use your data, rest assured, the competition (other people fighting for your job or other organizations fighting for your company's profits) will.</p>
<p>One more thought. You shouldn't think that data analytics is an all or nothing thing: perhaps because – on a basic level – they're so accessible, learning to use some analytics tools can be a powerful <em>addition</em> to your technology portfolio. Think how much more you'll be worth to your employer or business once you can tame their data.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
