<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Victor-kithinji</title>
    <description>The latest articles on DEV Community by Victor-kithinji (@victorkithinji).</description>
    <link>https://dev.to/victorkithinji</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1026184%2F9e9ae148-22a2-4198-9a9a-6736f209a579.png</url>
      <title>DEV Community: Victor-kithinji</title>
      <link>https://dev.to/victorkithinji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/victorkithinji"/>
    <language>en</language>
    <item>
      <title>Building Automated Weather Data Pipeline with Apache Kafka and Cassandra</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Sun, 06 Apr 2025 10:01:35 +0000</pubDate>
      <link>https://dev.to/victorkithinji/building-automated-weather-data-pipeline-with-apache-kafka-and-cassandra-1c2e</link>
      <guid>https://dev.to/victorkithinji/building-automated-weather-data-pipeline-with-apache-kafka-and-cassandra-1c2e</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This project involves implementing an ETL(Extract, Transform, Load) pipeline that fetches real-time weather data from &lt;code&gt;OpenWeatherMap API&lt;/code&gt;, processes it through Apache Kafka and stores it in Cassandra database. The pipeline monitors the weather conditions across multiple cities in the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  System Architecture
&lt;/h2&gt;

&lt;p&gt;The pipeline consists of two main components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data Producer(&lt;code&gt;weather_df.py&lt;/code&gt;): It extracts weather data from &lt;code&gt;OpenWeatherApi&lt;/code&gt; and publishes it to Kafka topic.&lt;/li&gt;
&lt;li&gt;Data Consumer(&lt;code&gt;weather_consumer.py&lt;/code&gt;): Subscribes to the Kafka topic, process the incoming messages and load data into Cassandra database.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;step 1: Creating the scripts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first component is &lt;code&gt;weather_df.py&lt;/code&gt; which handles data extraction and publishing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import requests, os
import json
from dotenv import load_dotenv
from confluent_kafka import Producer
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

load_dotenv()


own_url='https://api.openweathermap.org/data/2.5/weather'
own_api_key=os.getenv('WEATHER_API_KEY')
cities = [
    "Milan",
    "Tokyo",
    "London",
    "Managua",
    "Sydney"
]
def weather_extract(city):

    url = f"{own_url}?q={city}&amp;amp;appid={own_api_key}&amp;amp;units=metric"
    response=requests.get(url)
    data=response.json()
    data['extracted_city']=city
    return data

def delivery_report(err, msg):
    """Callback for Kafka message delivery status."""
    if err is not None:
        logger.error(f"Message delivery failed: {err}")
    else:
        logger.info(f"Message delivered to {msg.topic()} [{msg.partition()}] at offset {msg.offset()}")


kafka_config={
    'bootstrap.servers':os.getenv('BOOTSTRAP_SERVER'),
    "security.protocol": "SASL_SSL",
    "sasl.mechanisms": "PLAIN",
    "sasl.username": os.getenv('CONFLUENT_API_KEY'),
    "sasl.password": os.getenv('CONFLUENT_SECRET_KEY'),
    "broker.address.family": "v4",
    "message.send.max.retries": 5,
    "retry.backoff.ms": 500,
}

producer=Producer(kafka_config)
topic='weather-data'

def produce_weather_data():
    for city in cities:
        data=weather_extract(city)
        if data:
            producer.produce(topic, key=city, value=json.dumps(data), callback=delivery_report)
            producer.poll(0)
        else:
            logger.error(f"Failed to fetch data for {city}")
    producer.flush()

if __name__ == "__main__":
    produce_weather_data()
    logger.info("Data extraction and production complete")

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

&lt;/div&gt;



&lt;p&gt;This script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fetches current weather data for Milan, Tokyo, London, Managua, and Sydney&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transforms the API response to a consistent format&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sends the formatted data to a Confluent_Kafka topic named &lt;code&gt;weather-data&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uses environment variables for secure database connection management.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Running Consumer&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The Consumer &lt;code&gt;weather_consumer.py&lt;/code&gt;file subscribes to and polls the messages from Kafka producer before loading it to the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
from dotenv import load_dotenv
from confluent_kafka import Consumer, KafkaException
from cassandra.cluster import Cluster
from json import loads
from datetime import datetime
import uuid

# --- Load environment variables ---
load_dotenv()

# --- Confluent Kafka Consumer Configuration ---
conf = {
    'bootstrap.servers': os.getenv('BOOTSTRAP_SERVER'),
    'security.protocol': 'SASL_SSL',
    'sasl.mechanisms': 'PLAIN',
    'sasl.username': os.getenv('CONFLUENT_API_KEY'),
    'sasl.password': os.getenv('CONFLUENT_SECRET_KEY'),
    'group.id': 'weather-group-id',
    'auto.offset.reset': 'earliest'
}

# Initialize Kafka consumer

consumer = Consumer(conf)
topic = 'weather-data'  # Topic name
consumer.subscribe([topic])
print(f"Subscribed to topic: {topic}")

# --- Cassandra Setup (Azure Server) ---
try:
    cluster = Cluster(['127.0.0.1'])  # Updated with Azure IP address
    session = cluster.connect()

    session.execute("""
        CREATE KEYSPACE IF NOT EXISTS city_weather_data
        WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}
    """)
    session.set_keyspace("city_weather_data")

    session.execute("""
        CREATE TABLE IF NOT EXISTS city_weather_data (
            id UUID PRIMARY KEY,
            city_name TEXT,
            weather_main TEXT,
            weather_description TEXT,
            temperature FLOAT,
            timestamp TIMESTAMP
        )
    """)
    print("Cassandra table ready")
except Exception as e:
    print("Error setting up Cassandra: {e}")
    session = None

