0% found this document useful (0 votes)
3 views67 pages

Data Science With Python-selva&Govind

The document provides an overview of data science, highlighting its definition, applications, and advantages. It covers essential components such as data processing, visualization, statistics, machine learning, and natural language processing, along with an introduction to Python programming and its libraries used in data science. Key libraries mentioned include NumPy, Matplotlib, Seaborn, Scikit-learn, TensorFlow, and Keras.

Uploaded by

Aravindhan k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views67 pages

Data Science With Python-selva&Govind

The document provides an overview of data science, highlighting its definition, applications, and advantages. It covers essential components such as data processing, visualization, statistics, machine learning, and natural language processing, along with an introduction to Python programming and its libraries used in data science. Key libraries mentioned include NumPy, Matplotlib, Seaborn, Scikit-learn, TensorFlow, and Keras.

Uploaded by

Aravindhan k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

DATA SCIENCE WITH PYTHON

IMMACULATE TECHNOLOGIES
- SALEM

Mr. S.Selvanayagam M.S., Mr.G.Govindaraj M.Sc.,


CEO Software Developer.
DATA SCIENCE SKILLS
DATA SCIENCE TECHONOLOGY
DOMAINS OF DATA SCIENCE
WHAT IS DATA SCIENCE?

• Data science is an interconnected field that


involves the use of statistical and computational
methods to extract insightful information and
knowledge from data.
• It is a multidisciplinary approach that combines
principles and practices from the fields of
mathematics, statistics, artificial intelligence, and
computer engineering to analyze large amounts of
data
USES OF DATA SCIENCE

• Business
• Healthcare
• Finance
• Social Media
• Internet of things
• Natural Language Processing
APPLICATIONS OF DATA SCIENCE

• Internet Search Results (Google)


• Recommendation Engine (MX Player)
• Intelligent Digital Assistants (Google Assistant)
• Autonomous Driving Vehicle (Waymo)
• Spam Filter (Gmail)
• Hate Speech Filter (Facebook)
• Automatic Piracy Detection (YouTube)
ADVANTAGES OF DATA SCIENCE

• Predictive Modeling
• Automation
• Personalization
• Fraud Detection
• Improved Customer Service
DATA SCIENCE LIFECYCLE
IMPLEMENTATION OF DATA SCIENCE

• Data Processing
• Data Visualization
• Statistics
• Machine Learning
• Natural Language Processing
• Python Basics
DATA PROCESSING
• Data Processing is the task of converting data
from a given form to a much more usable and
desired form i.e. making it more meaningful and
informative. Using Machine Learning algorithms,
mathematical modeling, and statistical
knowledge, this entire process can be automated.
• The output of this complete process can be in any
desired form like graphs, videos, charts, tables,
images, and many more, depending on the task
we are performing and the requirements of the
machine.
WORKING LEVEL OF DATA
PROCESSING
EXAMPLE OF DATA PROCESSING
DATA VISUALIZATION
• Data Visualization is the process of presenting data in the
form of graphs or charts. It helps to understand large and
complex amounts of data very easily.

• Data visualization can be done with various tools like,


Power BI, R Tool and Python.
COMMON DATA VISUALIZATION
EXAMPLE OF DATA VISUALIZATION
STATISTICS

• Statistics is the method, collection of data,


tabulation and interpretation of numerical data. It
is an area of applied mathematics concerned with
data collection analysis and presentation.
TYPES OF STATISTICS
MACHINE LEARNING

• Machine learning is a growing technology which


enables computers to learn automatically from
past data.
• Currently, it is being used for various tasks such
as image recognition, speech recognition, email
filtering, Facebook auto-tagging and
recommender system.
MACHINE LEARNING WORKING
PROCESS
TYPES OF MACHINE LEARNING
ALGORITHMS
NATURAL LANGUAGE PROCESSING

• Natural Language Processing (NLP) is a field of


Artificial Intelligence (AI) and Computer Science
that is concerned with the interactions between
computers and humans in natural language.
COMMON NATURAL LANGUAGE
PROCESSING (NLP) TASK

• Text and Speech Processing


• Text Classification
• Language Generation
• Language Interaction
APPLICATION OF NATURAL
LANGUAGE PROCESSING
BASICS OF PYTHON

• Python is a general-purpose, dynamic, high-level,


and interpreted programming language. It
supports Object Oriented programming approach
to develop applications. It is simple and easy to
learn and provides lots of high-level data
structures.
• Python is a popular programming language. It
was created by Guido van Rossum, and released
in 1991.
PYTHON APPLICATIONS
SYNTAX FOR PYTHON

print("Hello, World!")

OUTPUT:

Hello, World!

Python Indentation

• Indentation refers to the spaces at the beginning of a code line.


