SPSS Python Text Replacement Tutorial

A common task in Python is building strings from other strings, especially if we’re creating SPSS syntax. We could simply concatenate strings into larger strings but there’s a nicer way: string replacements with the % sign. Please note that the examples in this tutorial assume Python2.x* and may not run in Python3.x. Python String Replacement with %s *Replace […]

SPSS Python String Tutorial

The most important Python object we’ll deal with are strings. This tutorial presents a quick overview of Python string methods. However, let’s first learn some very basics. Python Strings – Basic Rules Strings may be enclosed by single or double quotes if they don’t contain any line breaks; Strings may always be enclosed by 3 single […]

Python – The 5 Things You Want to Know

SPSS users who want to speed up their work by using Python will encounter some surprises. This tutorial walks you through the 5 major pitfalls and shows how to avoid them. 1. Python is Fully Case Sensitive SPSS is mostly case insensitive; if we have a variable “gender”, we can address it in syntax as gender or GENDER or anything in between. […]

SPSS with Python IV – How to Use It?

So how does Python for SPSS actually work? First off, a distinction is often made between SPSS Python programmability and SPSS Python scripting. They work similarly in that some Python code is included in SPSS syntax; SPSS passes this Python code on to Python; Python may then look up information in SPSS such as variable names in the dataset or tables in the output window; […]

SPSS with Python III – How Does It Work?

So how does Python for SPSS actually work? First off, a distinction is often made between SPSS Python programmability and SPSS Python scripting. They work similarly in that some Python code is included in SPSS syntax; SPSS passes this Python code on to Python; Python may then look up information in SPSS such as variable names in the dataset or tables in the output window; […]

SPSS with Python I – What is It?

Python is among the most important programming languages today and can be used in SPSS. Doing so may truly decimate the time and effort you need to get things done. This tutorial briefly explains what Python is, how it relates to SPSS and why you might want to start using it. What is Python? Python is among the most important […]

SPSS with Python II – Installing and Testing

We think SPSS with Python is great! However, you need to have the SPSS Python Essentials properly installed in order to use it. This tutorial gives a quick overview of installing and then testing them for different SPSS versions. SPSS Python Essentials The basic components you need for running Python in SPSS are SPSS; Python; the SPSS Python plugin. […]