liveBook · Manning

Set difference

Set difference is the set of elements that belong to one set but not to another.

How 2 Manning books explain it

Build Python Web Apps with Streamlit

A delta is the difference between a metric's value in a main period and its value in a comparison period.

How it is used
Compares dashboard metrics across main and comparison date ranges to show change alongside the current value.
How deep it goes
Explains separate filtering, percentage calculation, formatting, and display, while stopping short of broader statistical interpretation.
Examples
Uses August and July sales, filtered dataframes, percentage formatting, and a metric bar as concrete examples.
What you can do after
Build it from scratch by calculating and formatting percentage deltas for Streamlit metric bars.

Read how Build Python Web Apps with Streamlit explains set difference →

Secrets of the JavaScript Ninja, Second Edition

The set of elements in one set that are not in another set.

How it is used
Filters a collection to retain elements absent from another set.
How deep it goes
Defines the operation and demonstrates it with JavaScript, without developing a formal treatment.
Examples
Demonstrates filtering ninjas to exclude those who are also samurai.
What you can do after
Apply set difference with JavaScript Set, spread, filter, and has.

Read how Secrets of the JavaScript Ninja, Second Edition explains set difference →

Also covered in

What to know first

Related concepts

Questions about set difference

What is set difference?

Set difference is the set of elements that belong to one set but not to another.

Which Manning books explain set difference?

Build Python Web Apps with Streamlit and Secrets of the JavaScript Ninja, Second Edition.

What should I know before learning set difference?

Manning books that teach set difference usually introduce for...of, data frame, set and spread operator first.

What is the difference between set difference and set intersection?

Set difference is the set of elements that belong to one set but not to another. Set intersection is the set of elements that belong to every one of two or more sets.

What is set difference a kind of?

Set difference is a kind of set operation. A set operation combines, compares, or transforms sets according to the membership of their elements.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.