Resampling
Resampling is the process of constructing or transforming samples from observed data according to a specified scheme for statistical analysis, data balancing, or changes in sampling frequency.
Starting Data Analytics with Generative AI and Python
Resampling is a statistical technique that repeatedly constructs samples from observed data to assess the behavior or uncertainty of an estimator.
- How it is used
- Estimates confidence intervals and supports fairness adjustments when distributions or model outputs require closer scrutiny.
- How deep it goes
- Defines sampling with replacement, repeated statistic calculation, and bootstrap distributions, but does not detail implementation mechanics.
- Examples
- Uses equipment destruction tests and state-level sales-price and review-score confidence intervals as concrete applications.
- What you can do after
- Apply bootstrap resampling to estimate confidence intervals for statistics calculated from observed datasets.
Read how Starting Data Analytics with Generative AI and Python explains resampling →
Financial AI in Practice
Changing a dataset's composition by sampling its observations, often to address class imbalance.
- How it is used
- Rebalances training data for supervised fraud detection when rare fraudulent transactions leave models biased toward legitimate transactions.
- How deep it goes
- Defines oversampling and undersampling, names SMOTE, and warns about cross-validation contamination without providing a resampling implementation.
- Examples
- Uses rare payment fraud and a stratified split retaining roughly 0.1725% fraud in both training and test sets.
- What you can do after
- Operate/configure it within a modeling pipeline while preserving an untouched, imbalanced test set for evaluation.
Pandas Workout: 200 exercises to make you a stronger data analyst
Resampling is the process of changing the temporal frequency of time-indexed data, commonly by aggregating observations into new time periods.
- How it is used
- Groups time-indexed data into meaningful periods so reports can summarize activity over recurring windows.
- How deep it goes
- Explains resampling as time-based groupby and demonstrates period selection with count, mean, and standard deviation, without internals.
- Examples
- Uses Apollo launch dates to count missions in six-month periods and mentions daily, biweekly, monthly, and yearly summaries.
- What you can do after
- Apply it via pandas to aggregate a time-indexed data frame over selected time periods.
Read how Pandas Workout: 200 exercises to make you a stronger data analyst explains resampling →
Related concepts
- pandas.DataFrame.resample()implemented by · pandas.DataFrame.resample() groups time-indexed observations into specified temporal intervals for aggregation or other computations.
- bootstrappingincludes · Bootstrapping is the process of establishing a system, model, or computing environment from an initially limited state by obtaining or generating required resources and configuration.
- data groupingalternative to · Data grouping is the organization of data into groups according to shared values, keys, or other criteria, supporting grouped processing, analysis, or retrieval.
- confidence intervaluses · A confidence interval is a range estimated from data by a statistical procedure designed to provide a specified long-run coverage probability for an unknown quantity.
- upsamplingkind of · Upsampling is a process that increases the number, density, or spatial or temporal resolution of samples or values in a dataset or representation by adding, duplicating, or estimating them.
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.


