• No results found

Introduction to Python

N/A
N/A
Protected

Academic year: 2021

Share "Introduction to Python"

Copied!
16
0
0

Loading.... (view fulltext now)

Full text

(1)

Introduction

to

Python

Readable. Simple. Dynamic. Fast.

Powerful. In-demand.

Spotle.ai Study Material

(2)

Instructors

Mousum Dutta

Chief Data Scientist, Spotle.ai IIT Kharagpur

Spotle.ai Study Material

(3)

Spotle.ai Study Material

Spotle.ai/Learn

The demand for Python is growing….

Machine Learning Data Analysis

Python has

been the

fastest growing

language,

globally, over

the last few

years, fuelled

mostly by its

usage in AI and

Data Science

(4)

Spotle.ai Study Material

Spotle.ai/Learn

The demand for Python is growing….

Machine Learning

Data Analysis

The average

(5)

The case for Python

✓ High Usability

✓ Flexibility – Python allows easy cross-app integration and also inter-operability with other programming languages

✓ Readable and simple – Easier to learn, code and debug

✓ Large standardised library simplifying complex tasks ✓ Interactive mode with the

integrated, easy to use development environment Jupyter

Web Development

• Core Python Packages: Flask, Django Data Science

• Core Python Packages: Pandas, Matplotlib, StatsModels Text Processing

Core Python Packages: NLTK, TextBlob, Spacy Artificial Intelligence

• Core Python Packages: SciKit – Learn, Tensorflow, Keras Scientific and Numeric Computing

• Core Python Packages: NumPy

Python Use Cases and Libraries

Used By:

Spotle.ai Study Material

(6)

Python 2 vs Python 3

Python 2 Python 3

Legacy

Though used in 63% of software projects till 2017-18, its adoption is declining. As of 2019, the

latest version of Python 2, Python 2.7 is officially retired

Way Ahead

Uptick in adoption. New libraries are being for Python3

ASCII

Strings are stored as ASCII by default

UNICODE

Strings are stored as UNICODE by default

3/2 = 2

In Python 2, 3/2 is integer division or floor division. So Print 3/2 will print 1

3/2 = 1.5

In Python 3, 3/2 returns the expected 1.5. So Print (3/2) will print1.5

Print is a Statement

Print “Welcome to Spotle.ai”

Print is a Function

Print (“Welcome to Spotle.ai”)

Spotle.ai Study Material

(7)

Spotle.ai Study Material

Spotle.ai/Learn

(8)

Compiler vs Python Interpreter

Basis Compiler Interpreter

Input It takes an entire program at a

time

It takes a single line of code or instruction at a time

Output It generates intermediate object

code

It does not produce any intermediate object code

Working mechanism


The compilation is done before execution

Compilation and execution take place simultaneously

Speed Comparatively faster Slower

Memory
 Memory requirement is more due

to the creation of object code

It requires less memory as it does not create intermediate object code

Errors
 Display all errors after

compilation, all at the same time

Displays error of each line one by one

Error detection Difficult Easier comparatively

Spotle.ai Study Material

Spotle.ai/Learn 8

(9)

In Python, indentation is not just for

making it look pretty

In Python, indentation has well defined meaning. Indentation is used to define block of codes. See the below example.

If (1==1)

print (“All is well”) Else

print (“End of the world”) print (“Bye Bye”)

If (1==1)

print (“All is well”) Else

print (“End of the world”) print (“Bye Bye”)

This will print

All is well Bye Bye

The above piece of code will

consider print (“Bye Bye”) outside if-else

This will print All is well

But will not print Bye Bye

The above piece of code will consider print (“Bye Bye”) under else condition

Spotle.ai Study Material

(10)

In Python, everything is an object

Python is an object oriented language where everything is an object. Unlike Ruby, python objects are not necessarily sub-classable or have methods. They are objects in the sense they can be passed in functions or assigned to variables. class Myself def self_love(self): Print(“I am awesome”) Me = Myself() Me.self_love()

Here Myself is a class, the function self_love is called a method of Myself and Me is an object of type Myself.

Spotle.ai Study Material

(11)

Data Types and Operators in Python

Python supports 5 standard data types. Numbers

String List Tuple Dictionary

Python supports a wide variety of operators.

✓ Arithmetic Operators

✓ Comparison (Relational) Operators

✓ Assignment Operators

✓ Logical Operators

✓ Bitwise Operators

✓ Membership Operators

✓ Identity Operators

Spotle.ai Study Material

(12)

Setting up Python

Spotle.ai Study Material

Spotle.ai/Learn 12

(13)

Spotle.ai Study Material

Spotle.ai/Learn

Certificate Masterclass In

Python Fundamentals

(14)

Certificate Masterclass in Python – What

will you learn?

✓ Go from an absolute beginner to a confident programmer level with complete

understanding of Python basics

✓ Master the latest version of Python, Python 3 in 6 weeks

✓ Get adequate hands-on exercises to practise all your Python concepts.

✓ Cover fundamentals and basic libraries including Classes and objects,

Numbers, Strings, Basic Operators 

✓ Practise Python through comprehensive quizzes with detailed notes to help you

understand solutions

✓ Build your foundation for more advanced programs including Data Science,

Text Processing, Machine Learning and Deep Learning using Python

✓ Understand career paths in Python and how to prepare for career opportunities

Spotle.ai Study Material

(15)

Learn Python In The Most Intense Course Ever: https://spotle.ai/learn/python

20

Interactive Videos with illustrative examples

24/7

Access to chat and career support

4

Live Classes With Instructors to learn

concepts first-hand

20

Quizzes to test your learning on the go

7

Hours Of Lecture

20

Practice sessions and real-life projects

Learn at your own pace with integrated

instructor support

Interactive Videos with illustrative examples

Quizzes to test your learning on the go

Hours Of Lecture

Live Classes With Instructors to learn concepts first-hand

Practice sessions and real-life projects

Access to chat and career support

15

Spotle.ai Study Material

(16)

Spotle.ai Study Material

Spotle.ai/Learn 16

Your Take - aways

✓ Certificate Of Completion.

✓ Integrated live projects and performance based internship. ✓ Membership of Spotle AI Alumni club with priority

access to courses, events and mentoring.

✓ Optimized career path fitment through AI.

✓ Personalised career

guidance and assistance.

Sign up for the Masterclass: https://spotle.ai/learn/python

Spotle.ai Study Material Spotle.ai/Learn

References

Related documents

Arkansas Tech University Auburn University Augusta State University Baylor University Bluefield State College Clemson University Coastal Carolina University Delaware State

Similar to Gelles’s (1975) early findings, our study also found that pregnancy increases women’s risk of intimate partner violence through partner’s sexual frustration, stress of

Di dalam ketentuan mengenai fidusia sebagaimana diatur dalam Undang-Undang No. 42 Tahun 1999 tentang Jaminan Fidusia. Hak Cipta telah diakomodir sebagai objek jaminan melalui

Due to the great success of the previous editions, the University of Enna Kore, with the collabora- tion of the Department of Industrial Engineering of the University of

Aplikasi network monitoring bertugas mengumpulkan statistik jaringan untuk beberapa kebutuhan seperti pelacakan flow dan jaringan dengan statistik paket yang luas ataupun juga

For this report, CFA looked at premium data from the five largest auto insurers for a single good driver profile in most ZIP codes throughout the country and examined average

The study showed that introvert learners learn English speaking skill in order to communicate properly in English and facilitate their learning in other skills.. Since

features of an object) of primitive type are given default values.. int age; // Initialized