Skip to Content
Data Wrangling with Python
book

Data Wrangling with Python

by Dr. Tirthajyoti Sarkar, Shubhadeep Roychowdhury
February 2019
Beginner to intermediate
452 pages
7h 6m
English
Packt Publishing
Content preview from Data Wrangling with Python

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.

Solution of Activity 1: Handling Lists

These are the steps to complete this activity:

  1. Import the random library:

    import random

  2. Set the maximum number of random numbers:

    LIMIT = 100

  3. Use the randint function from the random library to create 100 random numbers. Tip: try getting a list with the least number of duplicates:

    random_number_list = [random.randint(0, LIMIT) for x in range(0, LIMIT)]

  4. Print random_number_list:

    random_number_list

    The sample output is as follows:

    Figure 1.16: Section of output for random_number_list
  5. Create ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Wrangling with Python

Data Wrangling with Python

Jacqueline Kazil, Katharine Jarmul
Python: End-to-end Data Analysis

Python: End-to-end Data Analysis

Phuong Vothihong, Martin Czygan, Ivan Idris, Magnus Vilhelm Persson, Luiz Felipe Martins

Publisher Resources

ISBN: 9781789800111Supplemental Content