if 5 > 2:
print("Five is greater than two!")
NUMERBER DATA TYPE

• Int
a = 1 # int
• Float
a = 2.8 # float
• Complex
a = 1j # complex
SEQUENCE DATA TYPES

String:
• Strings in python are surrounded by either single
quotation marks, or double quotation marks.

Ex:
print("Hello")
print('Hello')
List:
• Lists are used to store multiple items in a single
variable.
• List items are ordered, changeable, and allow
duplicate values.
• Lists are created using square brackets:

Ex:
mylist = [“orange”, “white”, “green”]
Python - List Methods

• Add List Items


• Remove List Items
• Change List Items
• Access List Items
• Copy Lists
• Join Lists
Python - Add List Items

• To add an item to the end of the list, use


the append() method.

Ex: mylist = [“orange”, “white”, “green”]


mylist.append(“apple”)
print(mylist)

• To insert a list item at a specified index, use


the insert() method.

Ex: mylist = [“orange”, “white”, “green”]


mylist.insert(1, “apple”)
print(mylist)
Python - Remove List Items
• The remove() method removes the specified item.
Ex: mylist = [“orange”, “white”, “green”]
mylist.remove(“orange”)
print(mylist)

• The pop() method removes the specified index.


Ex: mylist = [“orange”, “white”, “green”]
mylist.pop(1)
print(mylist)

• The clear() method empties the list.


Ex: mylist = [“orange”, “white”, “green”]
mylist.clear()
print(mylist)
Python - Change List Items
• To change the value of a specific item, refer to the index
number:

Ex: mylist = ["apple", "banana", "cherry"]


mylist[1] = "blackcurrant"
print(mylist)

• To change the value of items within a specific range, define a


list with the new values, and refer to the range of index
numbers where you want to insert the new values:

Ex: mylist = ["apple", "banana", "cherry", "orange", "kiwi"]


mylist[1:3] = ["blackcurrant", "watermelon"]
print(mylist)
Python - Access List Items

• List items are indexed and you can access them


by referring to the index number:

Ex: mylist = ["apple", "banana", "cherry"]


print(mylist[1])
Python - Copy Lists and Join Lists
• Make a copy of a list with the copy() method:

Ex: thislist = ["apple", "banana", "cherry"]


mylist = thislist.copy()
print(mylist)

• There are several ways to join, or concatenate, two or


more lists in Python.

Ex: list1 = ["a", "b", "c"]


list2 = [1, 2, 3]

list3 = list1 + list2


print(list3)
Python Tuples:

• Tuples are used to store multiple items in a single


variable.
• Tuple is a collection which is ordered and
unchangeable. Allows duplicate members.
• Tuples are written with round brackets.

Ex: mytuple = ("apple", "banana", "cherry")


Python - Tuple Methods

• Access Tuple Items


• Update Tuples
• Join Tuples
Python - Access Tuple Items

• You can access tuple items by referring to the


index number, inside square brackets:

Ex: thistuple = ("apple", "banana", "cherry")


print(thistuple[1])
Python - Update Tuples

• Tuples are unchangeable, meaning that you cannot


change, add, or remove items once the tuple is created.
• But there is a workaround. You can convert the tuple into
a list, change the list, and convert the list back into a
tuple.

Ex: x = ("apple", "banana", "cherry")


y = list(x)
y[1] = "kiwi"
x = tuple(y)
print(x)
Python - Join Tuples

• To join two or more tuples you can use


the + operator:

Ex: tuple1 = ("a", "b" , "c")


tuple2 = (1, 2, 3)
tuple3 = tuple1 + tuple2
print(tuple3)
Python Sets

• Sets are used to store multiple items in a single


variable.
• Set is a collection which is unordered,
unchangeable, unindexed and No duplicate
members.
• Sets are written with curly brackets.

Ex: thisset = {"apple", "banana", "cherry"}


print(thisset)
Python - Sets Methods

• Add Set Items


• Remove Set Items
• Access Set Items
• Join Sets
Python - Add Set Items

• Once a set is created, you cannot change its items, but


you can add new items.
• To add one item to a set use the add() method.

