Sequence
A sequence is an ordered collection of elements whose positions determine their order of traversal or processing.
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 measurements to motivate forecasting from recent observations while identifying other time-series tasks.
- How deep it goes
- Defines regular measurements and rank-3 storage, illustrates cycles and chronological splits, then compares forecasting models without a formal derivation.
- Examples
- Uses Jena weather measurements and temperature plots; also names stock prices, electricity consumption, and sales as time series.
- What you can do after
- Apply it via R and Keras to inspect ordered weather data, preserve chronological splits, and test an LSTM forecast.
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
- Organizes ordered observations into fixed-size chunks that a neural network can ingest for tasks such as predicting bike rentals.
- How deep it goes
- Works through tensor reshaping and feature preparation, stopping before model training.
- Examples
- Uses hourly bike-sharing records from 2011–2012, including weather and rental counts, reshaped into 730 daily sequences.
- What you can do after
- Apply it via PyTorch to reshape ordered hourly rows into daily tensors and prepare variables for training.
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
- Models lazily generated data and decouples transformation pipelines from sources such as dates, console input, and event streams.
- How deep it goes
- Explains deferred execution, recomputation, caching, comprehensions, and practical sequence pipelines without detailing IEnumerable internals.
- Examples
- Uses number ranges and squares, conditional comprehensions, date streams, console commands, and timer events.
- What you can do after
- Apply it via `seq` and `Seq` functions to build lazy pipelines, then cache or materialize costly results deliberately.
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
- Guides visualization choices by identifying dimensions whose values should remain in meaningful order.
- How deep it goes
- Defines sequential values, distinguishes discrete from continuous cases, and explains how reordering can obscure response patterns.
- Examples
- Uses dates, fruit IDs, birth order, sales funnels, pain scales, generations, recommendation scores, and Likert responses.
- What you can do after
- Evaluate whether a data dimension’s order should be preserved before choosing a display arrangement.
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
- Represents changing physical-system measurements for digital-twin synchronization, monitoring, trend analysis, and prediction.
- How deep it goes
- Defines timestamped observations and explains storage and quality implications, but gives no sequence-processing algorithm.
- Examples
- Uses timestamped environmental and motion readings from a home sensor, plus industrial equipment measurements.
- What you can do after
- Apply it via Grafana to explore time windows and compare sensor metrics across live and historical views.
Related concepts
- recurrent neural networkused by · A recurrent neural network is a neural network that processes sequences by updating an internal state across successive inputs, allowing earlier inputs to influence later computations.
- 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.
- melodyincludes · A melody is a sequence of pitched musical notes forming a recognizable musical line.
- stringincludes · A string is a programming-language value representing an ordered sequence of characters or character units as text.
- flatmapproduced 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.
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.





