# --- Read from Kafka and Insert into Cassandra ---
if session:
    try:
        while True:
            msg = consumer.poll(1.0)
            if msg is None:
                continue
            if msg.error():
                raise KafkaException(msg.error())
            else:
                try:
                    data = loads(msg.value().decode('utf-8'))

                    # Extract required fields
                    record = {
                        "id": uuid.uuid4(),
                        "city_name": data.get("extracted_city", "Unknown"),
                        "weather_main": data["weather"][0]["main"],
                        "weather_description": data["weather"][0]["description"],
                        "temperature": data["main"]["temp"],
                        "timestamp": datetime.fromtimestamp(data["dt"])
                    }

                    # Insert into Cassandra
                    session.execute("""
                        INSERT INTO city_weather_data (id, city_name, weather_main, weather_description, temperature, timestamp)
                        VALUES (%(id)s, %(city_name)s, %(weather_main)s, %(weather_description)s, %(temperature)s, %(timestamp)s)
                    """, record)

                    print(f"Inserted weather for {record['city_name']} at {record['timestamp']}")

                except Exception as e:
                    print(f"Error processing message: {e}")

    except KeyboardInterrupt:
        print("Consumer stopped manually")

    finally:
        consumer.close()
        print("Kafka consumer closed")

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

&lt;/div&gt;



&lt;p&gt;This script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Subscribes to and polls messages from Kafka&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extracts relevant fields from the weather data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inserts processed records into a Cassandra database&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Setting Up the Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Virtual Environment:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv venv
   source venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install required packages:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install requests python-dotenv confluent-kafka cassandra-driver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Running the Pipeline&lt;/p&gt;

&lt;p&gt;Ensure your Cassandra instance is running. The consumer will automatically create KeySpace and table if they don't exist.&lt;br&gt;
Run the consumer to begin listening for messages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 weather_consumer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a separate terminal, run the producer to fetch and publish weather data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 weather_df.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The producer will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch weather data for each configured city&lt;/li&gt;
&lt;li&gt;Publish messages to Kafka&lt;/li&gt;
&lt;li&gt;Log the status of each operation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data Flow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The producer calls OpenWeatherMap API for each city&lt;/li&gt;
&lt;li&gt;Weather data is serialized to JSON and published to Kafka&lt;/li&gt;
&lt;li&gt;The consumer continuously polls the Kafka topic&lt;/li&gt;
&lt;li&gt;Incoming messages are deserialized and transformed&lt;/li&gt;
&lt;li&gt;Data is inserted into the Cassandra database for persistence&lt;/li&gt;
&lt;li&gt;The process repeats as new data becomes available&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scheduling: Implement Apache Airflow to schedule regular data collection&lt;/li&gt;
&lt;li&gt;Data Validation: Add schema validation to ensure data quality&lt;/li&gt;
&lt;li&gt;Monitoring: Implement metrics collection for pipeline performance&lt;/li&gt;
&lt;li&gt;Scaling: Configure multiple consumer instances for parallel processing&lt;/li&gt;
&lt;li&gt;Analytics: Build data visualization dashboards with the collected weather data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This ETL pipeline demonstrates knowledge on how to build a real-time data processing system using Kafka. It provides a foundation that can be extended for various use cases, from weather analytics to environmental monitoring systems.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Ultimate Guide to Apache Kafka</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Mon, 17 Mar 2025 07:21:20 +0000</pubDate>
      <link>https://dev.to/victorkithinji/the-ultimate-guide-to-apache-kafka-5fc6</link>
      <guid>https://dev.to/victorkithinji/the-ultimate-guide-to-apache-kafka-5fc6</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Apache Kafka is an event streaming platform used to collect, process, store, and integrate data at scale. It has numerous use cases including distributed streaming, stream processing, data integration, and pub/sub messaging. Data streaming involves continuous flow of high volumes of data from different sources for processing and analyzing. An event is any type of action, incident, or change that's identified or recorded by software or applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kafka consists of these key components:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Producer: An application that write data(events) to Kafka topics. A producer can send data to any broker in the Kafka cluster.&lt;/li&gt;
&lt;li&gt;Consumer: An application that reads data from Kafka topics.&lt;/li&gt;
&lt;li&gt;Brokers: Kafka servers that store and replicate messages.&lt;/li&gt;
&lt;li&gt;Topic: Streams of records that Kafka recognizes data into.&lt;/li&gt;
&lt;li&gt;Zookeeper: A distributed coordination service that manages metadata, leader election, and other critical tasks in a Kafka cluster.&lt;/li&gt;
&lt;li&gt;Clusters: Group of servers working together to enhance durability, low latency and scalability.&lt;/li&gt;
&lt;li&gt;Partitions: Division of topics for scalability and parallelism.&lt;/li&gt;
&lt;li&gt;Connect: it manages the tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Installation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Kafka works well on Linux operating system. If you are on windows, you can download Windows Sub-Linux(WSL). To install Kafka, make sure you have Java(Version 11 or 17) installed on your system.&lt;br&gt;
Download Kafka from official website &lt;a href="https://kafka.apache.org/downloads" rel="noopener noreferrer"&gt;&lt;/a&gt;, unzip it using the following command on a terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://archive.apache.org/dist/kafka/3.6.0/kafka_2.12-3.6.0.tgz
tar  -xzf kafka_2.12-3.6.0.tgz

mv kafka_2.12-3.6.0 kafka
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Start Kafka environment&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Kafka traditionally requires Zookeeper for coordination. Start Zookeeper by running the following command on inside the directory that you have installed Kafka:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kafka/bin/zookeeper-server-start.sh kafka/config/zookeeper.properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the zookeeper is running, open another terminal window and run Kafka broker service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
kafka/bin/kafka-server-start.sh kafka/config/server.properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kafka environment is running successfully and ready to be used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Topics in Kafka
&lt;/h2&gt;

