Appendix

1. The Importance of Data Visualization and Data Exploration

Activity 1.01: Using NumPy to Compute the Mean, Median, Variance, and Standard Deviation of a Dataset

Solution:

  1. Import NumPy:

    import numpy as np

  2. Load the normal_distribution.csv dataset by using the genfromtxt method from NumPy:

    dataset = np.genfromtxt('../../Datasets/normal_distribution.csv', \

                            delimiter=',')

  3. First, print a subset of the first two rows of the dataset:

    dataset[0:2]

    The output of the preceding code is as follows:

    Figure 1.57: First two rows of the dataset

    Figure 1.57: First two rows of the dataset

  4. Load the dataset and calculate the mean of the third row. Access the third row by using ...

Get The Data Visualization Workshop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.