You are here

Use Python to build student confidence

Research Methods at SAGE

Using Python by Kaefer

Build student confidence and understanding of statistical calculations, text mining, data visualization, and more with Python

Information programming professors and authors Frederick Kaefer and Paul Kaefer highlight how open-source programming languages like Python can save your students the expense of buying proprietary languages

Why instructors and students may prefer Python

Students may prefer Python because they can freely download it and use it on several different devices (i.e., on both a desktop Windows-based computer and on a Mac laptop). For learning purposes, Python is a great first language since it was specifically designed to be easier to read. Furthermore, Python is useful both within and alongside other software tools, so learning Python first provides additional benefits when learning any of the other three. 

Instructors may prefer Python because, like R, it is an open source programming language, and will save students the expense incurred when using proprietary software packages such as SPSS and SAS.  After teaching the basics of Python programming (basic elements, data types, and control logic), instructors can focus on using Python packages such as the Pandas package for working with data, reading and writing to files, and the Python BeautifulSoup and sodapy packages for obtaining data from the Web.  Instructors can further teach how to use the Python SciPy and statsmodels packages for statistical calculations and modeling using Python, the matplotlib and seaborn packages for data visualization, and the scikit-learn and the nltk packages for machine learning and text mining.  Our book, Introduction to Python Programming for Business and Social Science Applications, has many examples designed to build confidence and understanding. Following each topic are “Stop, Code, and Understand” exercises in which an example is presented that requires a line of Python code to be added or modified. We provide the solutions to each exercise on the book companion website and comments for each solution are listed in an appendix at the end of the book

Learn how to use multiple tools

Other, more established statistical packages such as IBM® SPSS® (Statistical Package for the Social Sciences) and SAS® (Statistical Analysis System) recognize the value of Python programming. To illustrate this point, the Scripting Facility for IBM® SPSS® Statistics provides the ability to create Python scripts that operate on the IBM SPSS Statistics user interface. In addition, starting with the May 2019 release of SAS 9.4M6, the PROC FCMP procedure added support for submitting and executing functions written in Python from within an SAS session using the new Python object.

Another popular open source programming language is R. Note that Python can be used with R, as well (and R can be used within Python). People may ask “which of these leading four tools for statistical analysis (Python, R, SAS, or SPSS) is the one that I should learn?” The fact is that each tool has loyal followers and substantial support for users, so the best advice is to learn how to use multiple tools. 

Don’t miss Introduction to Python Programming for Business and Social Science Applications by Frederick Kaefer and Paul Kaefer, featuring practical examples and exercises designed to build student confidence and understanding:

 
Research Methods, Statistics & Evaluation
Stay Connected
Share with your students! Tips for learning online
SAGE_Methods Twitter Block