Learning Python Generators

Learning Python Generators

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 0h 37m | 102 MB

Generators are a concept unique to Python. They’re incredibly helpful if you know how and when to use them. Simply put, generators are possibly the best way to iterate through large and complex data sets. In this course, Megan Amendola covers the basics you need to know about Python generators, starting from what they are, how to create them, what they’re for, and ways to use them. Megan teaches you the benefit of using Python generators to improve your program’s performance and save memory when working with large data sets using generator functions. She also covers what Python’s yield keyword is and what it does, how to create a generator expression, how to combine multiple generators into a pipeline, and more. Megan also provides challenges and solutions as you go along so you can test your knowledge as you learn.

Table of Contents

Introduction
1 About the Python generators
2 Previous knowledge
3 Project files

Understanding Generator Functions
4 What are Python generators
5 Generator functions
6 Interacting with the generator object
7 Generators and memory
8 Challenge Squaring numbers
9 Solution Squaring numbers

Generator Expressions
10 Reviewing Python comprehensions
11 Generator expressions
12 Working with expressions
13 Comprehensions vs. expressions
14 Challenge Most words
15 Solution Most words

Generator Pipelines
16 What is a pipeline
17 Challenge Counting characters
18 Solution Counting characters

Practice Python Generators
19 Challenge Weather data
20 Solution Weather data

Conclusion
21 Next steps

Homepage