Skip to Content
Modern Python Standard Library Cookbook
book

Modern Python Standard Library Cookbook

by Alessandro Molina
August 2018
Intermediate to advanced
366 pages
10h 14m
English
Packt Publishing
Content preview from Modern Python Standard Library Cookbook

Algorithms

In this chapter, we will cover the following recipes:

  • Searching, sorting, filtering—high-performance searching in sorted containers
  • Getting the nth element of any iterable—grabbing the nth element of any iterable, generators too
  • Grouping similar items—splitting an iterable into groups of similar items
  • Zipping—merging together data from multiple iterables into a single iterable
  • Flattening a list of lists—converting a list of lists into a flat list
  • Producing permutations and—computing all possible permutations of a set of elements
  • Accumulating and reducing—applying binary functions to iterables
  • Memoizing—speeding up computation by caching functions
  • Operators to functions—how to keep references to callables for a Python operator ...
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

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Matthew Wilkes

Publisher Resources

ISBN: 9781788830829Supplemental Content