<?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>Forem: Kiregi Paul</title>
    <description>The latest articles on Forem by Kiregi Paul (@kiregi_paul).</description>
    <link>https://forem.com/kiregi_paul</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%2F2151489%2F0e97848c-4a04-49ea-bfe4-d1f30f51c005.png</url>
      <title>Forem: Kiregi Paul</title>
      <link>https://forem.com/kiregi_paul</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kiregi_paul"/>
    <language>en</language>
    <item>
      <title>understanding web scraping</title>
      <dc:creator>Kiregi Paul</dc:creator>
      <pubDate>Thu, 31 Oct 2024 10:01:59 +0000</pubDate>
      <link>https://forem.com/kiregi_paul/understanding-web-scraping-l0a</link>
      <guid>https://forem.com/kiregi_paul/understanding-web-scraping-l0a</guid>
      <description>&lt;p&gt;Web scraping is the process of extracting data from websites using bots, it involves fetching contents from a web page by programmatically checking through to check on the specific information required, which may include text, image, price, url and titles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&lt;br&gt;
Web scraping must be done responsibly, respecting terms of service and legal guidelines, as some websites restrict data extraction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APPLICATION OF WEB SCRAPING&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;E-commerce- to monitor price trends and product availability among competitors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Market research – when carrying our research by gathering customer reviews and behavior patterns&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lead generation -  this involves extracting data from certain directories to build targeted outreach list&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;News and financial data – To gather  up-to-date news, trends in the financial market to develop financial insights.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Academic research – Gathering data for analysis studies&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;TOOLS FOR WEB SCRAPING&lt;/strong&gt;&lt;br&gt;
The tools for webs craping helps and makes it easier to gather information from the websites and often automates the data extraction process.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;TOOL&lt;/th&gt;
    &lt;th&gt;DESCRIPTION&lt;/th&gt;
    &lt;th&gt;APPLICATION&lt;/th&gt;
    &lt;th&gt;BEST USED FOR&lt;/th&gt;

  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;BeautifulSoup&lt;/td&gt;
    &lt;td&gt;Python library for parsing HTML and XML&lt;/td&gt;
    &lt;td&gt;Extracting content from static web pages, such as HTML tags and structured data tables&lt;/td&gt;
    &lt;td&gt; Projects that don’t need browsers interaction &lt;/td&gt;
   &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Selenium&lt;/td&gt;
    &lt;td&gt;Browser automation tool that interacts with dynamic websites, filling forms, clicking buttons and handling javas cript content.&lt;/td&gt;
    &lt;td&gt;Extracting content from sites that require user interaction
Scraping content generated by java script
&lt;/td&gt;
    &lt;td&gt;Complex dynamic pages that offer infinite scroll&lt;/td&gt;
  &lt;/tr&gt;
 &lt;tr&gt;
    &lt;td&gt;Scrapy&lt;/td&gt;
    &lt;td&gt;An open-source, python-based framework designed specifically for web scraping&lt;/td&gt;
    &lt;td&gt;Large-scale scraping projects and data pipelines&lt;/td&gt;
    &lt;td&gt;Crawling multiple pages, creating datasets from large websites and scraping structured data&lt;/td&gt;
  &lt;/tr&gt;
 &lt;tr&gt;
    &lt;td&gt;Octoparse&lt;/td&gt;
    &lt;td&gt;A no-code tool with a drag-and-drop interface for building scraping workflows&lt;/td&gt;
    &lt;td&gt;Data collection for users without programming skills, especially for web pages that has job listings or social media profiles.&lt;/td&gt;
    &lt;td&gt;Quick data collection with no-code workflows&lt;/td&gt;
  &lt;/tr&gt;
 &lt;tr&gt;
    &lt;td&gt;ParseHub&lt;/td&gt;
    &lt;td&gt;A visual extraction tool for scraping  from dynamic websites using AI to understand and collect data from complex layouts&lt;/td&gt;
    &lt;td&gt;Scrapping data from AJAX-based websites, dashboards and interactive charts&lt;/td&gt;
    &lt;td&gt;Non-technical users who want to scrap data from complex, javascript-heavy websites.&lt;/td&gt;
  &lt;/tr&gt;
 &lt;tr&gt;
    &lt;td&gt;Puppeteer&lt;/td&gt;
    &lt;td&gt;A Node.js library that provides high-level API  to control chrome over  the DevTools Protocol&lt;/td&gt;
    &lt;td&gt;Capturing and scraping dynamic java Script content, taking screenshots, generating PDFs and automated browser testing&lt;/td&gt;
    &lt;td&gt;Java script-heavy websites, especially when server-side data extraction is needed&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Apify &lt;/td&gt;
    &lt;td&gt;A cloud-based scraping platform with an extensive library of ready made scraping tools, plus support for custom scripts.&lt;/td&gt;
    &lt;td&gt;Collecting large datasets or scrapping from multiple sources&lt;/td&gt;
    &lt;td&gt;Enterprise-level web scraping tasks that require scaling and automation&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You can combine multiple tools in one project if needed&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>analyst</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Mastering Data Analysis: The Ultimate Guide</title>
      <dc:creator>Kiregi Paul</dc:creator>
      <pubDate>Wed, 16 Oct 2024 15:34:35 +0000</pubDate>
      <link>https://forem.com/kiregi_paul/mastering-data-analysis-the-ultimate-guide-3mp7</link>
      <guid>https://forem.com/kiregi_paul/mastering-data-analysis-the-ultimate-guide-3mp7</guid>
      <description>&lt;p&gt;In today’s data-centric world, the ability to analyze data has become a highly valuable skill. Whether you're trying to understand customer behavior, track business performance, or identify market trends, data analysis helps you extract meaningful insights from raw information. In this comprehensive guide, we’ll explore the essential steps of data analysis, explain key techniques, and introduce useful tools to help you become proficient in analyzing data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Data Analysis?