&lt;p&gt;Topics are streams of records that Kafka recognizes data into. Producers publish messages to topics, and consumers subscribe to them. &lt;br&gt;
In Kafka, before you write an event, you will to create a topic using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kafka/bin/kafka-topics.sh --create --topic --victor-topic --bootstrap-server 127.0.0.1:9092
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default Kafka runs on port 9092 and localhost &lt;code&gt;127.0.0.1&lt;/code&gt;.&lt;br&gt;
To list down all the topics available, run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kafka/bin/kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Kafka Events
&lt;/h2&gt;

&lt;p&gt;A Kafka client communicates with the Kafka brokers via the network for writing (or reading) events.&lt;br&gt;
Once the brokers receive the events, they will store them in the specified topic for as long as you need.&lt;/p&gt;

&lt;p&gt;Run the console producer client to write events into your topic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kafka/bin/kafka-console-producer.sh --topic victor-topic --bootstrap-server 127.0.0.1:9092
My first event in victor-topic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the console consumer client to read the events you just created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kafka/bin/kafka-console-consumer.sh --topic victor-topic --from-beginning --bootstrap-server 127.0.0.1:9092
My first event in victor-topic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To stop the consumer client, press &lt;code&gt;ctrl + C&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>MASTERING SQL FOR DATA ENGINEERING: ADVANCED QUERIES, OPTIMIZATION AND DATA MODELLING BEST PRATICES</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Wed, 12 Feb 2025 13:52:00 +0000</pubDate>
      <link>https://dev.to/victorkithinji/mastering-sql-for-data-engineering-advanced-queries-optimization-and-data-modelling-best-pratices-3m14</link>
      <guid>https://dev.to/victorkithinji/mastering-sql-for-data-engineering-advanced-queries-optimization-and-data-modelling-best-pratices-3m14</guid>
      <description>&lt;h2&gt;
  
  
  INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;SQL(Structured Query Language) is a very crucial tool for data engineering which enables to access databases, developing data pipeline, data transformation and intergrating analytics. SQL is important for daily operations across analytics, engineering and architectural data roles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT 
    department,
    COUNT(*) as employee_count,
    AVG(salary) as avg_salary
FROM employees e
JOIN departments d ON e.dept_id = d.id
WHERE hire_date &amp;gt;= '2023-01-01'
GROUP BY department
HAVING COUNT(*) &amp;gt; 5;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;SELECT: Specifies columns we want to choose&lt;/li&gt;
&lt;li&gt;JOIN: Connects employees and departments tables using dept_id and id&lt;/li&gt;
&lt;li&gt;WHERE: Filters only employees hired since 2023&lt;/li&gt;
&lt;li&gt;GROUP BY: Groups results by department&lt;/li&gt;
&lt;li&gt;HAVING: Filters groups with more than 5 employees&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ADVANCED SQL TECHNIQUES
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;1. WINDOW FUNCTION&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
These are calculations/operations that you do across a set of tables rows that are related to the current row. They return results per rows unlike aggregate functions which returns one value.&lt;br&gt;
&lt;u&gt;SYNTAX FOR WINDOW FUNCTIONS&lt;/u&gt;&lt;br&gt;
&lt;code&gt;SELECT column1, column2, function() OVER(PARTITION BY Partition_expression ORDER BY sort_expression) AS result_name form table_name&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT 
    employee_name,
    salary,
    department,
    AVG(salary) OVER (PARTITION BY department) as dept_avg,
    salary - AVG(salary) OVER (PARTITION BY department) as diff_from_avg
FROM employees;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PARTITION BY divides data into department/categories&lt;/li&gt;
&lt;li&gt;AVG(salary) OVER calculates average within each partition&lt;/li&gt;
&lt;li&gt;Compares individual salary to department average&lt;/li&gt;
&lt;li&gt;It is useful for trend analysis and comparisons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;2. CTE(COMMON TABLE EXPRESSIONS)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CTE are temporary memory result set that can be referenced within a SQL statement. They last only within the execution of the query. They are used where there are many subqueries hence making the code more readable.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;SYNTAX OF CTEs &lt;/u&gt;&lt;br&gt;
&lt;code&gt;WITH CTE_name AS(SQL query)&lt;br&gt;
SELECT * FROM table;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WITH revenue_data AS (
    SELECT product_id,
           SUM(amount) as total_revenue
    FROM sales
    GROUP BY product_id
),
product_rankings AS (
    SELECT product_id,
           total_revenue,
           RANK() OVER (ORDER BY total_revenue DESC) as revenue_rank
    FROM revenue_data
)
SELECT * FROM product_rankings WHERE revenue_rank &amp;lt;= 10;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;First CTE revenue_data is created with keyword WITH to calculate total revenue per product&lt;/li&gt;
&lt;li&gt;Second CTE product_rankingsis created to rank products by revenue&lt;/li&gt;
&lt;li&gt;We selects top 10 products&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;3. STORED PROCEDURE&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Stored procedure is a SQL statement/ block of queries that you can save and use in the future. They help to save time, make our complex queries more simplified during execution and enhance the database security.&lt;br&gt;
&lt;u&gt;SYNTAX OF STORED PROCEDURE&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE PROCEDURE procedure_name&lt;br&gt;
AS&lt;br&gt;
BEGIN&lt;br&gt;
SQL STATEMENT&lt;br&gt;
END;&lt;br&gt;
EXEC procedure_name;&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  QUERY OPTIMIZATION AND PERFORMANCE TUNING
&lt;/h2&gt;

&lt;p&gt;SQL performance tuning refers to the process of optimizing database queries and operations to ensure faster and more efficient data retrieval.It enhances query execution by addressing problems in storing, indexing, and accessing data. Implementing indexing, eliminating unneccesary operations, use of appropriate data types and reducing subqueries can help achieve faster query execution and better resource utilization.&lt;/p&gt;

