Distinct value
A distinct value is a value different from others in a collection, counted once regardless of how many times it occurs.
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().
Related concepts
- setaddressed by · A set is a collection of unique elements in which membership is determined by whether an element is present, not by duplicate occurrences.
- data frameused by · A data frame is a two-dimensional tabular data structure with labeled rows and columns that can contain values of different types.
- NumPyused by · NumPy is an open-source Python library for numerical computing that provides multidimensional arrays and operations on them.
- scopeconfigured by · Scope is a defined boundary specifying which entities, activities, resources, or conditions are included or governed in a particular context.
- comprehensionproduced by · A comprehension is a language construct that creates a collection by iterating over one or more sources, optionally filtering elements and transforming them.
- dropdownused by · A dropdown is a user-interface control that presents a set of choices for user selection, often revealing them when activated.
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.