&lt;/h2&gt;

&lt;p&gt;Data analysis refers to the systematic approach of evaluating, cleaning, and modeling data to uncover valuable information. This process allows organizations, researchers, and individuals to make informed decisions based on the patterns and insights found in the data. From optimizing supply chains to refining marketing strategies, data analysis is widely used across industries to drive smarter, more effective outcomes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Data Types
&lt;/h2&gt;

&lt;p&gt;Before diving into the analysis process, it’s important to recognize the two primary types of data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quantitative Data:&lt;/strong&gt; Numerical data that can be measured, like sales numbers, revenue, or web traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qualitative Data:&lt;/strong&gt; Descriptive data, such as customer reviews, social media comments, or interview transcripts, which provide context and insights beyond numbers.
## The Data Analysis Process
The data analysis journey generally follows these five critical steps:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Data Collection&lt;/strong&gt;&lt;br&gt;
The process begins with gathering relevant data. This can come from various sources, such as databases, surveys, IoT devices, or even online platforms like social media. The key is to ensure that the data collected aligns with your objectives and is reliable enough to yield accurate results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practices for Data Collection:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clearly define your objectives before collecting any data.&lt;/li&gt;
&lt;li&gt;Use consistent collection methods to avoid discrepancies.&lt;/li&gt;
&lt;li&gt;Automate data gathering wherever possible to minimize human error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Data Cleaning&lt;/strong&gt;&lt;br&gt;
Raw data is rarely perfect. It often contains inconsistencies, missing values, duplicates, or errors that can skew your analysis. Cleaning the data involves addressing these issues to ensure your dataset is accurate and complete. A clean dataset is essential for trustworthy results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common data cleaning tasks include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Handling Missing Data: Filling in gaps or omitting incomplete entries.&lt;/li&gt;
&lt;li&gt;Removing Duplicates: Eliminating repeated records to avoid biased outcomes.&lt;/li&gt;
&lt;li&gt;Managing Outliers: Addressing extreme values that might distort results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Data Transformation&lt;/strong&gt;&lt;br&gt;
Once your data is clean, it often needs to be formatted and structured to suit your analysis. This process, known as data transformation, could involve aggregating data, converting text into numerical variables, or normalizing values to bring them onto a consistent scale. The goal is to prepare the data so it can be easily analyzed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples of Data Transformation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Aggregating data over time to analyze trends.&lt;/li&gt;
&lt;li&gt;Converting categorical variables (e.g., "Yes" or "No") into binary values (1 or 0).&lt;/li&gt;
&lt;li&gt;Normalizing datasets to reduce the impact of scale differences across 
variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Data Analysis Techniques&lt;/strong&gt;&lt;br&gt;
Now that your data is ready, it's time to analyze it. Different techniques are available depending on your goals, whether you want to summarize information, identify patterns, make predictions, or understand relationships.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Descriptive Analysis:&lt;/strong&gt; Focuses on summarizing data. For example, calculating averages, percentages, or visualizing basic trends.&lt;/li&gt;
&lt;li&gt;**Inferential Analysis: **Involves making predictions or generalizations based on sample data. Techniques like regression analysis or hypothesis testing are common here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Predictive Analysis:&lt;/strong&gt; Uses historical data to forecast future events or trends, such as predicting customer behavior or sales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diagnostic Analysis:&lt;/strong&gt; Aims to explain the causes behind patterns in the data. This often involves examining relationships between different variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Data Visualization&lt;/strong&gt;&lt;br&gt;
Presenting data visually is a powerful way to make insights clear and digestible for stakeholders. Effective visualization allows complex data to be understood quickly, helping others make informed decisions based on your findings. Various tools, like graphs, charts, and dashboards, help turn raw data into easily interpretable stories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Types of Data Visualizations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bar Charts:&lt;/strong&gt; Ideal for comparing categories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Line Charts:&lt;/strong&gt; Useful for showing trends over time, such as sales growth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pie Charts:&lt;/strong&gt; Helpful for illustrating proportions or percentages within a whole.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stacked Column Charts:&lt;/strong&gt; Great for showing cumulative comparisons across categories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scatter Plots:&lt;/strong&gt; Useful for examining relationships or correlations between variables.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Heatmaps:&lt;/strong&gt; Perfect for visualizing data density or spotting patterns in larger datasets.&lt;/p&gt;
&lt;h2&gt;
  
  
  Tools for Data Analysis
