Filtering
Filtering is the selection or exclusion of data or items according to specified criteria.
Statistics Slam Dunk
The filter() function is a dplyr function that returns rows of a tabular object satisfying specified logical conditions.
- How it is used
- Narrows NBA data to observations relevant to later comparisons, visualizations, tests, and models.
- How deep it goes
- Demonstrates equality, inequality, ranges, AND/OR logic, variable comparisons, and row-number conditions, while deferring broader query syntax.
- Examples
- Uses regulation games, home-road splits, top teams, tied halftime games, possessions, free throws, salaries, and win shares.
- What you can do after
- Apply it via dplyr filter() to retain or exclude rows using logical conditions and verify the resulting data dimensions.
API Design Patterns
Filtering is the selection of items that satisfy specified conditions before results are returned or processed.
- How it is used
- Improves standard list methods by selecting relevant resources before transmission, processing, export, or operational inspection.
- How deep it goes
- Explains request design, representation trade-offs, evaluation boundaries, errors, and supported functions, while excluding unrestricted cross-resource queries.
- Examples
- Uses ChatRoom title predicates, SQL and MongoDB equivalents, client-side pagination, operation metadata, and filtered exports.
- What you can do after
- Apply it via standard list and export requests to reduce transferred data and inspect targeted resource subsets.
Everyday Data Visualization
A filter is a rule or control that restricts a dataset or visualization to records or values satisfying specified criteria.
- How it is used
- Narrows interactive visualizations after an overview so users can focus exploration before requesting details.
- How deep it goes
- Explains linked selections, valid date choices, and recovery controls, but stops short of step-by-step implementation.
- Examples
- Uses family–genus–species menus, a bounded date picker, and a bar selection that filters multiple charts.
- What you can do after
- Operate/configure it by showing relevant filter values, bounding date choices, and providing undo and clear-all controls.
Functional Programming in JavaScript
A function exposed by Lodash as part of its utility API.
- How it is used
- Uses predicates to select data before subsequent transformations in functional JavaScript pipelines.
- How deep it goes
- Defines filtering, demonstrates predicates and chains, and shows a loop implementation without developing deeper algorithmic internals.
- Examples
- Demonstrates filtering valid people, selecting people born in 1903, and cleaning names through a Lodash chain.
- What you can do after
- Apply it via Lodash to replace manual selection loops with readable predicate-based data pipelines.
Read how Functional Programming in JavaScript explains filtering →
Spring Security in Action, Second Edition
Filtering is a method-security technique that restricts method input parameters or returned results according to authorization rules.
- How it is used
- Controls authorized method inputs and outputs when endpoint-level authorization cannot express the required value-level rules.
- How deep it goes
- Explains annotations, SpEL expressions, interception, mutability, examples, and query-level alternatives, but not broader authorization internals.
- Examples
- Demonstrates owner-filtered products, curl responses, mutable collections, and repository queries constrained by the authenticated username.
- What you can do after
- Apply it via @PreFilter and @PostFilter, or diagnose repository performance problems by moving filtering into database queries.
Read how Spring Security in Action, Second Edition explains filtering →
Learn SQL in a Month of Lunches
A filtering condition is a Boolean predicate that determines which rows satisfy a query's selection criteria.
- How it is used
- Narrows query results to rows matching requested values, ranges, patterns, or combinations of conditions.
- How deep it goes
- Explains WHERE-based equality and AND/OR combinations, then extends filtering to ranges, joins, variables, deletes, and views.
- Examples
- Uses title advances and royalties, author surnames, customer orders, title sales thresholds, and a filtered view.
- What you can do after
- Apply it via SQL WHERE clauses to select targeted rows and safely limit DELETE operations.
Read how Learn SQL in a Month of Lunches explains filtering →
The Design of Web APIs, Second Edition
Filtering is the technique of restricting an operation's results or processing to items that satisfy specified criteria.
- How it is used
- Restricts API list and search results to items matching consumer criteria.
- How deep it goes
- Works through parameter naming, multiple values, ranges, optionality, consistency, and sensitive inputs; leaves other design options open.
- Examples
- Uses product searches, transaction queries with dates and amount ranges, and account-holder searches with sensitive names.
- What you can do after
- Build it from scratch: choose useful filters, align them with returned data, and select safe, consistent request locations.
Read how The Design of Web APIs, Second Edition explains filtering →
Functional Programming in Scala, Second Edition
An Option filter retains a present value only when it satisfies a Boolean-valued predicate, otherwise producing None.
- How it is used
- Uses predicates to remove failing list elements or invalidate an optional value while preserving composable functional control flow.
- How deep it goes
- Defines filtering, demonstrates chained use, and derives Option.filter through flatMap; it stops short of broader implementation optimization.
- Examples
- Demonstrates removing odd integers and excluding the Accounting department from an optional employee lookup.
- What you can do after
- Apply it via List.filter and Option.filter to retain values satisfying Boolean predicates.
Read how Functional Programming in Scala, Second Edition explains filtering →
AI Recommender Systems
A recommendation-stage technique that removes candidate items that should not be shown because they violate eligibility, quality, or other constraints.
- How it is used
- Removes ineligible candidates between retrieval and scoring in a four-stage recommender.
- How deep it goes
- Implements a watched-item filter and its test, then identifies domain-dependent rules without implementing every rule.
- Examples
- Uses watched movies, out-of-stock products, age restrictions, and a 100-candidate movie-filter test.
- What you can do after
- Build it from scratch as a watched-item filter and diagnose rule failures with spot checks and automated tests.
Introduction to Generative AI, Second Edition
Content filtering is the computational screening, blocking, or removal of content according to specified safety or policy criteria.
- How it is used
- Uses filtering to reduce unsafe model generations and help protect agent inputs.
- How deep it goes
- Explains classifier-based pretraining screening and its trade-offs at a high level, without implementation details.
- Examples
- Illustrates filtering through the removal of toxic subreddits and web content that may include marginalized voices.
- What you can do after
- Evaluate filtering as a safety measure against its costs, classification errors, and potential effects on representation.
Read how Introduction to Generative AI, Second Edition explains filtering →
AI-Powered Search
Filtering is the retrieval operation that excludes items failing specified criteria without necessarily ordering the remaining items by relevance.
- How it is used
- Uses filtering to select search candidates and reduce noise in an autocomplete vocabulary.
- How deep it goes
- Explains filtering’s performance rationale and separates filtering from scoring with request parameters and a frequency threshold.
- Examples
- Uses children’s book filters and a frequency cutoff for an outdoors autocomplete vocabulary.
- What you can do after
- Operate/configure Solr requests to separate document filtering from relevance boosting.
Spring in Action, Sixth Edition
A reactive filter is a Project Reactor operator that emits only source elements satisfying a predicate.
- How it is used
- Selects reactive stream values by predicate and allows or blocks messages in integration flows.
- How deep it goes
- Explains predicate-based filtering with worked tests and integration configurations, without examining operator internals.
- Examples
- Demonstrates filtering park names without spaces and routing only even integers between channels.
- What you can do after
- Apply filtering with Project Reactor predicates or Spring Integration annotations and Java DSL configuration.
Read how Spring in Action, Sixth Edition explains filtering →
Kotlin in Action, 2E
- How it is used
- Selects collection elements matching a Boolean predicate, often before transformation in a functional pipeline.
- How deep it goes
- Defines filtering through examples and descends to a simple character-level implementation using iteration and result construction.
- Examples
- Uses even numbers, people older than 30, indexed numbers, lowercase characters, and unread nonblank messages.
- What you can do after
- Apply it via Kotlin standard-library functions to extract matching items and compose readable collection-processing pipelines.
100 C++ Mistakes and How to Avoid Them
Filtering is a data-processing operation that retains or rejects each input element according to a predicate.
- How it is used
- Uses predicates to select values within ranges pipelines or focused data-cleansing functions.
- How deep it goes
- Defines predicate-based retention, demonstrates composition, and addresses naming and responsibility but stops short of deeper implementation details.
- Examples
- Demonstrates even-value selection, absolute-value transformation, accumulation, and filtering positive or negative numbers.
- What you can do after
- Apply filtering through predicates, composable ranges pipelines, or clearly named functions for legacy data-cleaning code.
Read how 100 C++ Mistakes and How to Avoid Them explains filtering →
The Art of Code
Data filtering is the selection or removal of records according to specified validity, quality, or uniqueness criteria.
- How it is used
- Selects valid or relevant stream elements before later transformations such as mapping, sorting, deduplication, or limiting.
- How deep it goes
- Defines predicates, lazy intermediate operations, readability limits, method extraction, and staged pipelines without descending into implementation internals.
- Examples
- Uses recently published books, active users, signup dates, email domains, sanitization, sorting, distinct results, and result limits.
- What you can do after
- Apply it via stream pipelines by writing predicates, retaining matching elements, and composing subsequent transformations clearly.
Snowflake Data Engineering
Filtering is the selection of rows that satisfy specified conditions during query processing.
- How it is used
- Improves Snowflake query performance by restricting rows before joins, aggregation, sorting, and other complex operations.
- How deep it goes
- Explains early reduction, spilling effects, query-profile validation, and point-in-time validity predicates, but not filter execution internals.
- Examples
- Uses distance-limited bakery stores and validity intervals for current or August 1, 2023 product categories.
- What you can do after
- Apply it via Snowflake SQL to reduce processed rows, limit spilling, and select historically valid records.
Data-Oriented Programming: Reduce software complexity
A filter function returns the elements of a collection that satisfy a specified predicate.
- How it is used
- Uses predicates to select records during book-title search before transforming matching records into result data.
- How deep it goes
- Explains the predicate-driven loop and adapts filtering across arrays and maps, without descending into library implementation internals.
- Examples
- Demonstrates title matching with Watchmen, a custom filter implementation, and equivalent filtering in Immutable.js.
- What you can do after
- Apply it via Lodash or Immutable.js, or build it from scratch with a predicate-driven loop.
Read how Data-Oriented Programming: Reduce software complexity explains filtering →
.NET in Action, Second Edition
A filter operation removes a matching stack frame and all frames below it from a profiling stack trace.
- How it is used
- Focuses profiling investigations and narrows API collections to relevant results.
- How deep it goes
- Explains stack-frame removal and demonstrates predicate-based filtering alongside sorting and paging, without detailing LINQ execution internals.
- Examples
- Uses PerfView call-tree cleanup and an ASP.NET Core font endpoint filtering by name or text direction.
- What you can do after
- Apply filtering through PerfView stack operations or LINQ predicates in an ASP.NET Core collection endpoint.
Read how .NET in Action, Second Edition explains filtering →
Apache Kafka in Action
filter is a stream-processing function that retains only records for which a predicate returns true.
- How it is used
- Selects qualifying records while building real-time stream-processing workflows.
- How deep it goes
- Defines predicate-based selection and demonstrates price filtering, but stops short of implementation internals.
- Examples
- Uses product price changes, a greater-than-$100 predicate, price-range branches, and Kafka topic outputs.
- What you can do after
- Apply it via Kafka Streams to retain records matching a predicate and route selected data through a topology.
Tiny Python Projects: Learn coding and testing with puzzles and games
Filtering is the process of retaining items that satisfy specified selection criteria and removing the others.
- How it is used
- Removes unwanted characters, words, or records while building text-processing and password-generation programs.
- How deep it goes
- Explains predicates, truthiness, laziness, list() coercion, and equivalents using comprehensions, stopping short of implementation internals.
- Examples
- Demonstrates consonant extraction, blue-car selection, bounded word lengths, and ASCII-letter retention.
- What you can do after
- Apply it via Python’s filter() with predicates and iterables, then materialize results with list() when needed.
Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains filtering →
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
Filtering is the technique of selecting values or objects that satisfy specified criteria and excluding the rest.
- How it is used
- Narrows shell output to processes, files, or other objects that satisfy an administrator’s criteria.
- How deep it goes
- Explains early and pipeline filtering, comparisons, $_, property names, and source-side placement.
- Examples
- Uses process-name wildcards and WorkingSet comparisons, including combined CPU and memory conditions.
- What you can do after
- Apply it via PowerShell cmdlets and Where-Object to select matching objects and reduce downstream pipeline work.
Python Workout: 50 ten-minute exercises
Filtering is the technique of retaining elements that satisfy a condition while excluding others.
- How it is used
- Uses conditions to select data during list-comprehension transformations, predicate application, and input aggregation.
- How deep it goes
- Explains comprehension conditions and filter predicates, contrasting selection with map transformation without pursuing implementation internals.
- Examples
- Demonstrates even-number selection, long-word retention, phone-number updates, age limits, and invalid numeric-string exclusion.
- What you can do after
- Apply filtering through Python list comprehensions or filter, including selection before conversion and summation.
Read how Python Workout: 50 ten-minute exercises explains filtering →
Python How-To
Filtering is the technique of retaining only the items in a collection that satisfy a specified condition.
- How it is used
- Retains iterable items meeting a condition while building containers or processing task collections.
- How deep it goes
- Defines condition-based retention, demonstrates loops, comprehensions, and filter, and defers detailed lambda treatment.
- Examples
- Uses task records with urgency above 3, retaining the Homework and Museum tasks through loops, comprehensions, and filter.
- What you can do after
- Apply it via for loops, comprehensions, or filter to select items from iterables.
D3.js in Action, Third Edition
Data filtering is the technique of selecting only records that satisfy a specified categorical or value-based condition.
- How it is used
- Supports interactive visualization by letting users inspect selected portions of a dataset.
- How deep it goes
- Explains controls, conditional selection, bin recalculation, and rectangle updates, while deferring smooth transitions.
- Examples
- Uses a salary histogram with All, Women, and Men controls to demonstrate categorical filtering.
- What you can do after
- Apply it via D3 to update a histogram from a selected categorical subset.
Read how D3.js in Action, Third Edition explains filtering →
Kafka Streams in Action, Second Edition
filter is a Kafka Streams operation that retains records satisfying a predicate and emits deletion markers for records removed from a table result.
- How it is used
- Selectively processes Kafka Streams records before downstream transformations or table updates.
- How deep it goes
- Explains predicate placement, filterNot, and KTable tombstones, but stops short of detailed topology implementation.
- Examples
- Demonstrates retaining retailer purchases whose item totals exceed $10 before mapping reward values.
- What you can do after
- Apply it via Kafka Streams to drop nonmatching stream records and emit tombstones for filtered table results.
Read how Kafka Streams in Action, Second Edition explains filtering →
Python Workout, Second Edition
Filtering is a technique that selects elements satisfying a specified condition and excludes the others.
- How it is used
- Selects iterable elements that satisfy a condition, either directly with filter or alongside transformation in comprehensions.
- How deep it goes
- Explains predicate application and contrasts filtering with mapping, then extends the idea through multiple comprehension exercises.
- Examples
- Uses long-word selection, bounded integers, text-file lines, phone-number area codes, and age-enriched dictionaries.
- What you can do after
- Apply filtering with named predicates, filter, and list-comprehension conditions to solve selection exercises.
Read how Python Workout, Second Edition explains filtering →
Learn Rust in a Month of Lunches
Filtering is the iterator operation of retaining only items that satisfy a condition.
- How it is used
- Uses iterator closures to retain matching items or discard unusable values during collection.
- How deep it goes
- Defines filter(), chained conditions, filter_map(), and Result-to-Option conversion through focused examples.
- Examples
- Uses month selection, optional company CEOs, and numeric string parsing as concrete filtering examples.
- What you can do after
- Apply it via Rust's filter(), filter_map(), ok(), and collect() methods to build selected iterator results.
Read how Learn Rust in a Month of Lunches explains filtering →
Julia as a Second Language
Array filtering is an operation that selects or transforms array elements according to a criterion.
- How it is used
- Uses predicates to select relevant values from arrays and other collections before further data processing.
- How deep it goes
- Explains predicate-based selection, demonstrates built-in and custom predicates, and combines filtering with mapping, reduction, and sets.
- Examples
- Demonstrates even numbers, characters, pizza sales, and screw objects selected through single- and multi-criterion predicates.
- What you can do after
- Apply it via Julia's filter function to select matching values and feed them into mapping, reductions, or set operations.
Authorization in Action
A retrieval filter is a constraint applied to search or retrieval operations to limit returned resources to those satisfying specified conditions.
- How it is used
- Constrains retrieval in retrieval-augmented generation so authorization is enforced before data reaches the language model.
- How deep it goes
- Explains metadata filters and candidate authorization, while leaving database-specific query syntax and implementation details unspecified.
- Examples
- Uses tenant-scoped chunks and bounded top-10-or-50 candidate sets as concrete retrieval examples.
- What you can do after
- Apply it via Cedar typed partial evaluation or batch authorization to prevent unauthorized resources entering retrieval.
Build a Website with ChatGPT
Filtering is the operation of selecting and displaying only data records that satisfy a specified criterion.
- How it is used
- Uses drop-down controls to let course-catalog users display records matching selected data-field values.
- How deep it goes
- Explains unique-value lists, selection handling, and an all-record reset, while deferring advanced implementation details.
- Examples
- Demonstrates Department and Instructor drop-downs filtering course records from a JSON-backed catalog.
- What you can do after
- Build it from scratch by prompting for HTML, CSS, and JavaScript that filter JSON records through drop-down selections.
100 Java Mistakes and How to Avoid Them
- How it is used
- Uses Stream API predicates to retain elements while warning against side effects and null-sensitive pipelines.
- How deep it goes
- Explains lazy execution, predicate side effects, null handling, and safer alternatives through focused Java examples.
- Examples
- Uses null removal, side-effecting predicates, partitioningBy(), and trimmed strings limited after filtering.
- What you can do after
- Apply filtering via Java Stream API, remove nulls, partition matches, and test uncertain terminal behavior in JShell.
Read how 100 Java Mistakes and How to Avoid Them explains filtering →
Effective Data Analysis
A data-selection operation that restricts displayed or analyzed records according to specified criteria.
- How it is used
- Enables stakeholders to explore relevant report subsets independently through filters and parameters.
- How deep it goes
- Explains report inputs, dashboard selection, and placement, without detailing underlying filter implementation.
- Examples
- Uses subscription type, customer location, dashboard charts, and sales or social-media metrics as filtering contexts.
- What you can do after
- Build it from scratch by creating a dashboard with selected filters, visualizations, labels, instructions, and peer feedback.
The Well-Grounded Rubyist, Fourth Edition
Filtering is the technique of selecting elements from a collection that satisfy specified criteria.
- How it is used
- Applies selection criteria to enumerable collections and validates or normalizes values entering objects.
- How deep it goes
- Explains iterator blocks, result shapes, case equality, regular-expression matching, validation, and normalization without exhaustive API reference.
- Examples
- Uses unpaid registrants, even numbers, ticket prices, travel dates, and country strings matched or transformed with grep.
- What you can do after
- Apply it via Enumerable methods, regular expressions, and setter methods to select, reject, validate, normalize, or transform values.
Read how The Well-Grounded Rubyist, Fourth Edition explains filtering →
Building Web APIs with ASP.NET Core
Filtering behavior is the rule that determines which data items are included in a returned result based on a condition applied to their values.
- How it is used
- Improves a board-game GET endpoint by returning only records matching a client-supplied condition.
- How deep it goes
- Defines conditional database filtering, explains query composition and count timing, and stops at matching the Name field with Contains.
- Examples
- Uses filterQuery=diplomacy and filterQuery=war requests to verify matching board-game results.
- What you can do after
- Apply it via EF Core by adding filterQuery, conditionally chaining Where, and testing matching results.
Read how Building Web APIs with ASP.NET Core explains filtering →
Fabulous Adventures in Data Structures and Algorithms
Categorical distribution filtering removes one or more outcomes from a categorical distribution and adjusts the remaining distribution accordingly.
- How it is used
- Uses categorical filtering to remove impossible outcomes and compute posterior distributions from observed evidence.
- How deep it goes
- Explains filtering through joint distributions, matching observations, projection, and proportional weights without detailing distribution internals.
- Examples
- Demonstrates filtering with cold and sneezing categories, producing posterior weights No:27 and Yes:86.
- What you can do after
- Apply it via Filter and Project to derive a posterior distribution from a prior, likelihood function, and observation.
Read how Fabulous Adventures in Data Structures and Algorithms explains filtering →
Also covered in
- Pandas Workout: 200 exercises to make you a stronger data analyst
- Grokking Simplicity
- Event Processing in Action
- Learn C++ by Example
- Logs and Telemetry
- Just Use Postgres!
- Hidden InfluencesIn early access (MEAP)
- MongoDB 8.0 in Action, Third Edition
- Elasticsearch in Action, Second Edition
- Build Python Web Apps with Streamlit
- Elixir in Action, Third Edition
- Grokking Relational Database Design
What to know first
- SQLSQL is a standardized declarative language for defining, querying, and manipulating data in relational database systems.
- functional programmingFunctional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
Related concepts
- predicateuses · A predicate is a condition or relation over values or entities that specifies whether a stated property holds.
- arrayuses · An array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
- boolean querypart of · A Boolean query combines conditions or subqueries with logical operators such as AND, OR, and NOT to determine which items match.
- filter agentimplemented by · An event processing agent that tests incoming events to decide whether to discard them or pass them on.
- grouped dataframeused by · A grouped dataframe is a pandas object that partitions dataframe rows into groups for separate aggregation or transformation.
- flatmapimplemented by · FlatMap is an operation that maps each element to a sequence or computational context and combines the resulting sequences or contexts into a flattened result.
Questions about filtering
What is filtering?
Filtering is the selection or exclusion of data or items according to specified criteria.
Which Manning books explain filtering?
Statistics Slam Dunk, API Design Patterns, Everyday Data Visualization, Functional Programming in JavaScript, Spring Security in Action, Second Edition, Learn SQL in a Month of Lunches, The Design of Web APIs, Second Edition, Functional Programming in Scala, Second Edition and 27 more.
What should I know before learning filtering?
Manning books that teach filtering usually introduce SQL, functional programming, function and array first.
What is filtering part of?
Filtering is part of boolean query. A Boolean query combines conditions or subqueries with logical operators such as AND, OR, and NOT to determine which items match.
What is filtering also called?
Filtering is also called filter.
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.


































