Filtering
Filtering is the operation of selecting or excluding items from data or a collection 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
- Supports exploration by narrowing an overview toward a focused question before revealing details on demand.
- How deep it goes
- Explains filtering through interaction design guidance, hierarchical behavior, coordinated views, reset actions, and documentation rather than implementation internals.
- Examples
- Uses biological classification filters, a drought-risk scatterplot and map, and a selected bar segment coordinating multiple charts.
- What you can do after
- Apply it to design understandable dashboard filters with relevant choices, familiar placement, and clear reset paths.
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 →
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 →
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
- Positions filtering as a safety measure for LLM training data and as one safeguard for agent inputs.
- How deep it goes
- Explains a classifier-based pretraining workflow and its scale costs, without specifying classifier design or implementation steps.
- Examples
- Contrasts excluding toxic subreddits with labeling them unsafe, and considers filtering hate speech or explicit content from Common Crawl.
- What you can do after
- Evaluate/understand it as a safety trade-off, weighing reduced toxic generation against screening costs and possible exclusion of marginalized voices.
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
- Narrows indexed documents to eligible search results before or alongside relevance ranking.
- How deep it goes
- Explains the matching–ranking distinction, performance rationale, and request-parameter choices, without detailing filter execution internals.
- Examples
- Uses a children’s-book request with category and audience filters and an outdoors-corpus frequency cutoff for autocomplete.
- What you can do after
- Operate/configure it in Solr by separating eligibility filters from query-driven scoring and boost queries.
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 source Flux values by a predicate and, in Spring Integration, controls which messages continue through a flow.
- How deep it goes
- Works through predicate-based filtering and an integration-flow alternative, but does not develop filter implementation internals.
- Examples
- Uses park-name strings to test a Reactor filter and even integers to show Spring Integration annotation and Java DSL filters.
- What you can do after
- Apply it via Reactor `filter()` to select Flux values, or configure a Spring Integration filter to pass selected messages.
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 →
Related concepts
- predicateuses · A predicate is a condition, expression, or function evaluated against an input or context to determine whether a specified criterion holds.
- arrayuses · An array is an indexed, ordered collection of elements arranged in one or more dimensions, with elements accessed by position.
- positional parameterkind of · A positional parameter is a command or function parameter whose value or meaning is determined by its position among supplied arguments rather than an explicit name.
- @PostFilteruses · @PostFilter is a Spring Security annotation that filters elements of a method's returned collection or array according to an authorization expression.
- flatmapimplemented by · FlatMap is an operation that applies a function producing nested collections or computational contexts to each element and combines the resulting contexts into one flattened result.
- grouped dataframeused by · A grouped dataframe is a pandas object that partitions dataframe rows into groups for separate aggregation or transformation.
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.
































