Skip to Main Content
The Data Wrangling Workshop - Second Edition
book

The Data Wrangling Workshop - Second Edition

by Brian Lipp, Shubhadeep Roychowdhury, Dr. Tirthajyoti Sarkar, John Wesley Doyle, Harshil Jain, Robert Thas John, Akshay Khare, Nagendra Nagaraj, Samik Sen, Dr. Vlad Sebastian Ionescu
July 2020
Beginner to intermediate content levelBeginner to intermediate
576 pages
9h 12m
English
Packt Publishing
Content preview from The Data Wrangling Workshop - Second Edition

Appendix

1. Introduction to Data Wrangling with Python

Activity 1.01: Handling Lists

Solution:

These are the steps to complete this activity:

  1. Import the random library:

    import random

  2. Use the randint method from the random library to create 100 random numbers:

    random_number_list = [random.randint(0, 100) \

                          for x in range(0, 100)]

  3. Print random_number_list:

    random_number_list

    The sample output is as follows:

    Figure 1.20: Section of output for random_number_list

    Figure 1.20: Section of output for random_number_list

    Note

    The output is susceptible to change since we are generating random numbers.

  4. Create a list_with_divisible_by_3 list from random_number_list, which will contain only numbers ...
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

The Data Analysis Workshop

The Data Analysis Workshop

Gururajan Govindan, Shubhangi Hora, Konstantin Palagachev, Brent Broadnax, John Wesley Doyle, Ashish Jain, Robert Thas John, Ravi Ranjan Prasad Karn, Pritesh Tiwari
The Data Visualization Workshop

The Data Visualization Workshop

Mario Döbler, Tim Großmann, Rohan Chikorde, Joshua Görner, Anshu Kumar, Piotr Malak, Ankit Verma
The Data Science Workshop - Second Edition

The Data Science Workshop - Second Edition

Anthony So, Thomas Joseph, Robert Thas John, Andrew Worsley, Dr. Samuel Asare
The Machine Learning Workshop - Second Edition

The Machine Learning Workshop - Second Edition

Hyatt Saleh, John Wesley Doyle, Akshat Gupta, Harshil Jain, Vikraman Karunanidhi, Subhojit Mukherjee, Madhav Pandya, Subhash Sundaravadivelu

Publisher Resources

ISBN: 9781839215001Supplemental Content