&lt;p&gt;Before optimization:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * 
FROM orders 
WHERE YEAR(order_date) = 2024;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After optimization:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT order_id, customer_id, amount 
FROM orders 
WHERE order_date &amp;gt;= '2024-01-01' 
AND order_date &amp;lt; '2025-01-01';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replaced YEAR() function with date range (allows index usage)&lt;/li&gt;
&lt;li&gt;Specified needed columns instead of *&lt;/li&gt;
&lt;li&gt;Added proper date range conditions
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE MATERIALIZED VIEW monthly_sales AS
SELECT 
    DATE_TRUNC('month', order_date) as month,
    customer_id,
    SUM(amount) as total_amount,
    COUNT(*) as order_count
FROM orders
GROUP BY 1, 2
WITH DATA;

CREATE INDEX idx_monthly_sales_customer 
ON monthly_sales(customer_id);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  DATA MODELLING
&lt;/h2&gt;

&lt;p&gt;Data modelling is the creation of your data structure. This refers to how you will want your data to be organized/visual representation.&lt;br&gt;
&lt;strong&gt;Types of data modelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Conceptual data modelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This represents the high level business overview of the data without going much into details. it is the simple the simplke representation of what we want from our data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Lgical data modelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This describe data elements in details and helps to create a visual understanding of the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Physical data modelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This shows how data will be stored in a database for example, &lt;code&gt;student_ID INT PRIMARY KEY&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Entity-relational data model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This shows the relationship that are between different database objects/entities. There are different relationships that exists between different tables in a database namely: one to many, many to many, one to one, many to many relationship.&lt;br&gt;
_&lt;br&gt;
&lt;strong&gt;Data Normalization&lt;/strong&gt;_&lt;/p&gt;

&lt;p&gt;Normalization the process of organizing data to reduce redundancy and ensure data consistency. When you normalize a database, you break down large tables into smaller with a specific purpose.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;levels of normalization&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. First Normal Form (1NF)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each cell in database table must contain only a single value – no lists or multiple values are allowed. For example, instead of having multiple phone numbers in one cell, you'd create a separate phone numbers table. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;2. Second Normal Form (2NF) *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ensures that all non-key attributes fully depend on the primary key. &lt;br&gt;
**&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Third Normal Form (3NF)**&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Eliminates transitive dependencies, that is, data must be moved to a separate table.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Denormalization&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is creating a reference sheet to combine information from multiple sources into one place for easy access. It involves deliberately combining tables that were previously separated during normalization.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Engineering for Beginners: A Step-by-Step Guide</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Mon, 13 Nov 2023 09:07:47 +0000</pubDate>
      <link>https://dev.to/victorkithinji/data-engineering-for-beginners-a-step-by-step-guide-461n</link>
      <guid>https://dev.to/victorkithinji/data-engineering-for-beginners-a-step-by-step-guide-461n</guid>
      <description>&lt;p&gt;&lt;strong&gt;Step 1: Recognize the Fundamentals&lt;/strong&gt; &lt;br&gt;
To start off in the field of data engineering, you must understand the foundations. Learn about ideas such as data structures, data types, and databases. Make a distinction between data that is structured and unstructured. Gain a basic grasp of relational and non-relational databases, as well as the SQL skills necessary for relational database queries. Additionally, learn how to program in languages like Java or Python. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Get information&lt;/strong&gt; &lt;br&gt;
Acquire knowledge of several data collection techniques, such as database queries, APIs, and web scraping. Investigate various data formats, including XML, Parquet, CSV, and JSON, to learn about the structure and storage of data. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Storage of Data&lt;/strong&gt; &lt;br&gt;
Explore database management systems (DBMS) such as Apache Cassandra, MySQL, PostgreSQL, and MongoDB. Investigate data warehousing options like Google BigQuery, Amazon Redshift, and maybe Snowflake. Learn about big data technologies, such as Apache Spark for distributed processing and Hadoop Distributed File System (HDFS) for distributed storage. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Processing Data&lt;/strong&gt; &lt;br&gt;
Recognize how crucial data transformation is. Discover how to use Python libraries like Pandas or technologies like Apache NiFi to clean and manipulate raw data. Examine data integration using Talend and Apache Airflow, two ETL (Extract, Transform, Load) tools and methods. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Governance and Data Quality&lt;/strong&gt; &lt;br&gt;
Examine methods for guaranteeing data quality, like data validation and profiling. Recognize the importance of metadata for data management and comprehension. To guarantee data security and integrity, familiarize yourself with data governance techniques and principles. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Data Pipeline Orchestration&lt;/strong&gt; &lt;br&gt;
Learn how to use workflow management software such as Apache Airflow or Luigi for data workflow orchestration and automation. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Platforms for Clouds&lt;/strong&gt; &lt;br&gt;
Examine cloud computing platforms like AWS, Azure, or Google Cloud to find adaptable and scalable options for processing and storing data. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Observation and Enhancement&lt;/strong&gt; &lt;br&gt;
Acquire the knowledge to oversee and enhance data pipelines for effectiveness and efficiency. Recognize how crucial performance monitoring is to preserving reliable data engineering procedures. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9: Remain Current&lt;/strong&gt;&lt;br&gt;
Keep up with developments in data engineering best practices, new tools, and technology. In an ever-changing sector, lifelong learning is crucial. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10: Construct Projects&lt;/strong&gt; &lt;br&gt;
Put your knowledge to use by completing practical projects. This could entail constructing a database, developing a data pipeline, or taking on particular data engineering tasks. Having real-world experience helps you reinforce your knowledge and abilities. &lt;/p&gt;

&lt;p&gt;Keep in mind that data engineering is a broad area of study, and each stage advances our understanding of the procedures involved in gathering, processing, and archiving data for use in analysis and recommendation.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Complete Guide to Time Series Models</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Sun, 22 Oct 2023 20:13:56 +0000</pubDate>
      <link>https://dev.to/victorkithinji/the-complete-guide-to-time-series-models-116p</link>
      <guid>https://dev.to/victorkithinji/the-complete-guide-to-time-series-models-116p</guid>
      <description>&lt;p&gt;Time Series is a statistical method used to examine and project data points gathered throughout time. It is useful when working with data that displays temporal connections such as stock prices, weather patterns or dales data.&lt;br&gt;