&lt;/h2&gt;

&lt;p&gt;There are numerous tools available to facilitate data analysis, each catering to different needs based on the complexity of the analysis and the user’s proficiency level. Here are a few commonly used tools:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Microsoft Excel:&lt;/strong&gt; A versatile and user-friendly tool for basic data analysis, cleaning, and visualization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Python:&lt;/strong&gt; A programming language widely used for advanced analysis, offering libraries like Pandas, NumPy, and Matplotlib for data manipulation and visualization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;R:&lt;/strong&gt; A statistical programming language designed for complex data analysis and graphical visualization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tableau:&lt;/strong&gt; A leading tool for creating interactive visualizations and dashboards.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Power BI:&lt;/strong&gt; Another visualization tool, popular for generating detailed reports and business intelligence dashboards.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Mastering data analysis is about more than just using the right tools—it’s about developing a thoughtful approach to examining data and drawing meaningful insights. By following a systematic process of data collection, cleaning, transformation, analysis, and visualization, you can unlock the true value hidden in raw data. As businesses and organizations increasingly rely on data to drive their strategies, proficiency in data analysis has never been more valuable. Whether you're analyzing sales data, customer feedback, or market trends, strong data analysis skills will enable you to make smarter, data-driven decisions that lead to better outcomes.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>dataanalytics</category>
      <category>data</category>
    </item>
    <item>
      <title>INTRODUCTION TO PYTHON FOR DATA ANALYSIS</title>
      <dc:creator>Kiregi Paul</dc:creator>
      <pubDate>Fri, 04 Oct 2024 22:15:30 +0000</pubDate>
      <link>https://forem.com/kiregi_paul/introduction-to-python-for-data-analysis-3haf</link>
      <guid>https://forem.com/kiregi_paul/introduction-to-python-for-data-analysis-3haf</guid>
      <description>&lt;p&gt;&lt;strong&gt;INTRODUCTION TO PYTHON FOR DATA ANALYSIS&lt;/strong&gt;&lt;br&gt;
