Start Coding Now: Python for Data Science

Image for post
Image for post

When I first started on my coding journey, I wasn’t quite sure where to begin and I was quickly overwhelmed by the vast amount of resources and information available through a quick Google or YouTube search. This past week, I was helping a friend getting started with coding and it inspired me to make this tutorial. So if you are looking for a resource to begin coding in Python, you came to the right place. As a disclaimer, I will be using Windows for this walkthrough so if you are not using Windows, this tutorial might not as easy to follow.

This guide will be using software that is catered towards Data Science, however, whether or not that is your focus, I am going to help you set up an easy-to-use and intuitive environment (called an IDE) in which you can code in Python, regardless of future aspirations. An IDE (or Integrated Development Environment) is a program that is dedicated to software development. In laymen’s terms, an IDE is an environment where you type your code, run your code, and save your code (think of it like Microsoft Word to a Word Document). Additionally, good IDEs will provide you with tools to debug your code, highlight any issues in errors and allow you to quickly recall saved variables.

The software we will be using to code is the Jupyter Notebook from Project Jupyter. We are going to download this through a package called Anaconda. The package contains a bunch of good Data Science-y things in addition to Jupyter Notebook and Python. Here is the link provided below:

Once you’ve downloaded the installer, before hammering through all the recommended settings when going through the installer, let me bring your attention to one feature you want to be sure to check:

Image for post
Image for post
Make sure to check the top box “Add Anaconda 3 to my PATH environment variable”. I know it says that it is not recommended but it will make your life easier in the long run as you get more familiar with coding. Other than this, you can just select the recommended settings of the installer to proceed to installation.

Once you’ve finished installation, the goal is to launch the Anaconda Navigator. This can be easily found from the Windows start menu:

Image for post
Image for post

Launching the application will open up a window as shown below. From this menu, you can select the Launch button for the Jupyter Notebook:

Image for post
Image for post

Once you launch the notebook, it should open a window using your browser. To open a new notebook where your coding will be done, select the “New” markdown and then select Python 3 as shown in the image below:

Image for post
Image for post

This will create a new notebook file in which you can start playing around to learn how to code.

Image for post
Image for post
This image is showing what is called a “code snippet”

As shown above, the print(“Hello World!”) is written in a cell. You can follow along by typing this into the first cell and then hitting Shift+Enter or the Run button to run the code in that specific cell. When you run a cell and have no other cells, a new cell will automatically populate below the cell you ran. You can also press the ‘+’ button to add new cells as circled in red below:

Image for post
Image for post

The Jupyter Notebook will autosave your work every so often but you can save your work using the floppy disk icon located next to the ‘+’ shown above. Whenever you are done coding, make sure to save your work and you can close the according web browsers.

When you want to access your notebooks again, reopen Jupyter Notebook from the Anaconda Navigator and locate your file. Simply click the file to open it.

There you have it, you are now ready to begin coding in Python. Don’t be afraid to mess around and have fun learning Python!

To continue the journey, be sure to check out my next post which teaches the very basics to writing code in Python 3:

https://medium.com/@johnkundycki/how-to-python-the-basics-40d7cf4729e9

Written by

Data Scientist | Health Enthusiast | Learner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store