5/8/2023
DATA ANALYTIC
WITH PYTHON
Kitthapat Jeamrattanaprateep
Basic & Essential
Agenda
◦ Module 0: Introduction to Data Science
◦ Module 1: Basic Python Programming for Data Scientist
◦ Module 2: Data Scientist Tool on Cloud (Azure)
◦ Module 3: Working With Data Science Data
◦ Module 4: Data Manipulation and Visualization
◦ Module 5: Data Modeling and Data Cleansing
◦ Module 6 : Data Visualization
◦ Module 7 : Statistical Data Analysis
◦ Module 8 : Decision Tree
5/8/2023
Module 0: Introduction to Data Science
◦ What is Data science?
◦ Data science: An untapped resource for machine learning
◦ What’s the difference between data science, artificial intelligence, and machine
learning?
◦ How data science is transforming business
◦ Tools for data science
◦ Understanding the Lifecycle of Data Science
◦ Who oversees the data science process?
◦ Challenges of implementing data science projects
◦ The benefits of a data science platform
What is Data science?
◦ Data science combines multiple fields, including statistics, scientific methods,
artificial intelligence (AI), and data analysis, to extract value from data.
◦ Those who practice data science are called data scientists, and they
combine a range of skills to analyze data collected from the web,
smartphones, customers, sensors, and other sources to derive actionable
insights.
◦ Data science encompasses preparing data for analysis, including cleansing,
aggregating, and manipulating the data to perform advanced data analysis.
◦ Analytic applications and data scientists can then review the results to
uncover patterns and enable business leaders to draw informed insights.
5/8/2023
Data science: An untapped resource
for machine learning
◦ The wealth of data being collected and stored by these technologies can bring transformative benefits
to organizations and societies around the world—but only if we can interpret it. That’s where data
science comes in.
◦ Data science reveals trends and produces insights that businesses can use to make better decisions and
create more innovative products and services
◦ Perhaps most importantly, it enables machine learning (ML) models to learn from the vast amounts of
data being fed to them, rather than mainly relying upon business analysts to see what they can discover
from the data.
What’s the difference between data
science, artificial intelligence, and machine
learning?
◦ AI means getting a computer to mimic human behavior in some way.
◦ Data science is a subset of AI, and it refers more to the overlapping areas of statistics, scientific methods,
and data analysis—all of which are used to extract meaning and insights from data..
◦ Machine learning is another subset of AI, and it consists of the techniques that enable computers to
figure things out from the data and deliver AI [Link] for good measure, we’ll throw in another
definition.
◦ Deep learning which is a subset of machine learning that enables computers to solve more complex
problems.
5/8/2023
How data science is transforming
business
◦ Determine customer churn by analyzing data collected from call centers, so marketing can take action
to retain them
◦ Improve efficiency by analyzing traffic patterns, weather conditions, and other factors so logistics
companies can improve delivery speeds and reduce costs
◦ Improve patient diagnoses by analyzing medical test data and reported symptoms so doctors can
diagnose diseases earlier and treat them more effectively
◦ Optimize the supply chain by predicting when equipment will break down
◦ Detect fraud in financial services by recognizing suspicious behaviors and anomalous actions
◦ Improve sales by creating recommendations for customers based upon previous purchases
Important Skill for Data Science
◦ Hacking Skill (Computer Science)
◦ Math & Statistics
◦ Business / Domain Expertise
5/8/2023
Tools for data science
Understanding the Lifecycle of Data
Science
◦ Business / Problem Definition
◦ Data Acquisition
◦ Data Preparation
◦ Exploratory Data Analysis
◦ Modeling
◦ Communication & Deployment
5/8/2023
Who oversees the data science
process?
◦ Business managers: These managers work with the data science team to define the problem and
develop a strategy for analysis. They may be the head of a line of business, such as marketing, finance,
or sales, and have a data science team reporting to them. They work closely with the data science and
IT managers to ensure that projects are delivered.
◦ IT managers: Senior IT managers are responsible for the infrastructure and architecture that will support
data science operations. They are continually monitoring operations and resource usage to ensure that
data science teams operate efficiently and securely. They may also be responsible for building and
updating IT environments for data science teams.
◦ Data science managers: These managers oversee the data science team and their day-to-day work.
They are team builders who can balance team development with project planning and monitoring.
Challenges of implementing data
science projects
◦ Data scientists can’t work efficiently.
◦ Application developers can’t access usable machine learning
◦ IT administrators spend too much time on support
◦ Business managers are too removed from data science.
5/8/2023
Module 1: Basic Python Programming for
Data Scientist
◦ Understanding Operators
◦ Variables and Data Types
◦ Conditional Statements
◦ Looping Constructs
◦ Functions
Python Syntax
5/8/2023
5/8/2023
Python Comments
◦ Comments can be used to explain Python code.
◦ Comments can be used to make the code more readable.
◦ Comments can be used to prevent execution when testing code.
5/8/2023
Creating Variables
Variable Names
◦ A variable can have a short name (like x and y) or a more descriptive name (age, carname,
total_volume). Rules for Python variables:
• A variable name must start with a letter or the underscore character
• A variable name cannot start with a number
• A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
• Variable names are case-sensitive (age, Age and AGE are three different variables)
5/8/2023
Assign Value to Multiple Variables
5/8/2023
5/8/2023
5/8/2023
Exercise
5/8/2023
5/8/2023
5/8/2023
5/8/2023
Python Strings
5/8/2023
Python Strings
5/8/2023
String Formatting Operator
5/8/2023
5/8/2023
5/8/2023
EXERCISE
5/8/2023
Python Booleans
5/8/2023
5/8/2023
5/8/2023
5/8/2023
5/8/2023
EXERCISE
5/8/2023
Python User Input
Try Yourself
◦ Get 2 inputs from user
◦ 1. Sale Price
◦ 2. Tax (7%)
◦ Find Sale Include Tax
5/8/2023
5/8/2023
Decision Making – If-Else
5/8/2023
Conditionals
Python IF Statement
5/8/2023
Python IF...ELIF...ELSE Statements
5/8/2023
5/8/2023
5/8/2023
5/8/2023
5/8/2023
Python nested IF statements
Conditionals
5/8/2023
EXERCISE
◦ Get 2 Numbers input from keyboard
◦ Check Whether Number1 >= Number2 Display Number1 multiply with 1.5
◦ Otherwise Display Number2 multiply with 1.5
Exercise
◦ Write a Python program to find the median of three
values.
5/8/2023
5/8/2023
5/8/2023
5/8/2023
Python - Loops
Python while Loop Statements
5/8/2023
5/8/2023
5/8/2023
5/8/2023
Your Turn
◦ Display Even Number from 1 – 20 and That number is not divided by 9 using While
5/8/2023
Exercise
◦ Write a Python program to create the multiplication table
(from 1 to 10) of a number.
5/8/2023
5/8/2023
5/8/2023
Your Turn
5/8/2023
5/8/2023
5/8/2023
5/8/2023
5/8/2023
5/8/2023
5/8/2023
5/8/2023
Python Lists
5/8/2023
Updating Lists
Delete List Elements
5/8/2023
Basic List Operations
Indexing, Slicing, and Matrixes
5/8/2023
Program to get the largest
number from a list
5/8/2023
Your Turn
◦ Accept Input from User append to List until user type ‘No’
◦ Find Max , Min , Average , Sum of Value in This List
5/8/2023
5/8/2023
5/8/2023
Python Tuples
◦ A tuple is a sequence of immutable Python objects.
◦ Tuples are sequences, just like lists. The differences
between tuples and lists are, the tuples cannot be
changed unlike lists and tuples use parentheses,
whereas lists use square brackets.
5/8/2023
Accessing Values in Tuples
Updating Tuples
5/8/2023
Delete Tuple Elements
5/8/2023
Python Sets
5/8/2023
How to change a set in Python?
How to remove elements from a set?
5/8/2023
Python Set Operations
5/8/2023
Python Dictionary
◦ A dictionary is also a compound data type.
◦ It maps keys, which can be any immutable type, to
values, which can be any type,
◦ For example, a phone book is a dictionary: name-
number pairs, i.e.,
◦ # mapping of names to phone numbers
5/8/2023
5/8/2023
Updating Dictionary
Delete Dictionary Elements
5/8/2023
Dictionary Methods
Properties of Dictionary Keys
◦ More than one entry per key not allowed.
5/8/2023
5/8/2023
◦ Keys must be immutable. Which means you can
use strings, numbers or tuples as dictionary keys but
something like ['key'] is not allowed. Following is a
simple example:
5/8/2023
5/8/2023
5/8/2023
Python Functions
5/8/2023
Calling a Function
5/8/2023
Pass by reference vs value
Function Arguments
5/8/2023
Exercise
◦ Create Function Name : Find Season
◦ Accept 2 input : Month , Year
5/8/2023
Exercise
◦ Create Function Name : Convert to Day
◦ Accept 1 input : Seconds
5/8/2023