Python is a high-level, interpreted programming language known for its readability and simplicity. Python was created by Guido Van Rossum and first released in 1991.&lt;br&gt;
It emphasizes on code clarity which makes it a better choice for beginners and well-experienced developers because of its readability and simplicity.&lt;br&gt;
Python is used in various fields such as data analysis, data science, web development, and automation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHY PYTHON FOR DATA ANALYSIS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rich Libraries: Python has a variety of libraries specifically designed for data analysis such as:
pandas: For data manipiulation and analysis.
Numpy: For numerical computing and handling arrays.
Matplotlib and seaborn: for data visualization.
Scipy: For scientific and technical computing.
Scikit-learn: For machine learning.&lt;/li&gt;
&lt;li&gt;Community support: Python has a large and active community, where you can easily find resources, tutorials, and forums where you can get assistance.&lt;/li&gt;
&lt;li&gt;Integration: Python is easily integratable with other languages and technologies making it suitable for complex workflows.&lt;/li&gt;
&lt;li&gt;Flexibility: It is easy to handle when building machine learning models, creating visualizations and doing exploratory data analysis.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;DATA TYPES&lt;/strong&gt;&lt;br&gt;
Python has several built-in data types, which can be categorized as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Numeric types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;int&lt;/strong&gt;- integer values(1, 5, 7)&lt;br&gt;
&lt;strong&gt;float&lt;/strong&gt;-floating point number that is decimals (2.4, 3.142)&lt;br&gt;
&lt;strong&gt;complex&lt;/strong&gt;- complex numbers with a real number and imaginary part(4 + 2x)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sequence types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;str&lt;/strong&gt;- string (sequence of characters)"hello world"&lt;br&gt;
&lt;strong&gt;list&lt;/strong&gt;- mutable ordered sequence of elements [1, 2, 3] ["dog", "cats", "cows"]&lt;br&gt;
&lt;strong&gt;tuple&lt;/strong&gt;- immutable ordered sequence of elements (1, 2, 3) ("dog", "cats", "cows")&lt;br&gt;
&lt;strong&gt;range&lt;/strong&gt;- represents a range of numbers range(0, 10)&lt;br&gt;
&lt;strong&gt;dict&lt;/strong&gt;- dictionary, a collection of key value pairs {"name:" "alice", "Age:" "30"}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set types&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;set&lt;/strong&gt;- unordered collection of unique pairs {1, 2, 3} {"dog", "cats"}&lt;br&gt;
&lt;strong&gt;&lt;code&gt;bool&lt;/code&gt;&lt;/strong&gt;- represents True and False&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;GETTING STARTED&lt;/strong&gt;&lt;br&gt;
Getting started with python you have to start with the installation process that is installing the neccessary tools, notebooks and virtual environments to work with.&lt;br&gt;
Anacoda is the best distribution to work with as it comes with pre-installed libraries. After installation of anaconda launch the jupyter notebook which will be used to run the python codes.&lt;br&gt;
After installation you can start with a simple code to help you familiarize yourself with python the syntax is as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# printing hello world
      print("hello world!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is:&lt;br&gt;
      hello world!&lt;/p&gt;

&lt;p&gt;Remember hello world! is a string, therefore to output  a string you have to use "quotation marks".&lt;br&gt;
Here is a code to distinguish how to print a string and the output from a variable name;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Printing fruits such as oranges bananas apples
    fruits = ("oranges", "bananas", "apples")
    print(fruits)
    print("fruits")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two outputs from this code &lt;br&gt;
    oranges, bananas, apples&lt;br&gt;
    fruits&lt;/p&gt;

&lt;p&gt;The first output fruit being a variable name and therefore outputs the data values stored in it.&lt;br&gt;
The second output is the string fruits because of the use of the quotation marks"".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;COMMENTS&lt;/strong&gt;&lt;br&gt;
Comments are really useful when writting codes as it explains why a certain code was written.&lt;br&gt;
In python this comments are written anywhere in the code using the hash(#) sign&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; # this code adds 2+2 and gives the output
        # this is an illustration of how comments work
        a = 2+2
        print(a)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output&lt;br&gt;
        4&lt;/p&gt;

&lt;p&gt;Comments are not excecutable when running a code therefore they do not affect the code if written properly&lt;br&gt;
comments do not display in the output&lt;br&gt;
Comments can be written in any language that is understandable by the users of the code&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VARIABLES&lt;/strong&gt;&lt;br&gt;
Variables are containers used to store data values either numericals or textual&lt;br&gt;
&lt;strong&gt;Rules when naming variables&lt;/strong&gt;&lt;br&gt;
variables are case sensitive such as Name is not same as name&lt;br&gt;
Keywords cannot be used as variable names&lt;br&gt;
variables can not contain spaces but instead use underscore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ARITHMETIC OPERATORS&lt;/strong&gt;&lt;br&gt;
This operators are used to aid in mathematical calculations.&lt;br&gt;
addittion(+)&lt;br&gt;
subtraction(-)&lt;br&gt;
division(/)&lt;br&gt;
floor divisin(//) divides two numbers and round off the result to the nearest whole number&lt;br&gt;
modulus(%) returns the remainder after division&lt;br&gt;
exponential (&lt;code&gt;**&lt;/code&gt;)  raises the first number to the power of the second number&lt;br&gt;
multiplication(&lt;code&gt;*&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;COMPARISON OPERATORS&lt;/strong&gt;&lt;br&gt;
== equal to&lt;br&gt;
!= not equal&lt;br&gt;
&amp;lt; less than&lt;br&gt;
&amp;lt;= less than or equal to&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;greater than&lt;br&gt;
= greater than or equal to&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;LOGICAL OPERATORS&lt;/strong&gt;&lt;br&gt;
AND returns true if both statenments are true&lt;br&gt;
OR  returns true if one of the statements is true&lt;br&gt;
NOT reverses the result giving true if both statements are false and gives false if both statements are true&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONTROL STRUCTURES&lt;/strong&gt;&lt;br&gt;
The control structure helps you indictate the flow of you program based on various conditions. The control structures helps in making valid decisions, repeating some actions and also maging the flow of your code excecution.&lt;br&gt;
We will have a  look into the following control structures:&lt;br&gt;
    1. &lt;strong&gt;CONDITIONAL STATEMENTS&lt;/strong&gt;&lt;br&gt;
        &lt;strong&gt;if statements&lt;/strong&gt;- the if statement escecutes a block of code if the specified condition is true.&lt;br&gt;
        The output of an if statement is entirely based on the condition being true otherwise it does not output anything.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
#example of if statement
         x=10
         if x&amp;gt;5: #changing the comparison sign from &amp;gt; to &amp;lt; it does not give any output considering the condition is false
            print("The value is greater than 5")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
           The value is greater than 5&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;if-else statements&lt;/strong&gt;- The if statement works simmilar to one above but the else works as an alternative of the if statement running if the if statemnt is false.&lt;br&gt;
The if-else statement works well because one of the conditions must be met, that is a condition can only be true or false and neither of both.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; # we will still use the code above but with a different comparison operator
x=10
if x&amp;lt;5:
    print("the value is less than 5")
else:
    print("the value is greater than 5")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
    the value is greater than 5&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;if-elif-else statement&lt;/strong&gt;- The if-elif-elsestatement is an upgrade of the if-else statement because it works on multiple conditions unlike the if-else statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# red- stop, yellow-get ready, green-go
# automated traffic light
colour = "green"
if colour== "red":
    print("stop")
elif colour == "yellow":
    print("get ready")
elif colour == "green":
    print("go")
else:
    print("invalid traffic code")

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

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
go&lt;br&gt;
The if-elif-statements runs untill a true condition is met and returns the else condition if no condition is true.&lt;br&gt;
     2.   &lt;strong&gt;LOOPS&lt;/strong&gt;&lt;br&gt;
        &lt;strong&gt;for loop&lt;/strong&gt;- a for loop iterates over a sequence such as a list, tuple or a string&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; numbers = [1,2,3,4,5,6,]
for num in numbers:
    print(num)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
1&lt;br&gt;
2&lt;br&gt;
3&lt;br&gt;
4&lt;br&gt;
5&lt;br&gt;
6&lt;br&gt;
&lt;strong&gt;while loop&lt;/strong&gt;- a while loop excecutes as long as a certain condition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;day = 1
while day &amp;lt;= 7:
    print (day)
    day +=1

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

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
1&lt;br&gt;
2&lt;br&gt;
3&lt;br&gt;
4&lt;br&gt;
5&lt;br&gt;
6&lt;br&gt;
7&lt;br&gt;
    3. &lt;strong&gt;LOOP CONTROL STATEMENTS&lt;/strong&gt;&lt;br&gt;
        &lt;strong&gt;BREAK&lt;/strong&gt;- used to exit  the loop immediately at a certain point of the code excecution when the condition is met.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for num in range(10):
    if num == 5: 
        break
        print (num)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;/p&gt;

&lt;p&gt;0&lt;br&gt;
1&lt;br&gt;
2&lt;br&gt;
3&lt;br&gt;
4&lt;br&gt;
5&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONTINUE&lt;/strong&gt;- skips the current iteration provided in the condition and proceeds to the next&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for num in range(10):
    if num == 5: 
        continue
        print (num)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;/p&gt;

&lt;p&gt;0&lt;br&gt;
 1&lt;br&gt;
 2&lt;br&gt;
 3&lt;br&gt;
 4&lt;br&gt;
 6&lt;br&gt;
 7&lt;br&gt;
 8&lt;br&gt;
 9&lt;br&gt;
 10&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;NESTED CONTROL STRUCTURES&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num = 10
if num&amp;gt;5:
    for int in range(5):
        print(f"{num} is greater than 5: {int}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
10 is greater than 5: 0&lt;br&gt;
10 is greater than 5: 1&lt;br&gt;
10 is greater than 5: 2&lt;br&gt;
10 is greater than 5: 3&lt;br&gt;
10 is greater than 5: 4&lt;/p&gt;

&lt;p&gt;This is just an overview of the introduction to python for data analysis, this forms a great basis of your python journey in data analysis.&lt;br&gt;
In a different article we will look at the different libraries used in data analysis.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Structured Query Language</title>
      <dc:creator>Kiregi Paul</dc:creator>
      <pubDate>Tue, 01 Oct 2024 10:42:07 +0000</pubDate>
      <link>https://forem.com/kiregi_paul/introduction-to-structured-query-language-2ikj</link>
      <guid>https://forem.com/kiregi_paul/introduction-to-structured-query-language-2ikj</guid>
      <description>&lt;p&gt;&lt;strong&gt;Structured Query Language&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Introduction to SQL&lt;/strong&gt;&lt;br&gt;
Structured query language is a standard language used to access and manipulate databases.&lt;/p&gt;

&lt;p&gt;Tasks that you can do with SQL&lt;br&gt;
    1. Execute queries in a database&lt;br&gt;
    2. Create new tables in a database&lt;br&gt;
    3. Delete records from a database&lt;br&gt;
    4. Create new databases&lt;br&gt;
    5. Insert record in a database&lt;br&gt;
    6. Update records in a database&lt;br&gt;
    7. Retrieve data from a database&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQL commands&lt;/strong&gt;&lt;br&gt;
SQL uses commands to ensure the implementation of tasks or queries, some of the important commands include;&lt;br&gt;
    1. &lt;strong&gt;SELECT&lt;/strong&gt;- The select statement is used to extract data from a database&lt;br&gt;
    2. &lt;strong&gt;UPDATE&lt;/strong&gt;- Updates data in the selected database&lt;br&gt;
    3. &lt;strong&gt;DELETE&lt;/strong&gt;- deletes data from a database&lt;br&gt;
    4. &lt;strong&gt;INSERT INTO&lt;/strong&gt;- Inserts new data into the database&lt;br&gt;
    5. &lt;strong&gt;CREATE DATABASE&lt;/strong&gt;- creates a new database&lt;br&gt;
    6. &lt;strong&gt;ALTER DATABASE&lt;/strong&gt;- Modifies the data in a database&lt;br&gt;
    7. &lt;strong&gt;CREATE TABLE&lt;/strong&gt;- creates a new table &lt;br&gt;
    8. &lt;strong&gt;ALTER TABLE&lt;/strong&gt;- modifies a table &lt;br&gt;
    9. &lt;strong&gt;DROP TABLE&lt;/strong&gt;- deletes a table&lt;br&gt;
    10. &lt;strong&gt;CREATE INDEX&lt;/strong&gt;- creates a search key&lt;br&gt;
    11. &lt;strong&gt;DROP INDEX&lt;/strong&gt;- deletes an INDEX&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; SQL keywords are not case sensitive that is select and SELECT will all work the same, therefore you can use either uppercase or lowercase and still have the same output and with no error.&lt;br&gt;
    : A semicolon is used as the standard ay to separate each SQL statement allowing more than one statement to be executed by the same call to the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The use of SELECT in SQL statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The select statement is used to select data from a database. This can be illustrated in the examples below.&lt;br&gt;
       &lt;code&gt;SELECT *&lt;br&gt;
        FROM CUSTOMERS;&lt;/code&gt;&lt;br&gt;
The * is used to symbolize all therefore the statement reads select all from the customers’ table. To select a range within the table we use the syntax below;&lt;br&gt;
        &lt;code&gt;SELECT column_1, Column_5&lt;br&gt;
        FROM CUSTOMERS;&lt;/code&gt;&lt;br&gt;
This is by assuming that your table has columns named column_1 and column_5 and you want to display the data in those columns. &lt;br&gt;
The output from this statement will be data from the two columns from the customers' table that will be displayed.&lt;br&gt;
Therefore, to have the output of a particular column from the table you only include the column name in the select statement, and to display all the data in the table you use the asterisk (*) in the select statement&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CATEGORIES OF SQL COMMANDS&lt;/strong&gt;&lt;br&gt;
    &lt;strong&gt;DDL&lt;/strong&gt;- Data Definition Language&lt;br&gt;
    &lt;strong&gt;DQL&lt;/strong&gt;- Data Query Language&lt;br&gt;
    &lt;strong&gt;DML&lt;/strong&gt;- Data Manipulation Language&lt;br&gt;
    &lt;strong&gt;DCL&lt;/strong&gt;- Data Control Language&lt;br&gt;
    &lt;strong&gt;TCL&lt;/strong&gt;- Transaction Control Language&lt;br&gt;
    &lt;strong&gt;DQL&lt;/strong&gt;- Data Query Language&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Definition Language&lt;/strong&gt;&lt;br&gt;
The data definition language deals with database schemas and descriptions, of how the data should reside in the database&lt;br&gt;
    &lt;strong&gt;CREATE&lt;/strong&gt;- it is used to create databases and their objects like (tables, indexes, triggers, functions, and procedures)&lt;br&gt;
    &lt;strong&gt;ALTER&lt;/strong&gt;- alters the structure of the existing database&lt;br&gt;
    &lt;strong&gt;DROP&lt;/strong&gt;- deletes object from the database&lt;br&gt;
    &lt;strong&gt;TRUNCATE&lt;/strong&gt;- remove all records from a table, including spaces allocated to the record are removed&lt;br&gt;
    &lt;strong&gt;RENAME&lt;/strong&gt;- Renames an object&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Manipulation Language&lt;/strong&gt;&lt;br&gt;
The data manipulation language is used to store, modify retrieve, delete and update data in a database.&lt;br&gt;
    &lt;strong&gt;SELECT&lt;/strong&gt;- retrieve data from the database&lt;br&gt;
    &lt;strong&gt;INSERT&lt;/strong&gt;- insert data into a table&lt;br&gt;
    &lt;strong&gt;UPDATE&lt;/strong&gt;- updates existing data in a table&lt;br&gt;
    &lt;strong&gt;DELETE&lt;/strong&gt;- deletes all records from a database table&lt;br&gt;
    &lt;strong&gt;MERGE&lt;/strong&gt;- UPSERT operation (insert or update)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Control Language&lt;/strong&gt;&lt;br&gt;
The data control language acts as an access specifier to the database. That is, it grants or revokes permission to users in the database.&lt;br&gt;
    &lt;strong&gt;GRANT&lt;/strong&gt;- grants permission&lt;br&gt;
    &lt;strong&gt;REVOKE&lt;/strong&gt;- revokes permission&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transaction Control Language&lt;/strong&gt;&lt;br&gt;
Acts as a manager for all types of transactional data and all transactions&lt;br&gt;
    &lt;strong&gt;ROLLBACK&lt;/strong&gt;- cancel or undo changes made in the database&lt;br&gt;
    &lt;strong&gt;COMMIT&lt;/strong&gt;- apply or save changes in the database&lt;br&gt;
    &lt;strong&gt;SAVEPOINT&lt;/strong&gt;- temporarily saves data in the database&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Query Language&lt;/strong&gt; &lt;br&gt;
This is the subset of Data Manipulation Language, the most common query in Data Query Language is the &lt;strong&gt;SELECT&lt;/strong&gt; statement which helps us in retrieving the data from the table without changing anything or modifying the table.&lt;br&gt;
Data Query Language is important for the retrieval of essential data&lt;/p&gt;

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