Part 1: From SPSS to Python
Setting-Up
The main purpose of using this guide is to help you learn how to use Python, do multiple different tests with datasets and then how to display these datasets. By following this guide, my hope is by the end you are a Python data analysis expert and can use these new skills in the workforce.
This guide is aimed at people coming from SPSS to Python but if you are new to Python this guide will work for you as well. This is done through Windows 10 so different installation might be required on Mac.
Getting Started
Install Python
The first step is to download Python. Just follow the link and install. Make sure to get the latest version. In writing this article we are on Python 3.9.1.
Understanding Command Prompt
Before we begin with downloading these packages, if you are completely new to programming, you’ve probably never touched the Command Prompt. If you are already familiar, feel free to move onto the Installing and Understanding the Packages section.
You can find Command Prompt by typing into your Start search “Command Prompt”.

The command prompt will be used to installing packages and opening your python files.
What you will want to do next is to navigate to your chosen folder. To find directories in the command prompt you need to use the command cd:
cd is just the change directories command, so if you load Command Prompt and it starts at:
C:\Users\username>
and you want to go to a specific directory let’s say desktop which is located at C:\Users\username\Desktop>.
You just have to type in :
C:\Users\username>cd desktop
And it should change to C:\Users\username\Desktop>
When it comes to changing drives, let’s say we are in C: currently and want to go to E: just type in E:
C:\Users\username>e:
E:\>
Find your directory name is simple. Open up File Manager and head to where your files are kept. For most of mine, I keep them in my documents which are located on my E: drive.

From there is you click on the “This PC > Documents >Tutorials for Medium” it will select all and show you the location of your directory in terms that the command prompt understand. Then you can simply Ctrl +C to copy and paste it with cd to use for command prompt.

Installing and Understanding the Python Packages
Installing the Coding Environment
The first package I would recommend installing is the web coding environment Jupyter Notebook. This will allow you to code, run it, visualise it and all without leaving the environment. I personally like being able to do my code in little increments and being able to dissect errors from smaller batches of code.
pip is installed with Python and is your package installer and package management system. Most commands to do with installing packages should start with:
pip install {name of package}
To install this all you need to do is open your Command Prompt and write:
>pip install notebook
To install packages you need to make sure pip is updated. Since you should’ve installed the newest version of Python, this shouldn’t present a problem. However, if you need to update python simple open command prompt and input:
py -m pip install -U pip
Before using the command prompt again, make sure the install is finished. It should run through a few lines of code before returning to:
C:\Users\'user name'>
Installing the Data Analysis Packages
Once installed we will be importing a bunch of packages to use Python for your specific needs.
Data Analysis Packages
NumPy is mainly used to build arrays and matrices as well as having a bunch of functions necessary for data analysis. It’s the base for the other data analysis packages.
pip install numpy
Pandas allows for forming data frames, merging data, cleaning data. It’s also what will allow you to import excel, CSV, JSON and SQL file formats
pip install pandas
SciPy using NumPy array data structure and allows for numerical computing in Python
pip install scipy
SciKit-Learn allows for predictive data analysis, classification, regression, dimension reduction and much more.
pip install -U scikit-learn
Statistics is where you will find most of your mathematic functions such as mean, standard deviation and variance.
pip install statistics
Data Visualisation Tools
MatPlotLib is the base for creating any form of bar chart, linear regression and general visualization you need
pip install matplotlib
seaborn builds from MatPlotLib and allows for nicer visualisation and some of the more complex plots like heatmaps.
pip install seaborn
openpyxl is just for being able to write excel files. Not the most useful to some but I find it easier as it allows me to put multiple datasets into one sheet.
pip install openpyxl
Once this is all done, you should be able to start coding. The next section will run you through the basics of the Jupyter Notebook environment.
Creating Your First Python File in Jupyter
and closing it properly
Opening up a new notebook
So now everything should be installed on your computer and should be the latest version. You are probably wondering, how do I open and start a new project?
- Through file manager create a new folder on your PC and name it whatever you.
Inside this folder, create another folder called “data”. This is where you should store any of your starting CSV and excel files.
- Place any/all files you will be using in the data folder
- I personally like to make an output folder as well, just to store any images, new CSV files that I make.
- Your folder should look like this:

6. In Command Prompt depending on where you put this folder, you will need to go to it. At the top of File Manager, you can get the exact location of your folder by double-clicking the search bar. Mine is:
E:\’user name’\Documents\Tutorials for MediumType
Because mine is in a different hard drive I first need to change over to that hard drive. If you are already on the correct hard drive, this step isn’t necessary. This is done by just typing in the drive name like so:
C:\Users\'user name'>E:
It should become:
E:\>
Then just simply type “cd E:\’username’\Documents\Tutorials for Medium”:
E:\>cd E:\’user name’\Documents\Tutorials for Medium
This should you lead you into the file in command prompt like this:
E:\'user name'\Documents\Tutorials for Medium>
Now all you need to do is type ‘jupyter notebook’ into the command prompt:
E:\'user name'\Documents\Tutorials for Medium>jupyter notebook
This should immediately open up jupyter home page in your preferred web browser. DO NOT CLOSE COMMAND PROMPT, you will need this to properly close your python files.

To create a python file simple click “New” and select a Python 3 file format. Make sure to name it and you are ready to go!


Saving and Closing Your Notebook
While Jupyter will save your notebook, make sure to manual save as well by clicking the Save Icon.
To close down the terminal, make sure everything you worked on is saved and go back to Command Prompt and press Ctrl + C. Wait until the terminal says:
[I 13:20:18.631 NotebookApp] Kernel shutdown: bb127fb0-eaaf-4d6d-ae1c-1c6d44aaa551E:\'username'\Documents\Tutorials for Medium>
Now you can zip it up, cloud save it or whatever you need to do.
Follow on for Part 2
Congratulations! If this is your first time programming and you made it through all this it’s a triumph. I will be trying to upload tutorials on how to run different tests and transferring skills from SPSS to Python so stay tuned for more.