Welcome

Welcome to this introductory course on how to use Python for data analysis. We will only cover the basics and your skills will slowly build throughout the term.

Prior to today’s session you should have checked the Instructions and successfully installed Jupyter Notebook via Anaconda.

You should know how to

  1. Create a Jupyter Notebook file
  2. Run a code cell

Have a new JN ready to follow through the live coding in this session.

Data

Types of data objects

There are 3 simply types of data in Python:

  1. Numerical. Can be either integers (int , e.g. 52, 3, -7) or floats (float , e.g. 3.7592 or -0.00001)
  2. String. Text (str), which is always written in between ‘’ or “”, for instance "United Kingdom" or 'London' . The difference between the two is that "" allows for special characters outside the standard English alphabet such as ñ or ç .
  3. Object. This is when there is a mixture of string and numerical in that variable.

Changing data types

Just use the function of the data type you want to change the variable to: int() , str() , and float()