<?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: Fay Kibowen</title>
    <description>The latest articles on Forem by Fay Kibowen (@kibowen_8).</description>
    <link>https://forem.com/kibowen_8</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%2F2138716%2Fe5a3bffc-10a5-4762-87c6-850c20f17cee.jpg</url>
      <title>Forem: Fay Kibowen</title>
      <link>https://forem.com/kibowen_8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kibowen_8"/>
    <language>en</language>
    <item>
      <title>Python 101: Introduction to Python as a Data Analytics Tool</title>
      <dc:creator>Fay Kibowen</dc:creator>
      <pubDate>Sun, 06 Oct 2024 20:41:53 +0000</pubDate>
      <link>https://forem.com/kibowen_8/python-101-introduction-to-python-as-a-data-analytics-tool-35li</link>
      <guid>https://forem.com/kibowen_8/python-101-introduction-to-python-as-a-data-analytics-tool-35li</guid>
      <description>&lt;p&gt;Particularly for data analytics, Python has grown rapidly to become one of the most widely used programming languages. It is a preferred tool for analysts, data scientists, and engineers globally due to its ease of use, adaptability, and plenty of libraries. Python provides an easy-to-use starting point for those who are new to programming or are switching from another language to the field of data analytics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Python for Data Analytics?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple to Learn and Use: Even novices may easily understand Python because to its simple and intuitive syntax. Python has an extremely low learning curve since it reads like English, in contrast to many other programming languages.&lt;/p&gt;

&lt;p&gt;Huge Library Support: Python has an abundance of libraries that facilitate data analysis, visualization, and manipulation. Well-known libraries consist of:&lt;/p&gt;

&lt;p&gt;Pandas: For managing huge databases and manipulating data.&lt;br&gt;
NumPy: For effective array management and numerical operations.&lt;br&gt;
Matplotlib and Seaborn: For producing stunning charts and visualizations.&lt;br&gt;
SciPy: For sophisticated computation in science and statistics.&lt;br&gt;
Scikit-learn: For predictive analytics and machine learning.&lt;br&gt;
Scalability &amp;amp; Flexibility: Python is incredibly versatile and works well for both simple, small-scale tasks and intricate, large-scale data processing pipelines. From basic descriptive analytics to deep learning models and machine learning, it can handle it all.&lt;/p&gt;

&lt;p&gt;Integration with Other applications: Python has good integrations with a wide range of databases, cloud services, and other applications, making it easy for analysts to work in a variety of settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started with Python for Data Analytics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For those who are just getting started using Python as a data analytics tool, here is a simple road map:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Configuring the surroundings&lt;/em&gt;&lt;br&gt;
Setting up your workspace is necessary before you begin Python coding.&lt;/p&gt;

&lt;p&gt;Set up Python: The official Python website has the most recent version available for download.&lt;br&gt;
Notebook Jupyter: Jupyter Notebook is a widely used application for data analysts that lets you develop and execute Python code in a cell-based environment. Installing it may be done via the terminal with pip install jupyterlab or with Anaconda.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Getting to Know Python Fundamentals&lt;/em&gt;&lt;br&gt;
You must have a firm grasp of fundamental Python ideas like:&lt;/p&gt;

&lt;p&gt;Variables and Data Types: Recognize how Python works with various data types, including dictionaries, lists, integers, and strings.&lt;/p&gt;

&lt;p&gt;Control Structures: To manage the flow of your programs, learn how to employ conditional statements (if, else) and loops (for, while).&lt;br&gt;
Uses: Creating reusable code blocks can help you maintain a modular and well-organized analysis.&lt;/p&gt;

&lt;p&gt;To get you started, consider this little bit of Python code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Importing essential libraries
import numpy as np
import pandas as pd

# Creating a small dataset
data = {'Name': ['John', 'Jane', 'Mike', 'Emily'],
        'Age': [28, 34, 29, 42],
        'Salary': [50000, 62000, 59000, 76000]}

# Converting the data to a pandas DataFrame
df = pd.DataFrame(data)

# Displaying the dataset
print(df)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Pandas-Assisted Data Manipulation&lt;/em&gt;&lt;br&gt;
The Pandas library in Python is the foundation for its data analytics capabilities. Working with structured data is made simple using pandas, which is especially helpful when working with big datasets in SQL, CSV, or Excel.&lt;/p&gt;

&lt;p&gt;A quick overview of some crucial Pandas functions is provided here:&lt;/p&gt;

&lt;p&gt;Loading Data: You may use Pandas to import data from a variety of sources, including Excel and CSV files (pd.read_excel and pd.read_csv).&lt;br&gt;
DataFrame Manipulation: You can examine and comprehend your dataset by using functions like df.describe(), df.head(), and df.tail(). Additionally, it is simple to filter, sort, and work with data columns.&lt;br&gt;
Handling Missing Data: In real-world datasets, missing values are common. To deal with these scenarios, Pandas provides useful functions like df.isnull(), df.fillna(), and df.dropna().&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Checking for missing values
print(df.isnull())

