This section is included to assist the students to perform the activities in the book. It includes detailed steps that are to be performed by the students to achieve the objectives of the activities.

Chapter 1: Data Preparation and Cleaning

Activity 1: Addressing Data Spilling

  1. Import pandas and copy into the console, as follows:

    import pandas as pd

    import copy

  2. Use the read_excel function to read the xlsx file and the head function to look at the first few rows:

    sales = pd.read_excel("sales.xlsx")


  3. Look at the data types of sales and see if they make more sense:


    You should get the following output:

    Figure 1.57: Looking at the datatype of sales.xlsx
    Figure ...

Get Data Science for Marketing Analytics now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.