Preparing for the analysis of top incomes

For the following recipes, you will need Python installed on your computer and you will need the world's top incomes dataset. This recipe will help ensure you have set up everything you need to complete this analysis project.

Getting ready

To step through this recipe, you will need a computer with access to the Internet.

Make sure you have downloaded and installed Python and the necessary Python libraries to complete this project.

Tip

Refer to Chapter 1, Preparing Your Data Science Environment, to set up a Python development environment using virtualenv and install the required libraries for matplotlib and NumPy.

How to do it...

The following steps will guide you to download the world's top incomes dataset and install the necessary Python libraries to complete this project:

Note

The original dataset for the world's top incomes can be downloaded from http://topincomes.g-mond.parisschoolofeconomics.eu/. However, the site has been updated several times, which has changed the output format of the data (from .csv to .xlsx). This recipe assumes a .csv file format.

This chapter's repository contains the properly formatted version of the input data file.

  1. Save the world's top incomes dataset to a location on your computer where you will be able to find it.
  2. Open up a terminal window and start a Python interpreter.
  3. Check to make sure that the following three libraries, NumPy, matplotlib, and Jinja2, are installed; try to import each:
    >>> import numpy as np
    >>> import jinja2
    >>> import matplotlib as plt
  4. Each of the preceding libraries should import without a comment or remark from Python. If they do, you are good to go. If not, refer to Chapter 1, Preparing Your Data Science Environment, to set up your system.

How it works...

NumPy is the fundamental scientific computing library for Python; it is therefore essential to any data science toolkit, and we will leverage it in many places throughout the Python chapters. However, since NumPy is an external library that must be compiled for your system, we will discuss alternative native-Python approaches alongside the NumPy approach.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.253.62