Complete Bootcamp: from Zero
to Hero in Python
Presentation by Manos Androulidakis
Hello!
◎BS in Physics
◎MS in Information Systems:
Big Data and Analytics
manos@rapidbounce.co
2
1. Introduction
Basic Concepts
3
Data types
◎ Strings
◎ Numbers (int , float , complex)
◎ Lists , tuples , range
◎ Dictionaries
◎ Sets
◎ Bool
4
5
6
Python
Operators
Value and variable
manipulation
7
Data types
◎ Arithmetic (+ - * / % **)
◎ Comparison (== != <> > < >= <=)
◎ Assignment (= += -= *= /= %= **= //=)
◎ Logical (AND OR NOT)
◎ Membership (in not in)
◎ Identity (is is not)
8
Python
Statements
9
Statements
IF / ELIF / ELSE
Make a decision based
on a logical condition.
FOR LOOPS
A for loop is used for
iterating over a
sequence (list , tuple,
dictionary, set or
string).
WHILE LOOPS
With the while loop we
can execute a set of
statements as long as a
condition is true.
10
If/else statement
11
For loop syntax
12
While loop syntax
13
Methods /
Functions
Def , Args ,
Lambda
14
Methods/Functions
Def
A function is a block of
code which only runs
when it is called. We
can pass data, known
as parameters into a
function
A function can return
data as a result.
Args
Args are used to pass a
variable number of
arguments to a
function. It is used to
pass a variable length
argument list.
Lambda function
A lambda function is a
small anonymous
function. It can take
any number of
arguments but can
have one expression.
15
Modules,
Packages
Pip Install , PiPy
16
Modules and Packages
Modules/ Packages
Modules are .py scripts
and packages are a
collection of modules.
There are packages for
almost any use.
PyPi
PyPi is a repository for
open-source third party
Python packages. It’s
similar to RubyGems in
the Ruby World, PHP’s
Packagist, CPAN for Perl
and NPM for Node.js
Pip install
Packages can be
installed using the pip
install command.
17
Object
Oriented
Programming
18
Python Classes and Attributes
Python Class
Python is an object oriented
language. Everything i an
object with properties and
methods. A class is like an
object constructor or a
blueprint for creating objects.
Class Attributes
A class attribute is a Python
variable that belongs to a
class rather than a particular
object.
19
Useful Commands
Def _init_
The init method is roughly
what represents a constructor
in python. When you call a it
Python creates an object and
passes it as the first
parameter to the _init_
method.
self.attribute
The self parameter is a
reference to the current
instance of the class, and is
used to access variables that
belong to the class.
20
Errors and
Exceptions
21
Try - Except - Finally
22
Decorators and Generators
Decorators
Decorators are a useful
tool in Python since
they allow us to modify
the behavior of
function or class.
Decorators allow us to
wrap another function
in order to extend the
behavior of wrapped
function without
permanent
modifications
Generators
Generator functions
allow us to declare a
function that behaves
like an iterator i.e. it
can be used in a for
loop.
23
Useful Python Modules/Libraries
Random
This module implements pseudo-
random number generators for
various distributions.
Zip/unzip
Importing zipfile allows us to zip
and unzip selected files.
shutils
This module offers a number of
high level operations on files and
collections of files.Functions are
provided which support file
copying and removal.
Debugger
The module pdb defines an
interactive source code debugger
for Python programs. It supports
setting breakpoints , single
stepping , inspection of stack
frames , source code listing and
evaluation of arbitrary code.
Working with images
Importing pillow allows us to open
, save and interact with images
through python code.
PyPDF2
This module allows us to work
with pdf files
24
Example of using Python for PDF files (1)
25
Example of using python for PDF files (2)
26
CSV files in Python
CSV
Importing csv allows us to read, save and manipulate CSV files
for large scale data.
27
Thanks!
Any questions?
You can find me at: manos@rapidbounce.co
28

This presentation is a great introduction to both fundamental programming concepts and the Python programming language

  • 1.
    Complete Bootcamp: fromZero to Hero in Python Presentation by Manos Androulidakis
  • 2.
    Hello! ◎BS in Physics ◎MSin Information Systems: Big Data and Analytics manos@rapidbounce.co 2
  • 3.
  • 4.
    Data types ◎ Strings ◎Numbers (int , float , complex) ◎ Lists , tuples , range ◎ Dictionaries ◎ Sets ◎ Bool 4
  • 5.
  • 6.
  • 7.
  • 8.
    Data types ◎ Arithmetic(+ - * / % **) ◎ Comparison (== != <> > < >= <=) ◎ Assignment (= += -= *= /= %= **= //=) ◎ Logical (AND OR NOT) ◎ Membership (in not in) ◎ Identity (is is not) 8
  • 9.
  • 10.
    Statements IF / ELIF/ ELSE Make a decision based on a logical condition. FOR LOOPS A for loop is used for iterating over a sequence (list , tuple, dictionary, set or string). WHILE LOOPS With the while loop we can execute a set of statements as long as a condition is true. 10
  • 11.
  • 12.
  • 13.
  • 14.
    Methods / Functions Def ,Args , Lambda 14
  • 15.
    Methods/Functions Def A function isa block of code which only runs when it is called. We can pass data, known as parameters into a function A function can return data as a result. Args Args are used to pass a variable number of arguments to a function. It is used to pass a variable length argument list. Lambda function A lambda function is a small anonymous function. It can take any number of arguments but can have one expression. 15
  • 16.
  • 17.
    Modules and Packages Modules/Packages Modules are .py scripts and packages are a collection of modules. There are packages for almost any use. PyPi PyPi is a repository for open-source third party Python packages. It’s similar to RubyGems in the Ruby World, PHP’s Packagist, CPAN for Perl and NPM for Node.js Pip install Packages can be installed using the pip install command. 17
  • 18.
  • 19.
    Python Classes andAttributes Python Class Python is an object oriented language. Everything i an object with properties and methods. A class is like an object constructor or a blueprint for creating objects. Class Attributes A class attribute is a Python variable that belongs to a class rather than a particular object. 19
  • 20.
    Useful Commands Def _init_ Theinit method is roughly what represents a constructor in python. When you call a it Python creates an object and passes it as the first parameter to the _init_ method. self.attribute The self parameter is a reference to the current instance of the class, and is used to access variables that belong to the class. 20
  • 21.
  • 22.
    Try - Except- Finally 22
  • 23.
    Decorators and Generators Decorators Decoratorsare a useful tool in Python since they allow us to modify the behavior of function or class. Decorators allow us to wrap another function in order to extend the behavior of wrapped function without permanent modifications Generators Generator functions allow us to declare a function that behaves like an iterator i.e. it can be used in a for loop. 23
  • 24.
    Useful Python Modules/Libraries Random Thismodule implements pseudo- random number generators for various distributions. Zip/unzip Importing zipfile allows us to zip and unzip selected files. shutils This module offers a number of high level operations on files and collections of files.Functions are provided which support file copying and removal. Debugger The module pdb defines an interactive source code debugger for Python programs. It supports setting breakpoints , single stepping , inspection of stack frames , source code listing and evaluation of arbitrary code. Working with images Importing pillow allows us to open , save and interact with images through python code. PyPDF2 This module allows us to work with pdf files 24
  • 25.
    Example of usingPython for PDF files (1) 25
  • 26.
    Example of usingpython for PDF files (2) 26
  • 27.
    CSV files inPython CSV Importing csv allows us to read, save and manipulate CSV files for large scale data. 27
  • 28.
    Thanks! Any questions? You canfind me at: manos@rapidbounce.co 28