Time series modelling main objecctive is to understand the underlying patterns, trends, and correlations in the data and using the knowledge to forecast future values. This can be done by figuring out and modeling the different elements that make up a time series, like trend, seasonality, and noise.&lt;br&gt;
Machine Learning models for time-series forecasting incluse Autoregressive conditional Heteroscedasticity(ARCH), Vector Autoregressive Model(VaR), LST and Prophet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the full guide to perform Time series modelling&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. Data Preprocessing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gather and arrange your time series data, making sure it is in correct sequence.&lt;br&gt;
Look for any concerns with data quality, such as missing numbers or outliers. &lt;br&gt;
&lt;strong&gt;2. Exploratory Data Analysis (EDA)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;visualize time series data to comprehend the patterns, trends, and seasonality.&lt;br&gt;
&lt;strong&gt;3. Modelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Choose an apropriate time series model depending on the properties of your data and the knowledge received from EDA.&lt;br&gt;
Create training and testing sets of your data, making sure the testing set includes future time periods.&lt;br&gt;
Using the right metrics, such as mean absolute error (MAE), mean squared error (MSE), or root mean square error (RMSE), fit the model on the training set and assess its performance on the testing set.&lt;br&gt;
Evaluate the model's performance compared to baseline models or other alternative models.&lt;br&gt;
If the model's performance is unsatisfactory, change the model's parameters, adding more features, or experimenting with new models entirely.&lt;br&gt;
Repeat this procedure until you get an acceptable degree of precision and dependability.&lt;br&gt;
Once you have a model that works well, you can use it to generate predictions for the future by adding fresh data points.&lt;br&gt;
As fresh data becomes available, keep track of the model's performance over time and change it as necessary.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Exploratory Data Analysis using Data Visualization Techniques.</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Sat, 14 Oct 2023 12:12:35 +0000</pubDate>
      <link>https://dev.to/victorkithinji/exploratory-data-analysis-using-data-visualization-techniques-2gbk</link>
      <guid>https://dev.to/victorkithinji/exploratory-data-analysis-using-data-visualization-techniques-2gbk</guid>
      <description>&lt;p&gt;Data scientists and analysts can better understand their data using exploratory data analysis (EDA), which is a key step before using more sophisticated statistical and machine learning approaches. Data visualization is crucial to EDA because it makes patterns, connections, and abnormalities in the data more obvious. Using data visualization techniques, we will emphasize the key aspects of EDA in this post. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Understand the data *&lt;/em&gt;&lt;br&gt;
EDA begins with a fundamental comprehension of the dataset. This entails investigating the structure, size, and variable types of the data. This preliminary knowledge can be obtained by visualizing the data structure using tools like histograms, bar charts, and summary statistics. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single-variate analysis&lt;/strong&gt; &lt;br&gt;
The emphasis of a univariate analysis is on a single variable. boxes, understanding the distribution of a single variable is made easier by graphs and frequency distributions. Important traits, such as central tendencies, dispersion, skewness, and outliers, can be revealed in this way. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analysis of Variance&lt;/strong&gt; &lt;br&gt;
In a bivariate study, connections between two variables are investigated. The relationships, correlations, or dependencies between pairs of data can be visualized using methods such as scatter plots, heatmaps, and stacked bar charts. For instance, scatter plots can be used to evaluate the link between age and income. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiple-variable analysis&lt;/strong&gt;&lt;br&gt;
 The notion is expanded to include more than two variables in multivariate analysis. Visualizing intricate interactions between numerous variables requires the use of tools like parallel coordinate plots, 3D scatter plots, and bubble charts. These visualizations can assist in identifying trends that bivariate analysis might miss.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dealing with missing&lt;/strong&gt;&lt;br&gt;
Data Visualizing missing data via methods such as The degree of missingness may be understood, and potential patterns or biases in missing data can be found using missing value heatmaps. This is crucial for figuring out the best way to deal with missing data. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Detection of outliers *&lt;/em&gt;&lt;br&gt;
Outliers can be found using visualizations like scatter plots and box plots. Outliers should be carefully evaluated because they can have a major impact on the outcomes of statistical analysis. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analysis of the time series&lt;/strong&gt; &lt;br&gt;
Time series data frequently calls for extra care. Trends, seasonality, and other temporal patterns can be seen in line charts and autocorrelation plots. Techniques for decomposing time series can assist in separating these parts. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transformation of data&lt;/strong&gt; &lt;br&gt;
Data transformation can sometimes help patterns stand out more. To examine the effects of these modifications on the data, techniques like PCA, z-score normalization, and log transformations can be shown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Clustering&lt;/strong&gt;&lt;br&gt;
Data Clustering is an effective method for assembling related data elements. Using tools like scatter plots or dendrogram trees to visualize clusters might help reveal hidden patterns in the data. **&lt;/p&gt;

