Inroduction to Python for SAS Programmers
Simply fill in the form below to sign up for our Newsletter:
Sign Up for our Newsletter

Course Length:  

This is a four-day course.

Course Summary:

The Python for SAS Programmers provides delegates with the essential elements of programming in Python to be able to extract data, manipulate data and prepare data through the use of Python scripts.

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. Exploring key concepts of the language to get you up and running including; variables & data types, operators & expressions, conditions & loops, functions, lists, strings, dictionaries, dates, modules, and working with Jupyter notebooks

The course is ideal for those with prior knowledge of the Language of SAS.

What you will be taught:

·        Course Introduction

o    Introduction

o    Course Objectives

o    Course Overview

·        Python History

o    History of Python

o    Python 2 vs Python 3

·        Introducing Jupyter Notebooks

o    What is an IDE?

o    Other Python IDEs

o    Jupyter Notebooks

§  Overview

§  Folders

§  Files

§  Code

·       Some things to unlearn from SAS to Python

o    Variables

o    Data Steps and PROC steps

o    Functions and Macros

o    Indexes

·        Syntax and the print statement

o    Program components

o    Running Python inline and in script

o    Syntax rules

o    The print() statement

·        Variables

o    Naming conventions

o    Data types

o    Creating variables

o    Variable storage

·        Everything is Data!

o     Data

o   What are objects, methods and properties

o    How to access data in objects

o    Some conventions used for objects in Python

·        Lists and Dictionaries

o    List data structure

o    Dictionary data structure

·        Functions

o    Built in functions

o    Character functions

o    Numeric functions

o    User defined functions

o    Lambda function

·        Using help

o    The help function

o    Help in Jupyter Notebook

·        Loops

o    For loops

o    Nested loops

·        Branches

o    If elif else

o    The Ternary operator

·        Modules, numpy and pandas

o    What is a module

o    Using modules

o    The numpy module

o    The pandas module




·        Dates

o    Introduction to Python date and datetime objects

o    Creating date and datetime objects

o    Data functions

o    The Timedelta object

·        Introduction to pandas

o    What pandas is

o    The pandas data structure

o    SAS compare to pandas

o    The PDV in Python

o    DataFrame

·        Creating Data in pandas

o    Creating data (SAS code DATALINES, CARDS equivalent)

o    Creating data from existing data (SAS code SET equivalent)

o    Copying DataFrames

·        Data Input/Output in pandas

o    Using pandas.DataFrame.read_xxx syntax

o    Using pandas.DataFrame.to_xxx syntax

·        Understanding pandas metadata

o    Comparison of PROC CONTENTS with DataFrame methods.

·        Understanding data in pandas

o    Previewing Data

o    Descriptive Statistics

·        Querying and updating data in pandas

o    Selecting Data.

o    Labels and Indexes

o    Boolean Indexing.

o    Iterating DataFrames.



·        Branching in pandas

o    The where() statement

o    The if _elif_else statement

·        Cleaning data

o    Missing data

o    Checking for missing data

o    Dropping missing data

o    Working with missing data

o    Selecting and dropping columns

o    Selecting and dropping rows

·        Sorting data

o    The sort_values() method

o    Ascending and descending order

o    Sorting by multiple columns

o    Removing duplicate data

·        Combining Data Vertically

o    Using pandas.concat()

o    Using pandas.append()

·        Combining Data Horizontally

o    The pandas.merge() method

o    The how parameter

o    SQL in Python

·        PROC PYTHON and Pandas

o    Inline Python

o    Python scripts

o    Exporting data from SAS code to Python

o    Importing data from Python to SAS code

·        Workshop -  SAS code to Python

o    The candidate will get the opportunity to convert some SAS to Python



What you should already know:

  • Knowledge of basic Programming concepts

  • Understanding of the Language of SAS including topics covered in Foundations – The Language of SAS, the DataStep – the Language of SAS or the Fast-Track Base – The Language of SAS.

  • Some previous programming experience in the Language of SAS