This course will give you a solid understanding of the Python building blocks from which to progress on to Python programming.
It will enable you to transfer your understanding and experience of working with the Language of SAS to develop meaningful programs and achieve the required results in Python.
This course is designed for those with prior knowledge of the Language of SAS and will provide direct comparisons to the Language of SAS throughout the course to provide context aiding learning and skills transfer.
There are mini quizzes and comprehensive exercises throughout to help assess and reinforce your learning with the opportunity to join end of day Q&A session(s) with the Instructor.
By the end of this course you will be able to:
On day 1 we invite you to join a short online welcome to meet your instructor, introduce you to our Digital Learning platform and get you started on the eLearning modules of this course.
You will need 4 hours to complete the 6 eLearning modules with additional time for exercises. We ask you to complete these modules before joining us for an online Masterclass on Day 2.
This is followed by 3 x 4 hour sessions delivered live online.
In addition, you will also need to set aside time to complete the Hands-On exercises.
Each day finishes with an open Q&A session with the instructor if you need any further support.
WHAT YOU SHOULD ALREADY KNOW...
This learning pathway is aimed at SAS Programmers who wish to learn Python in the contect of their SAS knowledge and skills.
You should already have:
- Knowledge of basic programming concepts
- Understanding of the Language of SAS
- Some previous programming experience in the Language of SAS
For the hands-on practice activities in the course, you will need access to an environment that runs Python. On our course we signpost you to Anaconda, a free open source platform, to run Python via Jupyter Notebook.
Anaconda must have a suitable operating platform installed:
- Windows 8 or newer
- 64-bit macOS 10.13+
- or Linux, including Ubuntu, RedHat, CentOS 6+, and others.
Full system requirements can be found here.
WHAT YOU'LL BE TAUGHT...
Introduction to Python (eLearning)
Learning Objective: Explain the history of Python and its common uses today
- Explain Python’s common uses and benefit
- Describe how Python was founded and grew into the language we know today
- Outline how to successfully move from a SAS environment into Python
Learning Objective: Explain what an Integrated Development Environment is and describe how use Jupyter Notebook.
- Identify the usefulness of integrated development environments (IDE)
- Explain why the Jupyter Notebook IDE is a great tool for getting started in Python
- Discuss the main functionality of Jupyter Notebook
Python Syntax (eLearning)
Learning Objective: Describe the basic concepts of Python syntax.
- Outline Python’s syntax rules with regards to lines, indentation and tokens
- Discuss the print() function
Python Variables (eLearning)
Learning Objective: Describe variable naming conventions, storage concepts and data types used in Python.
- Identify the rules with regards to variable naming conventions
- Name the five native data types of Python
- Describe the key elements of a variable assignment statement
- Outline how variables are stored and the importance of knowing a memory location
Everything is Data (eLearning)
Learning Objective: Explain what data objects are and how they relate to a class.
- Identify what a class is and why it’s important
- Describe what objects are and their relation to properties and methods
- Explain how to call the properties and methods within your code
- Discuss what is meant by the term ‘Everything is Data'
- Explain what is meant by the term ‘Object-orientated programming language’
Help Functions (eLearning)
Learning Objective: Know where and how to access help in Python
- Locate help topics within python, using the help() function and/or interactive menu
- Identify the attributes available for any object, using the dir() function
- Outline other useful help options in Jupyter Notebook.
Lists, Tuples & Dictionaries (Live Online Class)
Learning Objectives: How to initialise and use lists, tuples and dictionaries
- Describe the differences between list, tuples and dictionaries and when to use each
- List the governing classes for these data structures as well as some useful methods
- Expand on the intricacies of memory storage for mutable and immutable data types.
Functions (Live Online Class)
Learning Objectives: Explain the similarities between Python user-defined functions and SAS macros
- Use Python to create your functions that help you perform common task more efficiently
- Demonstrate how to apply a function to an iterable object
- Discuss the pros and cons of lambda functions
Loops (Live Online Class)
Learning Objective: Explain the similarities between Python and SAS loop methods
- Use iterative and conditional loops within the Python environment
- Describe the functions and methods available for use that let you manipulate data structures such as lists and dictionaries, whilst iterating through them
- Differentiate when to use iterative for loops versus conditional while loops
Branches (Live Online Class)
Learning Objective: Using conditional logic within your Python code
- Expand on basic conditional logic by using logical operators to link multiple conditions
- Use conditional logic with iterative loops to perform operations on iterative objects such as lists and dictionaries
- Use the ternary operator to simplify basic if-else conditional logic
Importing Modules (Live Online Class)
Learning Objectives: Explain the benefits of Python modules and how to use them
- Use modules to perform a multitude of programming tasks not available to native Python
- Solve the complexities of importing modules by using good practice techniques such as aliasing or importing only the functionality that you require
Dates (Live Online Class)
Learning Objectives: Explain the similarities between Python and SAS date and time objects
- Describe how dates and datetimes are handled in Python
- Use the datetime and dateutil modules to work with and manipulates dates and times
- Describe the most useful function and methods available for date and datetime objects
Pandas Introduction (Live Online Class)
Learning Objectives: Describe the similarities between SAS and Python pandas
- Describe the Series and DataFrame objects
- Discuss the analogous concepts between SAS datasets and pandas DataFrames
Creating Data (Live Online Class)
Learning Objectives: Using pandas to create DataFrames
- Use pandas to manually create DataFrames from Python dictionaries
- Use pandas to create DataFrames from an existing DataFrame
- Explain the possible memory storage problems you are likely to run into when using pandas DataFrames
- Solve possible memory storage implications of using pandas DataFrames
Data Input/Output (Live Online Class)
Learning Objective: How to importing and export pandas DataFrames
- Loading external data files into pandas DataFrames
- Exporting DataFrames from pandas into external files
- Supported file types
- Managing data types
Metadata (Live Online Class)
Learning Objective: How to investigate the metadata of a pandas DataFrame
- Use properties and methods of the DataFrame class to return metadata
- Compare the similarities between DataFrame property and methods and the SAS CONTENTS procedure
- Outline why DataFrame properties and methods are useful for getting to know your data
Understanding Data (Live Online Class)
Learning Objective: How to investigate the data portion of a pandas DataFrame
- Use properties and methods of the DataFrame class to give you a quick look at the data within, similar to the SAS PRINT procedure
- Demonstrate how to implement indexing syntax to subset rows and columns of a DataFrame
- Use the describe() method to return summary statistics for numeric columns in a DataFrame
Querying & Updating Data (Live Online Class)
Learning Objective: Using the loc[I,C] property to query and update a pandas DataFrame
- Describe how the loc[I,C] property allows you to subset rows and columns of a DataFrame object
- Use the loc[I,C] property to subset DataFrames in place or create and store new DataFrames
- Demonstrate how to implement boolean indexers to return subsets of data based on conditional logic.
Iteration (Live Online Class)
Learning Objective: Using iteration techniques to update a pandas DataFrame
- Discuss when iterating through a DataFrame is useful
- Demonstrate an understanding of how to use the iterrows() and apply() methods for iterating through a DataFrame
- Demonstrate an understanding of how to use vectorisation for iterating through a DataFrame
- Identify the pros and cons of each iteration technique
Branches in a Pandas Context (Live Online Class)
Learning Objective: Using suitable techniques to update a pandas DataFrame cell based on conditional logic
- Explain the key difference between the pandas Series where() method and the SAS WHERE statement
- Use iterative methods, together with conditional logic, to update full columns in a DataFrame.
Cleaning Data (Live Online Class)
Learning Objective: How to identify and dealing with missing data
- Identify missing data, including the rows and columns they are within
- Compare the different methods available for dealing with missing data
- Use the rename() method to update row and column indexes
- Outline the different options available for cleaning your data
Sorting Data (Live Online Class)
Learning Objective: How to sort pandas DataFrames
- Identify methods for sorting DataFrames based in data columns
- Identify methods for sorting or resetting DataFrames based on their index
- Use the drop_duplicates() method to remove duplicate rows of data, based on key columns
- Discuss the similarities between these methods and the SAS SORT procedure
Combining Data Vertically (Live Online Class)
Learning Objective: How to combine pandas DataFrames vertically
- Use the pandas concat() function and DataFrame append() method to join DataFrames vertically
- Discuss the similarities between the pandas concat() function and the SAS Data Step for joining data vertically
- Discuss the similarities between the DataFrame append() method and the SAS APPEND procedure
Combining Data Horizontally (Live Online Class)
Learning Objective: How to combine pandas DataFrames Horizontally
- Use the pandas concat() function and DataFrame merge() method to join DataFrames horizontally
- Explain the special situation in which the pandas concat() function is applicable for merging pandas DataFrames
- Discuss the similarities between the DataFrame merge() method and the SAS SQL procedure for merging data horizontally