O'Reilly logo

Data Science for Marketing Analytics by Pranshu Bhatnagar, Debasish Behera, Tommy Blanchard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix

About

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")

    sales.head()

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

    sales.dtypes

    You should get the following output:

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required