Ex: thisset = {"apple", "banana", "cherry“}


thisset.add("orange“)
print(thisset)
Python - Remove Set Items

• To remove an item in a set, use the remove(), or


the discard() method.

Ex: thisset = {"apple", "banana", "cherry“}


thisset.remove("banana“)
print(thisset)

Ex: thisset = {"apple", "banana", "cherry“}


thisset.discard("banana“)
print(thisset)
Python - Access Set Items
• You cannot access items in a set by referring to an index
or a key.
• But you can loop through the set items using a for loop,
or ask if a specified value is present in a set, by using
the in keyword.

Ex: thisset = {"apple", "banana", "cherry“}


for x in thisset:
print(x)

Ex: thisset = {"apple", "banana", "cherry“}


print("banana" in thisset)
Python - Join Sets

• Use the union() method that returns a new set


containing all items from both sets, or
the update() method that inserts all the items from
one set into another:
Ex: set1 = {"a", "b" , "c"}
set2 = {1, 2, 3}
set3 = set1.union(set2)
print(set3)
set1.update(set2)
print(set1)
Mapping Data Types
Dictionary:
• Dictionaries are used to store data values in key:value
pairs.
• A dictionary is a collection which is ordered,
changeable and do not allow duplicates.

Ex: thisdict = {"brand": "Ford“,"model": "Mustang",


"year": 1964
}
print(thisdict)
Python - Dictionary Methods

• Add Dictionary Items


• Remove Dictionary Items
• Change Dictionary Items
• Access Dictionary Items
Python - Add Dictionary Items

• Adding an item to the dictionary is done by using a new


index key and assigning a value to it:

Ex: thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict["color"] = "red"
print(thisdict)
Python - Remove Dictionary Items
• The pop() method removes the item with the specified
key name:
• The clear() method empties the dictionary:

Ex: thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict.pop("model")
print(thisdict)
thisdict.clear()
print(thisdict)
Python - Change Dictionary Items

• Change the value of a specific item by referring to its


key name:

Ex: thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict["year"] = 2018
thisdict.update({"year": 2020})
Python - Access Dictionary Items

• Access the items of a dictionary by referring to its key


name, inside square brackets:
Ex: thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = thisdict["model"]
x = thisdict.get("model")
x = thisdict.keys()
x = thisdict.values()
x = thisdict.items()
PYTHON FUNCTIONS

• A function is a block of code which only runs


when it is called.
• Pass data, known as parameters, into a function.
• A function can return data as a result.
• Once defined, Python functions can be called
multiple times and from any location in a
program.
Creating a Function:-
• In Python a function is defined using
the def keyword.
Ex: def my_function():
print(“Hello from a function”)

Calling a Function:-
• To call a function, use the function name followed
by parenthesis.
Ex: def my_function():
print(“Hello from a function”)
my_function()
Arguments:-
• Information can be passed into functions as
arguments.
• Arguments are specified after the function name,
inside the parentheses. You can add as many
arguments as you want, just separate them with a
comma.

Ex: def my_function(fname):


print(fname + " Technologies")

my_function(“Immaculate”)
Python Classes and Objects

• In Python, a class is a user-defined data type that


contains both the data itself and the methods that may
be used to manipulate it.
• An object is a particular instance of a class with
unique characteristics and functions. After a class has
been established, you may make objects based on it.
By using the class constructor, you may create an
object of a class in Python.
Example:
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person(“Imma", 15)
print(p1.name)
print(p1.age)

Output:
Imma
15
PYTHON LIBRARIES FOR DATA
SCIENCE
• Data science involves computational techniques to extract
insights from data. On the other hand, a Python library is
a collection of pre-written code that provides a set of
functionalities that can be used to solve specific
programming problems.

• There are some python libraries that are useful for data
scientists to do Data Manipulation, Machine Learning,
Data Visualization, and Statistical Analysis.
Some of the main python data libraries are listed below:

1. NumPy
2. Matbotlib
3. Seaborn
4. Scikit-learn
5. TensorFlow
6. Keras
7. PyTorch
8. Pandas
1) NumPy:-
• NumPy is a Python module for numerical
computation that can process massive amounts of
data and perform array computations.

2) Matplotlib:-
• Matbotlib is a visualization-building plotting package
that is used to plot graphs and charts. It is frequently
utilized for data analysis due to the charts and
histograms that it generates. With these charts, you
can easily communicate data to a non-technical
person.
3) Seaborn:-
• A Matplotlib-based package is used to make
visualizations that are more enticing and instructive.
Seaborn for displaying statistical data. These include
themes, color palettes, and custom fonts.

4) Scikit-learn:-
• Scikit-learn is a machine learning package for Python
that offers practical tools for data analysis and
mining. It is useful for data processing, classification,
regression, and clustering.
5) TensorFlow:-
• An open-source software framework created by
Google called TensorFlow enables dataflow and
differentiable programming for a variety of purposes,
including machine learning.

6) Keras:-
• Keras is a Python-based high-level neural network
API that can operate on top of TensorFlow.
7) PyTorch:-
• Based on the Torch library, PyTorch is an open-
source machine learning library used for tasks like
computer vision and natural language processing.

8) Pandas:-
• Pandas is a popular data science library. It provides a
range of functions for data manipulation, data
analysis, and data visualization, making it a valuable
tool for data scientists.

You might also like