Sequence
A sequence is an ordered collection of elements whose positions determine the order in which they are arranged or traversed.
Clojure: The Essential Reference
A sequential collection is a collection abstraction whose elements can be traversed in a defined sequential order.
- How it is used
- Provides a common forward-traversal abstraction for collection access and processing functions.
- How deep it goes
- Defines the sequence contract and optional laziness, caching, and chunking; details collection-dependent access costs and `seq` versus `sequence` behavior.
- Examples
- Uses positional access on lists, empty-input comparisons, and a transducer applied to two collections.
- What you can do after
- Apply `seq` or `sequence` to obtain a sequential view and choose access or transformation functions with empty-input and ordering behavior in mind.
Read how Clojure: The Essential Reference explains sequence →
Build a Text-to-Image Generator (from Scratch)
Sequential data is data whose elements have an order that carries information about their meaning or interpretation.
- How it is used
- Represents ordered image patches for classification and discrete image codes for transformer-based generation and reconstruction.
- How deep it goes
- Works through positional embeddings and pretrained VQGAN encoding, codebook lookup, and decoding; image generation from text is deferred.
- Examples
- Uses 64 image patches plus a classification token, and a 576-index latent representation reconstructed with a pretrained VQGAN.
- What you can do after
- Operate/configure it with a pretrained VQGAN to encode an image as codebook indices and reconstruct it from those indices.
Read how Build a Text-to-Image Generator (from Scratch) explains sequence →
Deep Learning with R, Third Edition
Time series data consists of observations ordered by time, often recorded at regular intervals and exhibiting temporal dynamics such as trends, cycles, regimes, and spikes.
- How it is used
- Uses ordered observations to frame forecasting and other time-series tasks, and sequence representations to combine image and text inputs.
- How deep it goes
- Defines sequence tensor axes and temporal dynamics, then contrasts modeling approaches on a temperature-forecasting task.
- Examples
- Uses Jena weather measurements, electricity consumption, website visitor activity, and audio hotword detection as examples.
- What you can do after
- Evaluate sequence representations and modeling choices for forecasting and other ordered-data tasks.
Read how Deep Learning with R, Third Edition explains sequence →
Investing for Programmers
Time series data is a sequence of observations indexed by their times of occurrence.
- How it is used
- Uses dated financial observations to analyze price development, volatility, returns, technical patterns, and trading strategies.
- How deep it goes
- Demonstrates collection, normalization, returns, statistics, charts, and backtesting, but defers guarantees about future performance.
- Examples
- Uses Microsoft OHLCV data, normalized AAPL-KO-SMR charts, return histograms, and SMA crossover tests on historical stock prices.
- What you can do after
- Apply time series via yfinance, pandas, NumPy, and matplotlib to collect, transform, visualize, and evaluate financial observations.
Deep Learning with PyTorch, Second Edition
A dataset whose observations are ordered successive timepoints.
- How it is used
- Prepares ordered observations as fixed-size tensor inputs for neural networks.
- How deep it goes
- Works through chunking, axis ordering and variable rescaling, stopping before model training.
- Examples
- Uses hourly Washington, DC bike-sharing records to construct daily sequences of rental counts and weather variables.
- What you can do after
- Apply it via PyTorch to reshape ordered hourly data into fixed-length daily sequences.
Read how Deep Learning with PyTorch, Second Edition explains sequence →
Kotlin in Action, 2E
A sequence is an ordered computation that produces elements, potentially lazily and without requiring all elements to be stored or computed immediately.
- How it is used
- Builds lazy Kotlin pipelines for chained collection transformations and potentially unbounded generated values.
- How deep it goes
- Explains conversion, generation, intermediate and terminal operations, element-wise evaluation, and performance trade-offs without Sequence implementation internals.
- Examples
- Demonstrates name filtering, squared-number search, natural-number summation, and parent-directory traversal.
- What you can do after
- Apply it via Kotlin Sequence APIs to avoid intermediate collections and stop processing once a terminal query succeeds.
F# in Action: A Revised Edition of Get Programming with F#
A sequence is an ordered, potentially lazy and forward-only series of elements, represented in .NET by the IEnumerable interface.
- How it is used
- Turns generated or external inputs into values processed by uniform collection pipelines.
- How deep it goes
- Defines the .NET alias and demonstrates lazy execution, repeated computation, item access, and ways to retain results.
- Examples
- Uses number squares, filtered dates, and console commands tested with a list of characters.
- What you can do after
- Apply it via F# Seq functions to process generated dates and decouple console-command logic from its input source.
Read how F# in Action: A Revised Edition of Get Programming with F# explains sequence →
Build Python Web Apps with Streamlit
A time series is an ordered sequence of observations associated with time points, such as dates and corresponding values.
- How it is used
- Shapes filtered dashboard data into daily metric values for plotting and trend inspection.
- How deep it goes
- Defines date-value sequences, then works through daily aggregation and chart construction.
- Examples
- Uses daily sales records, California-filtered product rows, and a dashboard line chart.
- What you can do after
- Apply it via pandas groupby and Plotly to turn filtered metric data into a daily chart displayed in Streamlit.
Read how Build Python Web Apps with Streamlit explains sequence →
Learn Haskell by Example
Sequence is a book-defined composition structure that represents musical elements arranged in succession.
- How it is used
- Represents musical elements played in succession and hides list construction behind a composition operator.
- How deep it goes
- Defines recursive sequence nesting and works through flattening operator cases, while leaving heterogeneous pitch representation as a problem.
- Examples
- Uses melodies, consecutive chords, a three-note C–E–G phrase, and WriterT output collection.
- What you can do after
- Build it from scratch with a recursive composition type and a flattening infix sequencing operator.
Just Use Postgres!
Time-series data consists of observations associated with timestamps or time intervals, often representing measurements or events over time.
- How it is used
- Frames timestamped measurements as a workload for storing, querying, monitoring, and identifying trends.
- How deep it goes
- Defines the data shape and surveys TimescaleDB analysis, specialized functions, aggregates, and indexing without detailing implementation.
- Examples
- Uses smartwatch heart rate, server resource usage, currency rates, and patient vital signs as examples.
- What you can do after
- Apply time-series storage and analysis in Postgres with TimescaleDB for monitoring and health-trend applications.
Cloud Observability in Action
A time series is an ordered sequence of values associated with successive timestamps and a particular metric and dimension set.
- How it is used
- Organizes Prometheus metrics for storage, querying, aggregation, alerting, and correlation with other observability signals.
- How deep it goes
- Explains identity, labels, timestamps, counters, and range queries, but stops short of detailed storage-engine internals.
- Examples
- Uses API invocation series, HTTP method and path labels, status-code dimensions, counters, and timestamped TSDB observations.
- What you can do after
- Diagnose service behavior by querying metric ranges, comparing counter changes, and correlating aggregate values with logs or traces.
Fabulous Adventures in Data Structures and Algorithms
A sequence is an ordered abstraction representing elements that can be processed in a defined order.
- How it is used
- Uses sequences as inputs and outputs for Cartesian products and as containers mapped element by element.
- How deep it goes
- Derives an arbitrary-input Cartesian product, including zero- and one-sequence cases, and demonstrates element-wise mapping.
- Examples
- Demonstrates character-and-weapon combinations, products of integer sequences, and mapping division by two over integers.
- What you can do after
- Apply sequence-based mapping and Cartesian-product operations using LINQ query expressions.
Read how Fabulous Adventures in Data Structures and Algorithms explains sequence →
Data Without Labels
A sequence is an ordered collection of events, where the order represents their relative occurrence positions.
- How it is used
- Frames ordered events as data for sequence mining and as order-sensitive inputs for recurrent neural networks.
- How deep it goes
- Defines events and ordered sequences, explains item counting, and connects sequence order to recurrent processing.
- Examples
- Uses ordered grocery purchases and a customer transaction dataset to illustrate event sequences.
- What you can do after
- Understand how transaction events form ordered sequences and why input order matters to recurrent networks.
PostgreSQL Mistakes and How to Avoid Them
Time-series data consists of observations associated with timestamps or other ordered points in time.
- How it is used
- Uses timestamped PostgreSQL statistics to preserve and inspect system behavior over time.
- How deep it goes
- Explains snapshot collection, database storage, resampling, scheduling, and visualization through a practical tool workflow.
- Examples
- Uses locks, buffer statistics, WAL, connections, I/O, and other PostgreSQL metrics collected as timestamped snapshots.
- What you can do after
- Operate/configure pg_statviz to collect scheduled snapshots, resample them, and generate visualizations.
Read how PostgreSQL Mistakes and How to Avoid Them explains sequence →
Machine Learning System Design
Data consisting of observations indexed or ordered by time.
- How it is used
- Use time-ordered data to validate models without letting future observations inform predictions about the past.
- How deep it goes
- Explains timestamp-based splits and discusses window size, training history, seasonality, and gaps.
- Examples
- Uses neighboring-day sales, recent user actions, lag features, and statistics calculated over past time windows.
- What you can do after
- Evaluate models with timestamp-ordered splits and create past-based features using lags, aggregates, or statistical summaries.
LLMs in Production
Sequence data is data whose elements have an ordered position that carries information.
- How it is used
- Frames ordered language inputs as data for recurrent neural networks to process sequentially.
- How deep it goes
- Defines ordered arrays and explains variable-length RNN inputs and gradient problems, without detailing their mathematical mechanics.
- Examples
- Compares two semantically similar movie-review sentences of different lengths for sentiment analysis.
- What you can do after
- Understand how ordered, variable-length language inputs are processed by RNNs and why long sequences can complicate training.
Learn Docker in a Month of Lunches, Second Edition
A time series is an ordered sequence of values recorded with timestamps.
- How it is used
- Represents collected Prometheus metrics over time so they can be graphed and aggregated.
- How deep it goes
- Defines timestamped metrics and demonstrates graphing and aggregation, without developing time-series theory.
- Examples
- Shows a graph of aggregated access-log counts and a query that sums values across hosts and instances.
- What you can do after
- Apply it via PromQL to aggregate labeled metrics and graph changes over time.
Read how Learn Docker in a Month of Lunches, Second Edition explains sequence →
Natural Language Processing in Action, Second Edition
A time series is a sequence of observations indexed by successive points in time.
- How it is used
- Uses numerical sequences to frame recurrent processing and next-step forecasting.
- How deep it goes
- Explains vector representation and recursive prediction, while deferring the details of backpropagation through time.
- Examples
- Uses scooter rentals, freeway traffic, and weather as sequential data, with future weather and traffic as prediction targets.
- What you can do after
- Apply sequences through RNNs to predict the next observation and extend forecasts recursively.
Read how Natural Language Processing in Action, Second Edition explains sequence →
Everyday Data Visualization
Data whose values have a meaningful order that should generally be preserved when displayed.
- How it is used
- Uses value order to guide the choice and arrangement of visualizations.
- How deep it goes
- Defines sequential values, distinguishes them from categorical ones, and explains why out-of-order displays can mislead.
- Examples
- Uses dates, sibling birth order, sales funnel steps, pain scales, generations, and ordered survey responses.
- What you can do after
- Evaluate whether sorting a chart by magnitude would hide the direction of ordered responses.
Deep Learning with Python, Third Edition
An ordered sequence of integer values used here to represent tokenized text.
- How it is used
- Represents tokenized text numerically for language generation.
- How deep it goes
- Defines token-to-integer mapping and next-token prediction, without detailing tokenizer implementation.
- Examples
- Compares the possible four-word outputs from a 20,000-word vocabulary with predicting one token at a time.
- What you can do after
- Understand how integer sequences represent text and support next-token generation.
Read how Deep Learning with Python, Third Edition explains sequence →
Time Series Forecasting Using Foundation Models
Time-series data are observations indexed by time, often representing measurements collected sequentially.
- How it is used
- Frames sequential measurements as inputs for transformer-based forecasting and representation learning.
- How deep it goes
- Explains tokenization, embeddings, and positional encoding, but stops short of detailed forecasting procedures.
- Examples
- Uses hourly traffic with daily and weekly cycles and daily weather with yearly seasonality.
- What you can do after
- Evaluate how ordering, tokenization, positional information, and domain diversity affect time-series model inputs.
Read how Time Series Forecasting Using Foundation Models explains sequence →
Digital Twins in Action
Time-series data is a sequence of observations indexed by time, often representing sensor measurements or other changing quantities.
- How it is used
- Supports digital-twin synchronization, monitoring, trend analysis, and predictive modeling with time-indexed operational data.
- How deep it goes
- Defines time-series characteristics and storage practices, including raw records, curated corrections, and temporal queries.
- Examples
- Illustrates successive environmental sensor readings and industrial equipment measurements stored in a process historian.
- What you can do after
- Evaluate storage and collection choices for time-series data, including curated corrections and mirrors that protect control systems.
Also covered in
- Python Workout, Second Edition
- DuckDB in Action
- Elixir in Action, Third Edition
- Learn Generative AI with PyTorch
- Software Design for Python Programmers
- Functional Programming in Scala, Second Edition
- Regular Expression Puzzles and AI Coding Assistants
- The Art of AI Product Development
- Graph Neural Networks in Action
- Functional Programming in C#, Second Edition
- GitHub Actions in Action: Continuous integration and delivery for DevOps
- Fight Fraud with Machine LearningIn early access (MEAP)
What to know first
- MapA map is an associative data structure that stores key-value associations and supports retrieving values by key.
- inputAn input is information, a value, or an action supplied to a system, program, or computation for processing or to influence its behavior.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- performancePerformance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
Related concepts
- recurrent neural networkused by · A recurrent neural network is a neural network that processes ordered inputs while carrying and updating an internal state across successive steps.
- abstract data typekind of · An abstract data type specifies values, operations, and behavior independently of a particular representation or implementation.
- asof joinused by · An ASOF join matches rows from two relations according to temporal validity or another inequality condition.
- eductionalternative to · eduction is a Clojure function that applies one or more transducers lazily to a collection and returns a non-caching sequential view of the transformed results.
- IEnumerable<T>equivalent to · IEnumerable<T> is a .NET generic interface representing a sequence whose elements of type T can be traversed through an enumerator.
- flatmapproduced 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 sequence
What is sequence?
A sequence is an ordered collection of elements whose positions determine the order in which they are arranged or traversed.
Which Manning books explain sequence?
Clojure: The Essential Reference, Build a Text-to-Image Generator (from Scratch), Deep Learning with R, Third Edition, Investing for Programmers, Deep Learning with PyTorch, Second Edition, Kotlin in Action, 2E, F# in Action: A Revised Edition of Get Programming with F#, Build Python Web Apps with Streamlit and 14 more.
What should I know before learning sequence?
Manning books that teach sequence usually introduce Map, input, language model and performance first.
What is the difference between sequence and eduction?
A sequence is an ordered collection of elements whose positions determine the order in which they are arranged or traversed. eduction is a Clojure function that applies one or more transducers lazily to a collection and returns a non-caching sequential view of the transformed results.
What is sequence a kind of?
Sequence is a kind of abstract data type. An abstract data type specifies values, operations, and behavior independently of a particular representation or implementation.
What is sequence also called?
Sequence is also called seq.
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.





















