liveBook · Manning

Distinct value

A distinct value is a value different from others in a collection, counted once regardless of how many times it occurs.

How 3 Manning books explain it

Starting Data Analytics with Generative AI and Python

A unique value is a distinct value occurring in a field or variable, counted once regardless of its frequency.

How it is used
Checks how many different identifiers or categorical values occur before cleaning data or interpreting a business count.
How deep it goes
Demonstrates pandas counts and grouped identifier checks, but does not establish whether the identifiers denote different real-world customers.
Examples
Uses customer identifier columns and a grouped count; contrasts them with repeated customer reviews that could distort analysis.
What you can do after
Apply it via pandas `nunique()`, `value_counts()`, and `groupby()` to inspect distinct identifiers and repeated values.

Read how Starting Data Analytics with Generative AI and Python explains distinct value →

The Well-Grounded Rubyist, Fourth Edition

uniq is a Ruby Array method that returns a new array with duplicate elements removed according to equality comparison.

How it is used
Transforms an array into a new array with duplicate elements removed.
How deep it goes
Defines duplicates through pairwise == tests and notes uniq! as the in-place counterpart.
Examples
Demonstrates removing repeated integers from an array, yielding [1, 2, 3, 4, 5].
What you can do after
Apply Array#uniq to return a deduplicated array, or use uniq! to remove duplicates from the original.

Read how The Well-Grounded Rubyist, Fourth Edition explains distinct value →

Statistics Slam Dunk

The unique() function in R returns the distinct elements, rows, or combinations of values in an object.

How it is used
Removes duplicate rows during NBA data wrangling before filtering and further analysis.
How deep it goes
Explains why rows duplicate, applies unique(), and verifies dimensions, but does not detail the function’s internal algorithm.
Examples
Uses NBAboxscores records duplicated by officials and checks reduction from 44,284 rows to 14,758.
What you can do after
Apply unique() to remove duplicate records and verify the cleaned data’s dimensions with dim().

Read how Statistics Slam Dunk explains distinct value →

Related concepts

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.