3. Intro to Programming in Python

This textbook will use the Python programming language, specifically Python 3.7. Even more specifically, Python that is run inside of a Jupyter Notebook. From the Jupyter Website:

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.

If you are familiar with programming in Python or another language, you’re probably used to writing all of your code in an Integrated Development Environment (IDE) in a single file, and your code is run all at once. In a Jupyter Notebook, you can break your code into small chunks that can run independently of each other and provide comments and context between each block of code. It provides for a great medium to document and share your work, and is an extremely popular tool for scientists and data analysts.

3.1. Loading Your Notebook Environment

NCSSM provides a cloud-hosting Jupyter Notebook environment for it’s faculty and students which they access at datahub.ncssm.edu and log in using their NCSSM login credentials. The benefit provided by a cloud hosted solution is that you do not need to install anything on your computer, and you can access your notebooks from any device that has an internet connection. The downside is that you have less control over the specific details of how your notebooks can be configured. For beginning users this is an ideal way to approach programming in Python, as you can just jump right in without having to worry about the technical aspects of managing a Jupyter environment on your own computer. If you are enrolled in MA/CS 358: Cryptography at NCSSM, you must use your DataHub account for your coursework.

Anyone is able to download and run Jupyter notebooks for free on their local computer. This is easily done through the Anaconda Distribution which will install the Jupyter Notebook Environment, as well as many of the common add-on packages used in Data Science. The benefit of running Jupyter Notebooks on your own computer is that it will work even without an internet connection, and you don’t need to worry about the cloud-hosted solution going down for maintenance. The drawbacks to installing on your own computer is that you need to have a little bit of technical savvy to understand how to install and maintain Jupyter.

Once Anaconda is installed you can open Jupyter by running the Anaconda Navigator and clicking on the Jupyter icon.