&lt;p&gt;Geospatial Analysis**&lt;br&gt;
Geographical analysis Spatial point plots, heat maps, and maps can all be used to explore geospatial data. Understanding the spatial distribution of data, locating hotspots, and making location-based decisions all depend on this. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interactive visualizations&lt;/strong&gt;&lt;br&gt;
Users can interactively examine the data using graphs made with programs like Plotly or Tableau. As a result, users can zoom in on, filter out, and delve into the data to have a better understanding of it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Telling Stories with Visualization&lt;/strong&gt; &lt;br&gt;
EDA involves not only data analysis but also successfully conveying your conclusions. A fascinating story can be created using visualization, and stakeholders are better able to understand the insights and act on the data because of this. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reiteration&lt;/strong&gt; &lt;br&gt;
EDA is a continuous process. Especially if you're dealing with iterative data collection or shifting data sources, you might need to go back to the visualization process as you find insights and make decisions to validate or modify your results.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
An important first step in the data analysis process is exploratory data analysis utilizing data visualization tools. Analysts can get insights into the structure, relationships, trends, and anomalies of the data with the use of effective data visualization. Data professionals can extract valuable information and lay the groundwork for more complex analysis and decision-making by utilizing a variety of visualization tools and techniques.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Exploratory Data Analysis using Data Visualization Techniques.</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Sat, 14 Oct 2023 12:12:35 +0000</pubDate>
      <link>https://dev.to/victorkithinji/exploratory-data-analysis-using-data-visualization-techniques-15og</link>
      <guid>https://dev.to/victorkithinji/exploratory-data-analysis-using-data-visualization-techniques-15og</guid>
      <description>&lt;p&gt;Data scientists and analysts can better understand their data using exploratory data analysis (EDA), which is a key step before using more sophisticated statistical and machine learning approaches. Data visualization is crucial to EDA because it makes patterns, connections, and abnormalities in the data more obvious. Using data visualization techniques, we will emphasize the key aspects of EDA in this post. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Understand the data *&lt;/em&gt;&lt;br&gt;
EDA begins with a fundamental comprehension of the dataset. This entails investigating the structure, size, and variable types of the data. This preliminary knowledge can be obtained by visualizing the data structure using tools like histograms, bar charts, and summary statistics. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single-variate analysis&lt;/strong&gt; &lt;br&gt;
The emphasis of a univariate analysis is on a single variable. boxes, understanding the distribution of a single variable is made easier by graphs and frequency distributions. Important traits, such as central tendencies, dispersion, skewness, and outliers, can be revealed in this way. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analysis of Variance&lt;/strong&gt; &lt;br&gt;
In a bivariate study, connections between two variables are investigated. The relationships, correlations, or dependencies between pairs of data can be visualized using methods such as scatter plots, heatmaps, and stacked bar charts. For instance, scatter plots can be used to evaluate the link between age and income. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiple-variable analysis&lt;/strong&gt;&lt;br&gt;
 The notion is expanded to include more than two variables in multivariate analysis. Visualizing intricate interactions between numerous variables requires the use of tools like parallel coordinate plots, 3D scatter plots, and bubble charts. These visualizations can assist in identifying trends that bivariate analysis might miss.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dealing with missing&lt;/strong&gt;&lt;br&gt;
Data Visualizing missing data via methods such as The degree of missingness may be understood, and potential patterns or biases in missing data can be found using missing value heatmaps. This is crucial for figuring out the best way to deal with missing data. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Detection of outliers *&lt;/em&gt;&lt;br&gt;
Outliers can be found using visualizations like scatter plots and box plots. Outliers should be carefully evaluated because they can have a major impact on the outcomes of statistical analysis. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analysis of the time series&lt;/strong&gt; &lt;br&gt;
Time series data frequently calls for extra care. Trends, seasonality, and other temporal patterns can be seen in line charts and autocorrelation plots. Techniques for decomposing time series can assist in separating these parts. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transformation of data&lt;/strong&gt; &lt;br&gt;
Data transformation can sometimes help patterns stand out more. To examine the effects of these modifications on the data, techniques like PCA, z-score normalization, and log transformations can be shown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Clustering&lt;/strong&gt;&lt;br&gt;
Data Clustering is an effective method for assembling related data elements. Using tools like scatter plots or dendrogram trees to visualize clusters might help reveal hidden patterns in the data. **&lt;/p&gt;

&lt;p&gt;Geospatial Analysis**&lt;br&gt;
Geographical analysis Spatial point plots, heat maps, and maps can all be used to explore geospatial data. Understanding the spatial distribution of data, locating hotspots, and making location-based decisions all depend on this. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interactive visualizations&lt;/strong&gt;&lt;br&gt;
Users can interactively examine the data using graphs made with programs like Plotly or Tableau. As a result, users can zoom in on, filter out, and delve into the data to have a better understanding of it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Telling Stories with Visualization&lt;/strong&gt; &lt;br&gt;
EDA involves not only data analysis but also successfully conveying your conclusions. A fascinating story can be created using visualization, and stakeholders are better able to understand the insights and act on the data because of this. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reiteration&lt;/strong&gt; &lt;br&gt;
EDA is a continuous process. Especially if you're dealing with iterative data collection or shifting data sources, you might need to go back to the visualization process as you find insights and make decisions to validate or modify your results.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
An important first step in the data analysis process is exploratory data analysis utilizing data visualization tools. Analysts can get insights into the structure, relationships, trends, and anomalies of the data with the use of effective data visualization. Data professionals can extract valuable information and lay the groundwork for more complex analysis and decision-making by utilizing a variety of visualization tools and techniques.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Science for Beginners: 2023 - 2024 Complete Roadmap</title>
      <dc:creator>Victor-kithinji</dc:creator>
      <pubDate>Sun, 01 Oct 2023 08:18:45 +0000</pubDate>
      <link>https://dev.to/victorkithinji/data-science-for-beginners-2023-2024-complete-roadmap-2aef</link>
      <guid>https://dev.to/victorkithinji/data-science-for-beginners-2023-2024-complete-roadmap-2aef</guid>
      <description>&lt;p&gt;As organizations are generating and storing more and more data, they are looking to hire professionals who can dig into this overwhelming amount of Data to derive valuable insights that can help drive business decisions. This has led the demand for Data Scientists to surge in the past few years. Data Scientist are one of the highest-paid professionals across the industries, and Data Science offers a promising and lucrative career path. As per LinkedIn job reports, the Data Science industry is expected to grow from 37.9 billion USD in 2019 to 230 billion USD by 2026. In fact, Data Scientist has already been regarded as the sexiest job of the 21st century by Harvard Business Review. Due to this, Data Science has become one of the hottest and trending topics among students and professionals who want to build a career in this field. However, learning a new discipline can be challenging and overwhelming sometimes, so to mitigate this, there is a need for a solid educational plan or learning roadmap. A learning roadmap can be defined as a strategic plan with various steps to achieve a desired objective or goal.&lt;/p&gt;

