Introduction to Python programming

This course has been superseded

We suggest the following instead:
Python programming - Introduction

Course Description

This three day course is a practical introduction to Python 3, not an academic overview of syntax and grammar. Participants will immediately be able to use Python to complete tasks in the real world. Participants are expected to be design and evaluation engineers with some programming experience (in another language). This is a hands-on programming class. All concepts are reinforced by informal practice during the lecture followed by graduated lab exercises.
3 Days
Contact us for pricing
 

Prerequisites

Some level of experience with at least one other programming language is desirable. This is not an Introduction to Programming course. Working/user level knowledge of an operating system such as Linux, Windows, or MacOS.

Who should attend

Design and evaluation engineers with some programming experience (in another language).

Learning Objectives

At the conclusion of this course, attendees will be able to:
Design and program python applications using PyCharm / Spyder and Jupyter environments
Use the main flow of control elements in python
Choose the appropriate variable type when required
Use the different collection types, including lists, tuples and dictionaries
Write functions and pass parameters
Create classes and objects
Read, write and parse different types of files
Access operating system variables and automate tasks
Use Numpy and Pandas to represent data sets
Create mathematical models using Scipy, e.g using integrate and fast fourier transforms
Graph using matplotlib and other tools

Python basics

The Python environment
PyCharm or Spyder environment (or other)
Variables
Keywords
Built in functions
Variable types

Flow Control

if and elif
Conditional expressions
Relational operators
Boolean operators
while loops
Alternate ways to exit a loop

Functions

Defining a function
Function parameters
Global variables
Variable scope
Returning values

Modules and Packages

The import statement
Zipped libraries
Creating Modules
Packages

Lists and Tuples

About sequences
Lists
Indexing and slicing
Iterating through a sequence
Functions for all sequences
Using enumerate
Operators and keywords for sequences
The xrange() function

Working with files

Text file I/O
Opening a text file
The with block
Reading a text file
Writing to a text file
"Binary" (raw, or non-delimited) data

Exception handling

Exceptions
Handling exceptions with try
Handling multiple exceptions
Handling generic exceptions
Ignoring exceptions
Using else
Cleaning up with finally
re-raising exceptions
Raising a new exception
The standard exception hierarchy

Dictionaries and sets

About dictionaries
When to use dictionaries
Creating dictionaries
Getting dictionary values
Iterating through a dictionary
Reading file data into a dictionary

Functional Programming

Creating functions with no side effects
Lambda expressions
Reduce
Decorators in Python

OS Services and Task Automation

The OS module
Environment variables
Launching external processes
Paths, directories, and filenames
Walking directory trees
Dates and times
Sending email
Other tasks

Classes

Defining classes
Instance objects
Instance attributes
Methods
Properties
Class data
Inheritance
Pseudo-private variables
Static methods

Jupyter

Tab completion
Magic commands
Benchmarking
External commands
Enhanced help
Notebooks

Scipy

About scipy
Polynomials
Integrate and interpolate
Vectorizing functions
Fftpack

Numpy

Objectives
Python's scientific stack
numpy overview
Creating arrays
Creating ranges
Working with arrays
Shapes
Slicing and indexing
Indexing with Booleans
Stacking
Iterating

Pandas

About pandas
Architecture
Series
DataFrames
Index Objects
Basic Indexing
Broadcasting

matplotlib

About matplotlib
matplotlib architecture
How to set up your plt
Alternatives to matplotlib – e.g ggplot2

Task automation

Developing an automation pipeline
Real world automation problem

PythonPython ProgrammingPython 3Midas Skillnet