Introduction to R
What is Python? Why Python?
Python is a general purpose programming language that currently becoming the preferred language for the world of data analytics with it’s wide range of libraries and integration with big data frameworks. Comparable to R, Python can be used to analyses massive amount of data and create production ready data model for real time prediction and recommendation for many aspects of a business, such as human resources, finance, inventory management and many more. With it’s simple-to-read coding style, it is the preferred choice for non CS students to learn advanced business analytics.
Installing Python
Step 1: Go to https://www.python.org/downloads/release/python-365/ (this might change depending on versions)
Step 2: Scroll down and download Windows x86-64 executable installer for Windows and mac OS 64-bit installer for Mac users as boxed up in red.
Step 3: Run the file and install Python on default settings and you are good to go!
P.S For Window Users, remember to check the box “Add Python 3.7 to PATH” This allows you to send python commands through your command prompt for installation of other libraries
User Interface
Step 1: Go to Finder / Window Search and search for “IDLE”, and a corresponding program (IDLE Python 3.6 ..) program should appear. IDLE stands for Integrated Development Environment (but you can also imagine it to be a program which you run and let yourselves idle)
This is called the complier, which allows you to interact with the backend of the Python interface. You can type things like 2+2 and it will return 4, or type print(“Hello World!”) and it will print literally Hello World! It will be troublesome to type commands line by line. Hence, we will instead, write a set of instructions on a text file where Python can read from and perform all the commands inside that text file, which we call a script.
To create a script, we will go to File on the top left-hand corner and click on “New File” or press Ctrl + N. We will now have an open window where you can type Python code with highlighted colors to show valid code. For your first program, you can try typing in these commands show below and press F5, or go to “Run” and click on run this module.
After running your script, you can go back to the complier to see the results of your script!
Next: Python Tutorial 2 Data Types – Integers, Strings, Floats, Boolean