Python For Non-Programmers Final
Python For Non-Programmers Final
Agenda
hello Olá
Bonjour नमस्कार
Grammar in Language
I am Sam Am Sam I
Language for Computers
Java Python
C++
Syntax for Computer Language
import pandas as pd
pandas import pd as
Why do we need Programming?
Why do we need Programming?
Why do we need Programming?
Applications of Programming Languages
13.4
My Name is Sam
287
(a+b)2 0 1
How to Store Data?
“John”
123
TRUE
Need of Variables
Student
“John”
0x1098ab
Example of Variable
a+b
10 a
a-b
a/b
Decision Making Statements
If
else
It’s raining:
Go out and Play Football
Sit inside
Decision Making Statements
If
else
Marks > 70:
Give Practice Test
Get Ice-cream
if…else Pseudo Code
If(condition){
Statements to be executed….
}
else{
Statements to be executed….
}
Looping Statements
while(TRUE){
Keep executing statements….
}
Functions in Real Life
Properties Behavior
Start
Take Number
If number
Even Number Odd Number
% 2 == 0
End
Introduction to Python
Cross-Platform
Compatible
Object Oriented
Installing Python
“John”
“Sam”
“Matt”
Variables in Python
Student
“John”
0x1098ab
Variables in Python
Arithmetic Operators
Keywords
Identifiers
Literals
Operators
Python Keywords
as elif If Or Yield
Python Identifiers
Rules
Strings are sequence of characters enclosed within single quotes(‘ ’), double
quotes(“ “) or triple quotes(‘’’ ‘’’)
‘’’ I am going to
‘Hello World’ “This is Sparta”
France tomorrow’’’
Extracting Individual Characters
String Functions
Finding length of string Converting String to lower case Converting String to upper case
String Functions
Replacing a substring
Splitting a String
Data-Structures in Python
Tuple List
Dictionary Set
Tuple in Python
tup1=(1,’a’,True)
Extracting Individual Elements
Modifying a Tuple
Concatenating Tuples
Tuple Basic Operations
Minimum Value
Maximum Value
List in Python
l1=[1,’a’,True]
Extracting Individual Elements
Modifying a List
Concatenating Lists
Repeating elements
Dictionary in Python
Fruit={"Apple":10,"Orange":20}
Extracting Keys and Values
Extracting Keys
Extracting Values
Modifying a Dictionary
Popping an element
Set in Python
s1={1,"a",True}
Set Operations
If
else
It’s raining:
Go out and Play Football
Sit inside
If Statement
If
else
Marks > 70:
Give Practice Test
Get Ice-cream
if…else Pseudo Code
If(condition){
Statements to be executed….
}
else{
Statements to be executed….
}
Looping Statements
Syntax:
Enter While loop
while condition:
Test Execute Statements
Expression
Body of While
For Loop
Properties Behavior
int float
bool str
Mobile
Attributes and Methods
color
Attributes
cost
Play Game
Methods
Make Call
Objects
a = 10 b = 20 c = 30
Invoking the
‘employee_details’
method
Inheritance in Python
With inheritance one class can derive the properties of another class
Man inheriting
features from his
father
Inheritance Example
Invoking show_details()
method from parent class Invoking show_car_details()
method from child class
Types of Inheritance
Single Inheritance
Multiple Inheritance
Multi-level Inheritance
Hybrid Inheritance
Multiple Inheritance
In multiple inheritance, the child inherits from more than 1 parent class
Parent 1 Parent 2
Child
Multiple Inheritance in Python
Invoking methods
Parent
Child
Grand-Child
Multi-Level Inheritance in Python
Grand-Child Class
Parent Class
Child Class
Multi-Level Inheritance in Python
Python library is a collection of functions and methods that allows you to perform many actions without writing your code
NumPy
Python NumPy
NumPy stands for Numerical python and is the core library for numeric and
scientific computing
NumPy
Creating NumPy Array
Single-dimensional Multi-dimensional
Array Array
Initializing NumPy Array
Basic Multiplication
Basic Addition
Median
NumPy Broadcasting
10 20 30 40 50 + 5
10 20 30 40 50
5 5 5 5 5
NumPy Broadcasting
NumPy Broadcasting
NumPy Matrix
NumPy Matrix Transpose
NumPy Matrix Multiplication
NumPy Save & Load
Pandas stands for Panel Data and is the core library for data manipulation and data
analysis
Pandas Data-Structures
Single-dimensional Multi-dimensional
head()
shape() describe()
tail()
.iloc[]
.loc[]
Dropping Columns
Dropping Rows
Combining Data-Frames
Axis=0
Data-Frames Concatenation
Axis=1
Data-Frames Merge – Inner Join
Inner Join
Data-Frames Merge – Left Join
Left Join
Data-Frames Merge – Right Join
Right Join
Data-Frames Merge – Outer Join
Outer Join
More Pandas Functions
Mean Minimum
Median Maximum
More Pandas Functions
More Pandas Functions
Value_counts()
sort_values()
Pokemon Analysis
Understanding Data
Looking at Null Values
Imputing Null Values
Checking Frequency
Renaming Columns
Extracting Primary Types
Extracting Primary & Secondary Types
Extracting Specific Pokemons
Python Matplotlib
Adding sub-plots
Bar Plot
Bar Plot
Adding sub-plots
Histogram
Creating data
Making Histogram
Histogram
Changing Aesthetics
Histogram
Creating data
Making Histogram
Making Plot
Violin-Plot
Creating data
Making Histogram
Making Plot
Pie-Chart
Creating data
Making Plot
Pie-Chart
Changing Aesthetics
DoughNut-Chart
Creating Data
Making Plot
SeaBorn Line Plot
SeaBorn Line Plot
Adding Styles
SeaBorn Line Plot
Adding Markers
SeaBorn Bar Plot
SeaBorn Bar Plot
SeaBorn Bar Plot
SeaBorn Bar Plot
SeaBorn Bar Plot
SeaBorn Scatterplot
SeaBorn Scatterplot
SeaBorn Scatterplot
SeaBorn Histogram/Distplot
SeaBorn Histogram/Distplot
SeaBorn Histogram/Distplot
SeaBorn Histogram/Distplot
SeaBorn Histogram/Distplot
SeaBorn JointPlot
SeaBorn JointPlot
SeaBorn JointPlot
SeaBorn BoxPlot
SeaBorn BoxPlot
SeaBorn BoxPlot
SeaBorn BoxPlot
SeaBorn BoxPlot
SeaBorn BoxPlot
SeaBorn Pair Plot
Case Study
Case Study
Renaming Columns
Case Study