Python Data Structures: Sets and Frozen Sets
2h 7mIntermediate2024-11-27
Authors

Mridu Bhatnagar
Software Engineer
Course details
In this course, instructor Mridu Bhatnagar takes you through the basics of using Python sets and frozen sets. If you’re in the early stages of your Python programming career, or if you just need a refresher, join Mridu as she discusses the basic mechanics and functions of these data structures. Mridu gives a high-level overview of sets and frozen sets and then dives into the various methods to work with them. She discusses use cases and topics like how to modify a set and use built-in functions. Mridu also provides challenge and solution videos to test your knowledge as you go along. If you’re looking to learn important aspects about sets and frozen sets in Python, without jumping into a long project-based course, Mridu’s course is for you.
Skills covered
Data EngineeringPythonProgramming LanguagesData ScienceOpen SourceSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - Why use sets and frozen sets
- 02 - What you should know
- 03 - How to use CoderPad
1. Introduction to Sets
- 04 - Introduction to sets
- 05 - Defining a set and common pitfalls while initializing a set
- 06 - Immutable and mutable
- 07 - Hashable and iterable
- 08 - Solution - Remove multiple occurrence
2. Set Operations
- 09 - Set membership
- 10 - Iterating through a set
- 11 - Set comprehension
- 12 - Solution - Student course registration
3. Operators and Methods
- 13 - Understand set theory with an example
- 14 - Find all the elements present in different sets
- 15 - Find the common elements present between the sets
- 16 - Determine the difference between two sets
- 17 - Determine the symmetric difference between two sets
- 18 - Determine whether two sets have any common elements
- 19 - Determine whether one set is a subset of another
- 20 - Determine whether one set is a superset of another
- 21 - Solution - List unregistered students
4. Modifying a Set
- 22 - Add an element to a set
- 23 - Add multiple elements with the update() method
- 24 - Remove an element from a set
- 25 - Remove an element from a set using discard()
- 26 - Using pop() to remove and return an element from a set
- 27 - Clearing all elements from a set
- 28 - Solution - Filter by the first character
5. Using Built-In Functions
- 29 - Using length to find the number of items in a set
- 30 - Find the largest element in the set
- 31 - Find the smallest element in the set
- 32 - Sort all the elements in the set
- 33 - Find the sum of all elements in a set
- 34 - Solution - Most popular course
6. Frozen Sets
- 35 - Introduction to frozen sets
- 36 - Why frozen sets
- 37 - Creating frozen sets
- 38 - Solution - Composite key search
7. Sets and Frozen Sets Internals
- 39 - What is a hash table
- 40 - Finding the Index in the hash table
- 41 - How do sets work under the hood
8. Pros and Cons
- 42 - Sets vs. other Python data structures
9. Application Ideas
- 43 - Solution - Invoice value computation
Conclusion
- 44 - Next steps
Related courses
- Big Data in the Age of AI
- Complete Guide to Analytics Engineering
- Advanced Analytics Engineering: Real-World Practice
- Complete Guide to Google BigQuery for Data and ML Engineers
- PySpark Essential Training: Introduction to Building Data Pipelines
- Cleaning Data for Effective Data Science: Data Ingestion, Anomaly Detection, Value Imputation, and Feature Engineering
- Scala Essential Training for Data Science
- SPSS: Wrangling, Visualizing, and Modeling Data