TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

A Guide to Python Itertools Like No Other

Zeya LT
8 min readAug 10, 2022

--

Photo by Elena Rouame on Unsplash

Table of Contents

  1. Introduction
  2. itertools.product()
  3. itertools.permutations()
  4. itertools.combinations()
  5. itertools.combinations_with_replacement()
  6. itertools.count()
  7. itertools.cycle()
  8. itertools.repeat()
  9. itertools.accumulate()
  10. itertools.chain()
  11. itertools.compress()
  12. itertools.dropwhile()
  13. itertools.takewhile()
  14. itertools.filterfalse()
  15. itertools.starmap()
  16. itertools.tee()
  17. itertools.zip_longest()
  18. itertools.pairwise()
  19. itertools.groupby()
  20. itertools.islice()
  21. Conclusion

Introduction

itertools is a built-in module in Python for handling iterables. It provides a number of fast, memory-efficient way of…

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Zeya LT
Zeya LT

Written by Zeya LT

Data Scientist @ Grab • Former Police Officer • Master’s in Data Science & Analytics • Mid-Career Switcher • Father of Two

Responses (2)