# Filling missing values (if any)
df.fillna(0, inplace=True)

# Dropping rows with missing values
df.dropna(inplace=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Matplotlib and Seaborn for Data Visualization&lt;/em&gt;&lt;br&gt;
Visualizing your data is the next step once it has been cleaned and prepared. In order to assist you in creating graphs, plots, and charts, Python provides robust visualization tools such as Matplotlib and Seaborn.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import matplotlib.pyplot as plt
import seaborn as sns

# Plotting a bar chart of salaries
plt.figure(figsize=(8,6))
sns.barplot(x='Name', y='Salary', data=df)
plt.title('Salary Distribution')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In data analytics, visualization is essential because it can reveal patterns, trends, and outliers that raw data may not be able to.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Analysis of Exploratory Data (EDA)&lt;/em&gt;&lt;br&gt;
EDA is the process of examining datasets and compiling a summary of their key features. Python's integration of visualization packages, NumPy, and Pandas makes EDA informative and effective. EDA seeks to comprehend the structure of the data, find connections, and detect any possible trends or abnormalities.&lt;/p&gt;

&lt;p&gt;Here are a few EDA methods:&lt;/p&gt;

&lt;p&gt;Summary Statistics: The mean, standard deviation, minimum, and maximum values for each numerical column are summarized by the df.describe() function.&lt;br&gt;
Correlation Analysis: df.corr() computes the correlation between variables, which is useful for discovering relationships.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Using Scikit-learn for Machine Learning&lt;/em&gt;&lt;br&gt;
You may wish to use machine learning to create classifications or predictions after completing EDA. The Scikit-learn module for Python is a great tool for putting machine learning models like clustering, regression, and classification algorithms into practice.&lt;/p&gt;

&lt;p&gt;For instance, the following describes how to use Scikit-learn to build a basic linear regression model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.linear_model import LinearRegression

# Creating a simple regression model
model = LinearRegression()

# Fitting the model with some data
X = df[['Age']]
y = df['Salary']
model.fit(X, y)

# Predicting salaries based on age
predicted_salary = model.predict([[30], [40]])
print(predicted_salary)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;In summary&lt;/strong&gt;&lt;br&gt;
Python is among the greatest tools for data analytics because of its adaptability, simplicity of use, and robust libraries. Python gives you the skills to succeed whether you're cleaning data, examining trends, or creating machine learning models. Even more potent methods and approaches for data analysis and interpretation will become apparent to you as you study and experiment with Python more.&lt;/p&gt;

&lt;p&gt;Python for data analytics can be intimidating to start with, but with a well-planned learning path and constant practice, you'll be extracting insightful information from data in no time!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>SQL 101: Introduction to Structured Query Language</title>
      <dc:creator>Fay Kibowen</dc:creator>
      <pubDate>Sun, 29 Sep 2024 13:55:58 +0000</pubDate>
      <link>https://forem.com/kibowen_8/sql-101-introduction-to-sql-46en</link>
      <guid>https://forem.com/kibowen_8/sql-101-introduction-to-sql-46en</guid>
      <description>&lt;p&gt;Structured Query Language, or SQL, is a potent language used for database management and manipulation. It was developed in the 1970s and is now one of the most important tools for handling data in modern times. In relational databases, SQL enables us to create, retrieve, update, and delete (CRUD) data. There's a good possibility you've dealt with SQL if you've ever worked with data!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a database?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All that a database is, is a collection of organized or meaningful data. Imagine it as a much larger version of an orderly spreadsheet with rows and columns. Databases can hold vast amounts of text, similar to a library of books, as well as information such as customer records and product catalogs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common SQL Commands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT – Retrieve data from a database.&lt;br&gt;
INSERT – Add new data to a database.&lt;br&gt;
UPDATE – Modify existing data.&lt;br&gt;
DELETE – Remove data.&lt;br&gt;
CREATE – Create a new database or table.&lt;br&gt;
DROP – Delete a table or database.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQL Syntax: Basic Structure&lt;/strong&gt;&lt;br&gt;
SQL commands are written as statements. A basic SQL query looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT column_name
FROM table_name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s as simple as that! Let's say you want to view all the customer names from a table called &lt;code&gt;customers&lt;/code&gt;. You’d write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customer_name
FROM customers;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How to Set Up SQL:&lt;br&gt;
To get started with SQL, you’ll need a SQL environment. This could be a database management system (DBMS) like MySQL, PostgreSQL, or SQLite. Once you’ve installed one of these, you can start writing SQL commands to interact with your database.There are also cloud-based SQL services if you prefer to work in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Database&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creating a database is one of the first things you’ll do. It’s like setting up a new workbook for a project. Here’s how you can create a new database in SQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE Technology;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a database called Technology. Now you can create tables inside this database to store your information!&lt;/p&gt;

&lt;p&gt;If you want to check if the database is created, you use 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;show databases;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tables in SQL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tables are where all your data lives. Each table is organized into rows and columns, where:&lt;/p&gt;

&lt;p&gt;Rows = individual records (e.g., one customer’s details).&lt;br&gt;
Columns = categories of data (e.g., customer names, email addresses, etc.).&lt;br&gt;
Let’s create a basic table for storing customer information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE customers (
    customer_id INT,
    customer_name VARCHAR(100),
    email VARCHAR(100),
    age INT
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a &lt;code&gt;customers&lt;/code&gt; table with four columns: &lt;code&gt;customer_id&lt;/code&gt;, &lt;code&gt;customer_name&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, and &lt;code&gt;age&lt;/code&gt;. Each customer will have a unique &lt;code&gt;customer_id&lt;/code&gt; (because of &lt;code&gt;PRIMARY KEY&lt;/code&gt;), and the &lt;code&gt;VARCHAR(100)&lt;/code&gt; defines the length of text that can be stored in the column.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inserting Data into a Table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have a table, it’s time to fill it with data! To add a new customer, we use the INSERT statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO customers (customer_id, customer_name, email, age)
VALUES (1, 'Faith Jeptoo', 'faykibowen@gmail.com', 20);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command adds a new row to the customers table. Each value corresponds to a column in the table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retrieving Data from a Table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To see the data we’ve inserted, we use the SELECT statement:&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 customers;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;*&lt;/code&gt; means "all columns," so this query retrieves everything from the &lt;code&gt;customers&lt;/code&gt; table. You should see something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-------------+---------------+-----------------------+---------+
| customer_id | customer_name  | email                 | age    |
+-------------+---------------+-----------------------+---------+
| 1           | Faith Jeptoo   | faykibowen@gmai.com   | 20     |
+-------------+---------------+-----------------------+---------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Data Manipulation&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;use accenture_my;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;show tables;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will shows all the tables in the database&lt;/p&gt;

&lt;p&gt;LIMIT&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 content;
limit 3;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The limit function will only shows records from 3 rows in the content table &lt;/p&gt;

&lt;p&gt;DISTINCT&lt;br&gt;
Helps avoid duplicates by choosing unique values/records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT DISTINCT(column_name)
from content;
SELECT * from reactions;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;column_name&lt;/code&gt; is the category.&lt;br&gt;
If we hade two hates from the column, the the utcome will choose one avoiding duplicates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filtering Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you only want to retrieve specific data, you can add a condition using the WHERE clause. For example, to get all customers who are 25 years old, you can write:&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 Africa;
WHERE country = 'Kenya';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will return just the names of people from Kenya.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Updating Data&lt;/strong&gt;&lt;br&gt;
If John Doe’s email changes, we can update it with the UPDATE command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPDATE customers
SET email = 'john.new@example.com'
WHERE customer_id = 1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command updates the email for the customer with the ID of 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deleting Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To delete a customer from the database, we can use the DELETE command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DELETE FROM customers
WHERE customer_id = 1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will remove the customer with ID 1 from the table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQL Data Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SQL tables support various data types to store different kinds of information. Here are a few common ones:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;INT – Whole numbers.&lt;br&gt;
VARCHAR – Variable-length text.&lt;br&gt;
DATE – Stores dates.&lt;br&gt;
FLOAT – Decimal numbers.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Joins: Combining Data from Multiple Tables&lt;br&gt;
Sometimes, data is spread across multiple tables. You can use a SQL JOIN to combine related data. For example, if you have an orders table and a customers table, you can link them with a join to see which customer placed which order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customers.customer_name, orders.order_id
FROM customers
JOIN orders
ON customers.customer_id = orders.customer_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Wrapping Up&lt;/strong&gt;&lt;br&gt;
SQL is a simple yet incredibly powerful language for managing and working with databases. From retrieving data to manipulating tables, SQL is the go-to language for anyone looking to manage data efficiently. Whether you’re working with small datasets or managing big databases, SQL is a must-learn!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CTE&lt;/strong&gt;&lt;br&gt;
Common Table Expression-I want the results of a certain query or statement be stored with a given. Somewhat like variables in C.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WITH kibowen AS (
SELECT *
FROM reactions
WHERE react = 'Disgust');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
Learning SQL might seem intimidating at first, but with practice, you’ll get the hang of it. Start small—try creating your first database, add some tables, insert data, and experiment with basic queries. Before you know it, you'll be a SQL pro! Happy querying!&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
    </item>
  </channel>
</rss>
