0% found this document useful (0 votes)
2 views

Basics of Python

The document provides an overview of ExcelR, a training initiative by IIT, IIM, and ISB alumni, offering over 60 courses in data science and related fields. It includes a brief introduction to Python, covering data types, operators, and variable rules, along with examples of valid and invalid variable names. The document also highlights the experience of Dr. Ganashree T S, who has extensive expertise in machine learning and data science.

Uploaded by

waduire
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Basics of Python

The document provides an overview of ExcelR, a training initiative by IIT, IIM, and ISB alumni, offering over 60 courses in data science and related fields. It includes a brief introduction to Python, covering data types, operators, and variable rules, along with examples of valid and invalid variable names. The document also highlights the experience of Dr. Ganashree T S, who has extensive expertise in machine learning and data science.

Uploaded by

waduire
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Basics of R,Python & Statistics

Agenda
• About ExcelR
• Courses offered in ExcelR
• Anaconda Installation
• Introduction to Python
• Data Types
• Operators
About ExcelR

• Initiative of IIT,IIM and ISB alumni


• 130,000 participants trained globally
• 20,000 Data Scientists trained globally
• Footprint in USA, Malaysia, UK and
across India
• Training partners for 150+ corporate
companies and
70+ universities & colleges
Who am I?
Dr.Ganashree T S
• Overall 13+ years of experience in Machine Learning,DataScience
and Deep Learning.
• I am a qualified person, I have completed my Engineering, Master
degree and Ph. D
• Currently also Pursuing my Post Doctoral Research from Foreign
university on “ Datascience”
• Worked as a Professor in various reputed Engineering Colleges like
DSCE.
• Led large engagements on “Datascience as a Resource Person in
various IT Industry.Worked on government Funded Projects Like
VGST and also have three Indian Patents filed
ExcelR

ExcelR offers 60+ courses on online and classroom mode


with top-notch quality.

Below are the courses that accredited by Steinbeis University


Post-Graduation Programs:
1. Post - Graduation Program on Data Science Steinbeis University,
Germany
Diploma Programs:
1. Diploma Program in Data Science
Data Types of Python/Data
Structures of Python
• Mutable data types in Python(whose values can be
changed)
• List
• Sets
• Dictionary
• Immutable data types in Python(whose values cannot
be changed)
• Numbers
• Strings
• Tuples
Comparison of different data Types
String List Tuple Set Dictionary

Immutable Mutable Immutable Mutable Mutable

Ordered /Indexed Ordered/ Ordered/Indexed Unordered Unordered


Indexed

Allows Duplicate Allows Allows duplicate Members Does not allow duplicate Does not allow duplicate
Members Duplicate members members
Members

Empty String=“ ” Empty List=[ ] Empty Tuple=() Empty set={ } Empty Dictionary={ }

String with single List with single Tuple with single Set with the single Dictionary with {Hello:1}
Element=“H” Item=[“Hello”] Item=(“Hello”) Item={1,2,3,4,5}
Dictionary
• A dictionary in Python is a data structure that stores the value in
key:value pairs. Dictionaries are mutable, dynamic, and can be
nested. Dictionaries are different from lists primarily in how
elements are accessed: while lists are indexed by numbers,
dictionaries are indexed by keys
Example:# Creating a dictionary with integer keys
Dict={1:’Geetha',2:’Anitha’,3:Ramesh'}
Set

• A Set in python programming is an unordered collection data type


that is iterable, mutable and has no duplicate elements.we cannot
access elements in set using Index

• Example:
• x={Geetha,Anish,Amith}
• Type(x)
List
• Lists are used to store multiple items in a single variable. Lists are
created using square brackets:
• Example
• x = ["apple", "banana", "cherry"]
print(x)
Tuple
• Tuples are used to store multiple items in a single
variable.
• Tuple is one of 4 built-in data types in Python used to
store collections of data, the other 3 are List, Set, and
Dictionary, all with different qualities and usage.
• A tuple is a collection which is ordered
and unchangeable.
• Tuples are written with round brackets.
Strings
• Strings in python are surrounded by either single quotation marks, or
double quotation marks. A String is a data structure in Python that
represents a sequence of characters. It is an immutable data type,
meaning that once you have created a string, you cannot change it.
Strings are used widely in many different applications, such as
storing and manipulating text data, representing names, addresses,
and other types of data that can be represented as text.(
• Example
• Print(“hello world”)
Python Range
• Create a sequence of numbers from 0 to 5, and print each
item in the sequence:
• x = range(6)
• The range() function in Python returns a sequence of numbers in a given range. The most
common use of it is to iterate over a sequence of numbers using Python loops 1.
• The syntax of the range() function is:
• range(start, stop, step)
• The parameters are:
• start: the starting value of the sequence (optional, default is 0)
• stop: the end value of the sequence (exclusive, required)
• step: the difference between two consecutive values in the sequence (optional, default is 1)
• Hands on session using Python for different data
Types
Python Variables
• Python Variables are containers for storing data
values
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)
• A variable name cannot be any of the Python
keywords.
Class Test
• Identify following example as valid variable
• --x
• --x—
• -
• 7x
• 8x
Examples of Valid Variables in
Python
• myvar = "John"
my_var = "John"
_my_var = "John"
myVar = "John"
MYVAR = "John"
myvar2 = "John"
Examples of invalid variables in
Python
2myvar = "John"
my-var = "John"
my var = "John"
• 1)A variable name must start with letter or the underscore character

• 2)A variable name cannot start with number

• 3) A variable name can only contain alpha numeric character and underscores(A-Z,0-9and_)(No symbols
are allowed as a variable Name

• 4)Variable names are case sensitive(age,Age and AGE are three different variables)

• 5)There cant be a space among variable


Python divides the operators in the following groups:

• Arithmetic operators
• Assignment operators
• Comparison operators
• Logical operators
Thank You

You might also like