&lt;p&gt;Why Become a Data Scientist?&lt;br&gt;
Data Scientists are in demand worldwide and in industries. Based on a survey by Monster jobs, 96% of the companies in Kenya are looking to hire professionals to fill Big Data Analytics roles by 2023. This demand is expected to grow as we are set to generate more and more data with the arrival of the Internet of Things (IoT), and businesses become more reliant on valuable insights derived from this data for their success and growth.&lt;/p&gt;

&lt;p&gt;Also, Data Scientists are one of the highest paid professionals across the industries. Though, the salary of a Data Scientist depends on multiple factors such as years of experience, education, skillset, company, and location. Some companies pay higher to Data Scientists having specialized skills such as Computer Vision, Natural Language Processing, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Data Scientist Roadmap&lt;/strong&gt;&lt;br&gt;
If you have decided to build a career in Data Science, let’s get into the learning roadmap to become a Data Scientist. A Data Scientist brings together concepts of Software Engineering, Statistics, and the business world to dig into the data to identify valuable insights. We have listed a few steps to help you learn and master the skills required to become a Data Scientist. These steps have their own learning curve based on the complexities involved. So, it will take different times to learn and master each step. The pyramid in the below figure depicts high-level skills required for a Data Scientist’s job in order of the complexity involved and common usage across industries. The Data Scientist Roadmap&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn Python&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every Data Scientist's job requires expertise in one of the programming languages to perform various Data Science tasks. The most common languages Data Scientists use are Python and R. If you are a beginner, learning Python is strongly recommended for Data Science over any other programming language. One of the main reasons Python is widely used and most popular in the Data Science community is its ease of use and simplified syntax, making it easy to learn and adapt for people with no engineering background. Also, you can find a lot of open-source libraries along with online documentation for the implementation of various Data Science tasks such as Machine Learning, Deep Learning, Data Visualization, etc.&lt;br&gt;
Now you know why you should learn Python as a first step to becoming a Data Scientist, let’s get into specific programming topics which you must include in your learning roadmap.&lt;br&gt;
Data Structures (Various Data Types,Lists, Tuples, Dictionary, Array, Sets, Matrices, Vectors,, etc.)&lt;br&gt;
Define and Writing User Defined Functions&lt;br&gt;
Different kinds of Loops and conditional statements such as If, else,, etc.&lt;br&gt;
Searching and Sorting algorithms&lt;br&gt;
SQL concepts - Join, Aggregations, Merge, etc.&lt;br&gt;
&lt;strong&gt;Learn Python Libraries for Data Science&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the reasons for the popularity of Python in the Data Science community is that it provides numerous libraries to implement any kind of Data Science related tasks. A few of the most common libraries used by Data Scientists are -&lt;br&gt;
NumPy&lt;br&gt;
NumPy is a library that provides various methods and functions to handle and process large Arrays, Matrices, and Linear Algebra.&lt;br&gt;
It stands for Numerical Python, and this library provides vectorization of various linear algebra and mathematical functions required to work on large matrices and arrays. Vectorization enables functions to apply operations on all elements of a vector without needing to loop through and act on each item, one at a time, resulting in enhanced execution speed and performance.&lt;br&gt;
Pandas&lt;br&gt;
Pandas is the most popular Python library among Data Scientists. This library provides many useful in-built functions to perform data manipulation and analysis on large amounts of structured data. Pandas are a perfect tool when it comes to Data Wrangling.&lt;br&gt;
It supports two data structures - Series and Dataframe.&lt;br&gt;
Series is a one-dimensional array and capable of holding data of any type (integer, string, float, python objects, etc.). A Data frame in Pandas is a heterogeneous two-dimensional data structure, i.e., data is aligned in a tabular fashion in rows and columns like an excel spreadsheet or SQL table. Pandas DataFrame is capable of having columns with multiple data types.&lt;br&gt;
Matplotlib&lt;br&gt;
Data Visualization is one of the key steps in implementing any Data Science solution. Matplotlib is a handy library that provides methods and functions to visualize data such as graphs, pie charts, plots, etc. You can even use the matplotlib library to customize every aspect of your figures and make them interactive.&lt;br&gt;
Seaborn&lt;br&gt;
It is another Python visualization library that provides many in-built functions for different visualization methods such as histograms, bar charts, heatmaps, density plots, etc. Its syntax is much easier to use compared with matplotlib and provides aesthetically appealing figures.&lt;br&gt;
SciPy&lt;br&gt;
You would be required to perform a lot of statistical analysis as a Data Scientist, such as performing EDA on the data using statistical methods such as mean, standard deviation, z-score, p-value test, etc. SciPy will provide you with various methods and functions for the implementation of statistical and mathematical concepts required in Data Science.&lt;br&gt;
Scikit-Learn&lt;br&gt;
It is a Machine Learning Python library that provides a simple, optimized, and consistent implementation for a wide array of Machine Learning techniques.&lt;br&gt;
&lt;strong&gt;Learn About Data Collection and Wrangling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have grasped the fundamentals of Python programming language, you can move on to the next step, learning about Data Collection and Wrangling.&lt;br&gt;
Data Collection is the process to gather relevant data for further analysis from a variety of sources such as Relational Databases, Web Scraping, APIs, etc. Pandas library in Python provides various methods to collect data from different sources.&lt;br&gt;
Once data is collected, the next step is Data Wrangling, which is preparing and transforming data in an easier way to further analyze. It requires cleaning the data, preparing the data, feature engineering, etc. Pandas and NumPy libraries can help you with methods and functions needed for Data Wrangling and manipulation.&lt;br&gt;
&lt;strong&gt;Learn About Exploratory Data Analysis, Business Acumen, and Storytelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next step is to learn and master Data Exploration and Storytelling skills that will enable you to identify trends, insights, etc., and communicate them to senior management in a way that is much easier to understand.&lt;br&gt;
Few of the topics you should have in your learning roadmap include -&lt;br&gt;
Exploratory Data Analysis (EDA) - It includes exploring the data using various statistical methods such as Mean, Mode, Variance, Standard Deviation, Correlation,, etc. In this step, you will learn to build hypotheses, perform univariate and multivariate analyses,, etc.&lt;br&gt;
Data Visualization - It includes data exploration using visual methods such as plotting histograms, bar charts, box plots, and density plots to identify trends and patterns within the data. Matplotlib, Seaborn, Plotly, etc. are a few of the Python libraries that can help you implement these methods.&lt;br&gt;
Dashboards - Creating dashboards using tools such as PowerBI, Tableau, etc. is the most efficient way to communicate your findings and recommendations to senior management. It will make your presentation more visually appealing and easier to understand.&lt;br&gt;
Business Acumen - While you work on performing exploratory data analysis on the data, you should keep working on asking the right set of questions that can help businesses achieve the target.&lt;br&gt;
&lt;strong&gt;Learn About Data Engineering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data Engineering is the field of building data infrastructure that will provide Data Scientists formatted data that is further easy to analyze by designing, building, and maintaining ETL data pipelines. Though it is not a mandatory requirement to learn for a Data Scientist, having a good understanding of Data Engineering is a big plus when being considered for the Data Scientist job.&lt;br&gt;
Data Engineers use advanced programming languages such as C++, Python, Scala, SQL, etc. to build ETL pipelines on raw data collected from different kinds of databases such as MySQL, MongoDB, etc. These pipelines can be hosted on a cloud-based platform such as AWS, Microsoft Azure, Google Cloud Platform (GCP), etc.&lt;br&gt;
Learn About Applied Statistics and Mathematics&lt;/p&gt;

