Learning

open
close

Review of Python Algorithms

June 28, 2025 | by Bloom Code Studio

This appendix provides a summary of various Python algorithms used in this textbook. The intent is to provide students with a cross-reference to the various algorithms used in the text and provide a general description of the algorithm and link to the section of the text.

For more details on Python functions, syntax, and usage, please refer to Appendix D: Review of Python Functions and/or the Python documentation online.

Chapter TitleTopicDescription of AlgorithmFirst Reference
What Are Data and Data Science?Loading and viewing dataUsing Python pandas library to load a CSV file, describe its features, and explore its contentsPython Basics for Data Science
Visualizing data using PythonUsing Python to create a scatterplot for two numeric quantitiesPython Basics for Data Science
Collecting and Preparing DataScraping data from a websiteUsing Python to extract a data table from a websiteWeb Scraping and Social Media Data Collection
Using regular expressions in PythonUsing Python to search for a selected word in a given string and output the number of times it appearsWeb Scraping and Social Media Data Collection
Processing and storing dataUsing Python to process data and output to a CSV fileWeb Scraping and Social Media Data Collection
Parsing and extracting dataUsing Python to parse and extract specific data from a given datasetWeb Scraping and Social Media Data Collection
Descriptive Statistics: Statistical Measurements and Probability DistributionsCalculate binomial probabilitiesUsing Python to calculate probabilities associated with the binomial distributionDiscrete and Continuous Probability Distributions
Calculate probabilities from a normal distributionUsing Python to calculate probabilities associated with the normal distributionDiscrete and Continuous Probability Distributions
Inferential Statistics and Regression AnalysisComputing margin of errorUsing Python library scipy.stats to compute a margin of error using the t-distributionStatistical Inference and Confidence Intervals
Confidence interval using bootstrappingUsing Python to calculate a confidence interval using a bootstrapping approachStatistical Inference and Confidence Intervals
Confidence interval for the meanUsing Python to calculate a confidence interval for the mean using the normal and t-distributions (two examples)Statistical Inference and Confidence Intervals
Hypothesis test for the mean (one sample)Using Python to calculate a p-value associated with a hypothesis test for the meanHypothesis Testing
Hypothesis test for a proportionUsing Python to calculate a p-value associated with a hypothesis test for a proportionHypothesis Testing
Hypothesis test for the mean (one sample)Using Python to calculate a test statistic and p-value associated with a hypothesis test for the meanHypothesis Testing
Hypothesis test for the mean (two samples)Using Python to calculate a test statistic and p-value associated with a hypothesis test for the difference between two meansHypothesis Testing
Correlation coefficientUsing Python to calculate the Pearson correlation coefficient for two numeric variablesCorrelation and Linear Regression Analysis
Creating a scatterplotUsing Python to create a scatterplot for two numeric quantitiesCorrelation and Linear Regression Analysis
Creating a linear regression modelUsing Python to calculate the slope and intercept for a linear regression modelCorrelation and Linear Regression Analysis
One-way analysis of variance (ANOVA)Using Python to conduct a one-way analysis of variance hypothesis testAnalysis of Variance (ANOVA)
Visualizing time series dataUsing basic Python plot routine and matplotlib.pyplot to generate a time series graph based on a pandas DataFrame (two examples)Analysis of Variance (ANOVA)
Time Series and ForecastingPlotting a simple moving average (SMA) and differencingUsing Python to generate a simple moving average and first-order difference for time series dataTime Series Forecasting Methods
Decomposing a time series into componentsUsing Python autocorrelation function and STL (seasonal and trend decomposition using LOESS) model to decompose time series data into its componentsTime Series Forecasting Methods
Exponential moving average (EMA)Using Python to calculate exponential moving average for time series dataTime Series Forecasting Methods
Autoregressive integrated moving average (ARIMA)Using Python to calculate autoregressive integrated moving average model for time series dataTime Series Forecasting Methods
Autoregressive integrated moving average (ARIMA)Using Python to fit and plot an autoregressive integrated moving average and use it to make forecasts for time series dataTime Series Forecasting Methods
Forecasting methodsUsing Python to create and plot a forecasting model with confidence intervals for time series dataForecast Evaluation Methods
Decision-Making Using Machine Learning BasicsLogistic regressionUsing Python to fit a logistic regression model and assess the accuracy of the modelClassification Using Machine Learning
K-means clusteringUsing Python to produce a k-means clustering model from a datasetClassification Using Machine Learning
DBscan clusteringUsing Python to generate a density-based spatial clustering of applications with noise (DBScan) modelClassification Using Machine Learning
Confusion matrixUsing Python to generate a confusion matrixClassification Using Machine Learning
Linear regression with bootstrappingUsing Python to generate a linear regression model using a bootstrapping methodMachine Learning in Regression Analysis
Multiple regressionUsing Python to perform multiple regression analysisMachine Learning in Regression Analysis
Three-dimensional scatterplotUsing Python to generate a three-dimensional plot of a multiple regression modelMachine Learning in Regression Analysis
Mesh gridUsing Python to generate a mesh grid plot of a multiple regression modelMachine Learning in Regression Analysis
Multiple logistic regressionUsing Python to perform multiple logistic regression analysis and generate corresponding confusion matrixMachine Learning in Regression Analysis
Decision treesUsing Python to generate decision treesDecision Trees
Random forestsUsing Python to train a random forests model and analyze the importance of each featureOther Machine Learning Techniques
Gaussian naïve BayesUsing Python to perform Gaussian naïve Bayes analysisOther Machine Learning Techniques
Deep Learning and Artificial Intelligence (AI) BasicsPerceptronsUsing Python to train and test a perceptron classification model and assess the accuracy of the modelIntroduction to Neural Networks
Training a neural network with backpropagationUsing Python’s TensorFlow library to train and test a neural network classification model using backpropagation and assess the accuracy of the modelBackpropagation
Recurrent neural networksUsing Python’s TensorFlow library to train and test a classification model using recurrent neural networks (RNN) and assess the accuracy of the modelBackpropagation
Predict future valuesUsing Python to predict future values for a classification model using recurrent neural networks (RNN)Backpropagation
Plot predicted valuesUsing Python to plot future values versus original data for a classification model using recurrent neural networksBackpropagation
Deep learningUsing Python’s TensorFlow library to train and test a classification model using deep learning and assess the accuracy of the modelBackpropagation
Visualizing DataData visualization using boxplotsUsing Python to create boxplotsEncoding Univariate Data
Data visualization using histogramsUsing Python to create histogramsEncoding Univariate Data
Data visualization using Pareto chartsUsing Python to create Pareto chartsEncoding Univariate Data
Data visualization using time series chartsUsing Python to create time series chartsEncoding Data That Change over Time
Data visualization for binomial probabilitiesUsing Python to create graphs associated with the binomial distributionGraphing Probability Distributions
Data visualization for Poisson probabilitiesUsing Python to create graphs associated with the Poisson distributionGraphing Probability Distributions
Data visualization for normal probabilitiesUsing Python to create graphs associated with the normal distributionGraphing Probability Distributions
HeatmapsUsing Python to create heatmapsGeospatial and Heatmap Data Visualization Using Python
Scatterplots with colormapsUsing Python to create scatterplots with colormapsMultivariate and Network Data Visualization Using Python
Correlation heatmapsUsing Python to create correlation heatmapsMultivariate and Network Data Visualization Using Python
Data visualization using three-dimensional plotsUsing Python to create three-dimensional plotsMultivariate and Network Data Visualization Using Python
Reporting ResultsIdentify data characteristicsUsing Python to identify data characteristics of a datasetValidating Your Model
Decision treeUsing Python to run a decision tree and generate a visualization of the resultValidating Your Model
Model validation using Bayesian information criterion (BIC)Using Python to perform cross validation with Bayesian information criterionValidating Your Model
Monte Carlo simulationUsing Python to perform Monte Carlo simulationValidating Your Model
Executive summaryUsing Python to create an executive summary reportEffective Executive Summaries

Table C1