← Data Structures

Sets

Imagine you’re sorting through a patient’s medical notes.

You have copies of notes from three previous doctors. All have unique information, but there’s lots of overlap, too.

You want to create a new file, with all the unique pieces of information, but no repeats.

This is where sets come in.

There are three important things you need to know about sets:

1) Every item is unique

2) Items are unordered – there are no indexes or keys

3) We can use “membership tests” to see if a certain piece of data is in a set

That’s all we need to understand for now.

Finally, we can get to what you came for: the fundamentals of machine learning/AI.