Skip to Content
Mastering Large Datasets with Python
book

Mastering Large Datasets with Python

by John Wolohan
January 2020
Intermediate to advanced content levelIntermediate to advanced
312 pages
10h 22m
English
Manning Publications
Content preview from Mastering Large Datasets with Python

Chapter 5. Accumulation operations with reduce

This chapter covers

  • Recognizing the reduce pattern for N-to-X data transformations
  • Writing helper functions for reductions
  • Writing lambda functions for simple reductions
  • Using reduce to summarize data

In chapter 2, we learned about the first part of the map and reduce style of programming: map. In this chapter, we introduce the second part: reduce. As we noted in chapter 2, map performs N-to-N transformations. That is, if we have a situation where we want to take a sequence and get a same-sized sequence back, map is our go-to function. Among the examples of this that we’ve reviewed are file processing (we have a list of files and we want to do something to all of them; discussed in chapter ...

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 Analytics with Spark Using Python, First edition

Data Analytics with Spark Using Python, First edition

Jeffrey Aven

Publisher Resources

ISBN: 9781617296239Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link