&lt;p&gt;Statistics and Mathematics are integral to Data Science and any Machine Learning algorithm. For a Data Scientist, it is a must to have a sound understanding of various statistical and mathematical concepts involved in Data Science.&lt;br&gt;
Few of the topics you should include in your Data Scientist learning roadmap -&lt;br&gt;
Descriptive Statistics - It is a powerful method to summarize the data by using statistical methods such as Mean, Mode, Variance, Standard Deviation, etc.&lt;br&gt;
Inferential Statistics - This field includes hypothesis testing by performing inferential tests such as A/B testing, p-value statistics, etc.&lt;br&gt;
Linear Algebra and Calculus - This field will help you understand various mathematical concepts in Machine Learning algorithms such as Gradient Descent, Loss Function, Optimization, etc.&lt;br&gt;
&lt;strong&gt;Learn About Machine Learning and AI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have gained a deeper understanding of all the concepts mentioned above, you can move on to learn and understand Machine Learning algorithms.&lt;br&gt;
Below are categories of Machine Learning algorithms used in a Data Scientist’s job -&lt;br&gt;
Supervised Learning - These algorithms learn the pattern in the data when a target variable is present. It includes Regression and Classification techniques. You should have popular ML algorithms such as Linear Regression, Logistic Regression, Decision Trees, Random Forest, XGBoost, Naive Bayes, KNNs,, etc. in your learning roadmap.&lt;br&gt;
Unsupervised Learning - These algorithms are used when no target variable is available. You should study K-Means Clustering, PCA, Association Mining,, etc. under this category.&lt;br&gt;
Deep Learning - It is a subfield within Machine Learning research that models data using Neural Networks. Neural Networks are nothing but mathematical models mimicking the human brain. Deep Learning has enabled Data Scientists to process and model complex data such as Images, texts, etc. You should have good knowledge of Artificial Neural Networks (ANNs), Convolutional Neural Networks (CNNs), Long Short Term Memory (LSTM), Autoencoders,, etc. for a Data Scientist job.&lt;br&gt;
Do any of these skills seem like alien territory? If you'd like to learn them, check out Scaler’s Data Science program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Points to Remember&lt;/strong&gt;&lt;br&gt;
Though having a degree in Computer Science discipline is considered an added advantage but it is not a mandatory requirement as long as you have learned and mastered the right set of skills.&lt;br&gt;
Having domain expertise or knowledge is always considered plus as it helps you leverage the data in the best way.&lt;br&gt;
Good verbal and written communication skills help you collaborate with multiple stakeholders and communicate your findings and recommendations to them.&lt;br&gt;
It can be intimidating to learn Data Science as it is a vast area. So focus on understanding the basic fundamentals and gradually improve your skills to learn advanced concepts.&lt;br&gt;
Sharpen your theoretical skills by working on projects with real-world data. Remember that organizations always prefer practical applications over theoretical knowledge.&lt;br&gt;
You should always track your learning process. For example, taking assignments post learning a new concept will help you understand whether you are on the right path or not.&lt;br&gt;
Staying updated with the ongoing research will help you stand out from the crowd.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Data Scientists are in high demand and are one of the highest-paid professionals in the Data Science field. With the ever-growing data, business organizations have increased investments in improving their data infrastructure and implementation of data science solutions. Due to this, this demand is expected to grow in the next decade as well. The U.S. Bureau of Labor Statistics has estimated a 22 percent growth in data science jobs during 2020-2030. If you wish to build a career as a Data Scientist, you can create a strong learning plan using this guide that can help you get your first Data Scientist job. Post learning the skills, make sure to work on diverse sets of Data Science projects to apply your skills as practical applications are always preferred over theoretical knowledge for a Data Scientist job.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
