
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Install the 64-bit Anaconda on Windows to set up Python 3.8 and launch Jupyter notebook via the Anaconda Navigator, giving you an interactive data analysis environment.
Launch Jupyter notebook via Anaconda Navigator, create and save notebooks in a Python folder, and master code and markdown cells plus shortcuts like shift-enter, a/b, and y/m.
Explore Python calculations in a Jupyter notebook, using arithmetic, modulo, power, and BODMAS; import and use the math module, and apply functions from NumPy, Pandas, and Matplotlib for analysis.
Define variables in Python by assigning values such as A=2 and B=3, print them, and check their types: int for integers, float for decimals, and str for strings.
Practice coding in Python by using Jupyter notebooks, following exact instructions, and completing coding exercises and quizzes. Explore course resources, sections, slides, notebooks, and datasets to reinforce learning.
Learn how to create and manipulate lists in Python, including list of lists, indexing, slicing, reading, updating, appending, popping, and counting items.
Master Python lists by reading, adding, and removing items, counting length, and testing membership with in. Build lists from ranges using start, stop, and step to generate larger sequences.
Learn to define and use a Python dictionary with key-value pairs in curly braces, access values by key, view keys and items, and pop a key to remove it.
Explore tuples as immutable Python data structures defined with round brackets. Access items by index starting at zero, and note that tuples cannot be assigned, appended, or deleted.
Explore Python sets, defined with curly brackets, as unordered collections of unique elements. Contrast them with lists and dictionaries, and learn to extract unique values through practical examples.
Explore how Python uses logical operators to compare values and produce booleans, distinguishing assignment from equality and covering not equal, and order comparisons, including case sensitivity in strings.
Explore descriptive statistics and the three measures of central tendency—mean, median, and mode—showing how to compute averages and how extreme values affect the mean.
Explore dispersion in descriptive statistics by calculating range, variance, and standard deviation, and distinguish between sample and population formulas using mean and deviations.
Explore descriptive statistics by examining dispersion through quartiles, median, and interquartile range, and learn to visualize with box and whisker plots in Python.
Explore descriptive statistics in Python by computing mean, median, mode, range, standard deviation, variance, and interquartile range from a sample list, and visualize with box plots using Matplotlib and Seaborn.
Explore NumPy for multidimensional arrays, import as NP, and create one- and two-dimensional arrays from lists, ranges, and linspace. Learn to shape arrays with zeros, ones, and reshape.
Learn how to create and index NumPy arrays of 1D, 2D, and multi-dimensional shapes, use slicing and boolean masking to select values, and apply start, stop, and step in arange.
Create and manipulate NumPy arrays with arange, perform element-wise addition and subtraction, compare arrays with lists, and understand views versus copies while linking to random numbers and probability.
Define probability through classical and relative frequency models, explain trials, outcomes, sample space, and use Venn diagrams to illustrate mutually exclusive events, union, and intersection.
Explore mutually exclusive, independent, and complementary events, and apply the rule of multiplication and addition to calculate probabilities using coin flips, jar draws, and dice.
Explore factorial, permutation, and combination, including with and without repetition, and distinguish when order matters to count possibilities in probability.
Use NumPy's random to simulate probability concepts from coin flips to die rolls, with seeds for reproducibility, and count outcomes. Visualize results with Matplotlib and Seaborn count plots.
Explore probability with a two-dice example, computing the 15/36 chance of sums over seven, and verify via numpy simulations, then introduce probability distributions and the binomial distribution.
Explore fundamental probability distributions, including die and coin examples, and distinguish discrete from continuous data, with an introduction to binomial, Poisson, normal, and Weibull distributions.
Explore the binomial distribution for n independent trials with two outcomes and constant p. Use P(X=x)=C(n,x)p^x(1-p)^{n-x} to compute probabilities and the mean np and variance np(1-p).
Demonstrate binomial distribution with numpy by simulating coin flips (1, 2, and 10 coins), visualize results with seaborn, and compare simulated versus theoretical outcomes for 20-sample defects.
Apply the binomial distribution with Python and SciPy’s binom to compute CDF and PMF for n=20, p=0.12, and derive mean, variance, and plots of PMF and CDF.
Explore the Poisson distribution, where possibilities are infinite, as a counterpart to binomial for discrete data, emphasizing mu as the average number of successes and the probability of X successes.
Explore a Poisson distribution example with a mean of 3.6 arrivals per 10 minutes, and compute the probability of seven arrivals, highlighting the mean and variance as lambda.
Simulate Poisson distribution with NumPy using lambda 3.6 to model a queue, generating 1000 samples and visualizing with Matplotlib and Seaborn to compare theory and simulation.
Demonstrates calculating Poisson probabilities with SciPy, exploring pmf, cdf, and sf for lambda 3.6, and visualizing the distribution alongside mean, variance, and std dev; sets stage for normal distribution.
Explore the normal distribution for continuous data and its symmetry. Explain how mean, mode, and median coincide in symmetry, and how probabilities come from area under the curve.
Learn to convert any normal distribution to the standard normal with z-scores, then read the z-table for probabilities and the 68/95/99.7 percent areas.
Simulate a normal distribution with numpy, 100 and std dev 2, plot a histogram with kde, verify areas within ±1, ±2, ±3 sigma align with 68, 95, 99.7 percent.
The lecture uses SciPy's norm to compute probabilities for the normal distribution, contrasts theory with NumPy simulations, and visualizes with norm.pdf plots and mean 150 and standard deviation 2.
Examine descriptive statistics in Python, covering central tendency and dispersion with statistics, NumPy, and SciPy.stats. Learn axis-based means on 2d arrays and shape, with binomial, Poisson, and normal distributions.
Learn to use Pandas series, a single-column data structure, creating series from lists or arrays, and indexing by position or name to read values.
Learn to build a pandas DataFrame from a numpy array, set human-readable row and column labels. Compare DataFrame creation with series and prepare data for Excel sheet.
Import a csv file with pandas to create a dataframe, set an item number as the index, and preview data with head, tail, info, and describe.
Learn to manage pandas DataFrame columns: select single or multiple columns, create a volume column from length, width, height, and drop columns with axis.
Filter and select rows in pandas dataframes with .loc and .iloc, using boolean masks and combined conditions to analyze targeted rows and columns.
Learn to visualize data by plotting a histogram of length using matplotlib.pyplot and pandas data frames, customize with bins, color, and axis labels, and display the plot.
Discover how to build a box and whisker plot using matplotlib.pyplot, compare length data for operator 1 and operator 2 with side-by-side plots, and label axes and title.
Learn to create line plots with matplotlib.pyplot, turn them into control charts with mean and plus/minus three sigma, and build scatterplots to explore relationships between two variables.
Learn to create bar plots with matplotlib.pyplot in Python from discrete data, using simple and advanced examples to count categories and visualize with plt.bar and plt.show.
Save your matplotlib plots as png or jpg with plt.savefig, specifying a file name in the present working directory, and adjust dpi for higher quality images.
Explore Seaborn displot for distribution plots, including histogram, KDE, rug, and ECDF; compare with Matplotlib histplot, use hue for operator groups, and build single or side-by-side and bivariate plots.
Learn how to create eight category plots with Seaborn catplot by setting kind to strip, swarm, box, violin, boxen, point, bar, or count.
Explore Seaborn relplot to visualize relationships with scatter and line plots, hue grouping by operator, and arranging plots in columns or rows, plus regplot for regression.
Explore the Titanic dataset with Seaborn in Python to load data, inspect structure, and analyze age and survival outcomes using histograms, KDE plots, and categorical visuals.
Distinguish population from samples and connect descriptive statistics to inferential statistics. Understand statistics versus parameters, and how sampling, confidence intervals, and the central limit theorem enable hypothesis testing.
Demonstrate how the sampling distribution of the mean becomes normal as sample size grows, and explain mu, sigma, and the standard error equals sigma over sqrt(n).
Explore the central limit theorem with Python by simulating dice rolls, showing sample means converge to normality and their standard deviation scales with sqrt(n), plus bimodal data and hypothesis testing.
Explore the basics of hypothesis testing, including statistical vs practical significance, steps, type I and II errors, and p-values, using sample statistics to infer population parameters.
Explore the distinction between statistical significance and practical significance in hypothesis testing, using real-world examples to judge when a mean change warrants action.
State the null and alternate hypotheses and set alpha at 0.05. Then compute the test statistic, compare it to the critical value, and decide whether to reject or fail to reject the null.
Apply hypothesis testing to determine if a production mean deviates from 150 cc, using null and alternative hypotheses, two-tailed and one-tailed tests, and z tests within a normal distribution context.
Explore hypothesis testing: choose null and alternate hypotheses, set an alpha level, and understand type 1 and type 2 errors, power, and the role of sampling in detecting changes.
Explain type 1 and type 2 errors, alpha and beta, and how confidence and significance levels shape sampling decisions. Illustrate producers risk and consumers risk in acceptance sampling and power.
Learn how to perform hypothesis testing by formulating null and alternate hypotheses, selecting alpha, calculating the test statistic, and interpreting results to reject or fail to reject the null.
Compute z critical values from the standard normal distribution using the z table for two-tail tests and single-tail tests, given alpha levels, and understand rejection regions.
Explore p-value approach to hypothesis testing, contrast software outputs with the critical-value method, and learn to reject or fail to reject the null hypothesis in z, t, chi-square, F, ANOVA.
Apply hypothesis testing with Python to compare a sample mean to a population mean using a two-tailed z test at 95 percent confidence, reporting the p-value and alpha.
Explore hypothesis tests for means, variances, and proportions, including alpha and beta errors from one- and two-sample tests to ANOVA, using samples to infer population characteristics with 95 percent confidence.
Learn the one sample z test, six-step hypothesis process, alpha 0.05, and the conditions, random, independent samples, central limit theorem normality, known sigma, and z vs t by sample size.
Understand a one sample z test through a perfume bottle example: test if the mean volume differs from 150 cc with n=100 and sigma=2 at 95% confidence, concluding no change.
Apply a one-sample z test at 95% confidence to test if mean volume increased, with n=100, sigma=2, mean 150.2; compare z=1 to 1.645 and fail to reject the null.
practice performing a one-sample z test on bottle volume data using Python, pandas to read CSV files, and weightstats from statsmodels to obtain z- and p-values.
Identify the conditions for a one sample t test—random sample, independent observations, and approximate normal distribution with unknown population standard deviation—and compute the t statistic to test the mean.
Perform a one-sample t test in python to check if bottle volume differs from 150 cc; obtain mean 151 and p-value 0.39, so we do not reject null.
Explain how to perform a one proportion test using normal approximation for binomial data with np and n(1-p) ≥ 10, and interpret hypotheses, z, and critical values for two-tailed tests.
Explore conducting a one proportion test in Python using the binomial distribution with scipy.stats binom_test. Analyze smoking data, compare observed smokers to 0.21 expectation, and interpret p-values without normal approximation.
Compare the sample variance to the population variance using a one variance test with chi-square; learn about F tests for two variances.
Perform a one variance test using chi-square to determine if the sample variance of 2.35 cc from 51 bottles indicates a population variance increase from 4 to about 5.52.
Learn a two-tailed one-variance test using chi-square to assess if the population variance changes from an established value, with df=50, sample sd 2.35, 90% confidence, and interpreting critical values.
Demonstrates a one variance test in Python using chi-square, computing the test statistic and critical value for 50 df at 90 percent confidence, leading to rejection.
Compare two populations using a two-sample z test to determine if machine A and B differ, outlining hypotheses, z statistic, and applicable conditions.
In this two sample z test example, compare mean bottle volumes from two machines (n=100 each) at 95 percent confidence; reject null and show a significant difference between means.
Demonstrates two-sample z test in Python using weightstats and a two-sample t test with SciPy on a two-machine dataset (Twomachines.csv), featuring a box and whisker plot and significant mean difference.
Explore a practical two-sample z test in Python using the tips dataset, comparing tips by gender and evaluating p-values to determine significant differences.
Explore two-sample t tests, including independent versus paired designs, when to use equal or unequal variances, and how to compute t values, pooled variance, and degrees of freedom.
Use the two-sample t test for equal variances with pooled standard deviation to compare means from two machines and test the null hypothesis.
Learn to perform a two-sample t test with unequal variances, using non-pooled variance and a specialized degrees-of-freedom formula, illustrated by machine a versus c.
Visualize and interpret two-sample t tests for equal and unequal variances using box-and-whisker plots of machines A, B, and C to compare means and assess null-hypothesis rejection.
Explore two-sample t tests for equal and unequal variances, compute t statistics and p-values in Python using SciPy.stats, and interpret results to reject or fail to reject the null hypothesis.
Use the paired t test on before and after blood pressure data by computing differences, then compare the t value to t critical to determine if medicine has an effect.
learn to perform a paired t-test in python using scipy with blood pressure data before and after medicine, interpret the p-value, and conclude whether the medicine changes blood pressure.
Explore the two proportions test to compare p1 and p2 using sample proportions p1_hat and p2_hat, under random, independent samples with two categories and normal approximation (np≥10, n(1-p)≥10 for both).
Explore the two proportions test, comparing pooled and unpooled methods. Understand how p1 equals p2 is tested against a specified difference in proportions, illustrated with supplier examples.
Compare two proportions with the pooled two-proportions z-test at 95% confidence, computing pooled proportion and z, testing p1 vs p2, and concluding no significant difference between vendors A and B.
Perform a two proportions test in python, comparing 30/200 vs 10/100 defectives, using statsmodels proportions with score method to reflect the p-value result.
Learn to compare two variances with the f test, calculate f = s1^2 / s2^2, and decide equality of variances using the appropriate f critical values at 90 percent confidence.
Use Python to perform a two-variance test, compute F and F critical values, and compare with Bartlett and Levene tests for variance equality.
Extend the two sample t test to compare means across three or more treatments, using ANOVA to assess between and within variation and test mean equality.
This lecture explains why ANOVA is needed to compare means across more than two populations, showing how multiple two-sample t tests inflate error and how ANOVA preserves 95 percent confidence.
Learn the concepts of variation between and within using a three-machine example and box and whisker plots, then see how ANOVA uses mean differences, their ratio, and the F test.
Explore the theory behind analysis of variance, including sum of squares, between and within variation, and the F statistic for comparing means across more than two samples.
Learn to perform one-way ANOVA by manual calculations across three machines, computing sum of squares between and within, degrees of freedom, F value, and critical value to test mean differences.
Perform one-way ANOVA in Python using SciPy.stats and statsmodels on data from three machines (M1, M2, M3) to test for differences, interpreting F and p-values.
Perform one-way ANOVA in Python on the Seaborn mpg dataset, focusing on four-cylinder cars to compare mpg across Europe, Japan, and USA. Use boxplots and report a significant origin effect.
Apply post hoc Tukey's HSD after ANOVA to identify which groups differ, using MPG and machine data, and interpret p-values with pairwise Tukey tests in Python.
Apply chi-square goodness-of-fit to test if a sample comes from a specified distribution, using observed versus expected counts. Learn a one-tail test at alpha 0.05 with null and alternative hypotheses.
Perform goodness-of-fit tests in Python using SciPy to compare observed and expected counts with chi-square, interpret p-values, and assess bias in coin, die, and shirt sales.
Use contingency tables and chi-square to test relationships between two discrete variables, with null and alternative hypotheses, observed versus expected counts, and practical examples like gender and smoking.
Build contingency tables in python, compute chi-square statistics, and interpret p-values to test relationships between rows and columns using numpy, pandas, and scipy with the operator-shift and tips datasets.
Perform simple or complex statistical calculations using Python! - You don't need to be a programmer for this :)
You are not expected to have any prior knowledge of Python. I will start with the basics. Coding exercises are provided to test your learnings.
The course not only explains, how to conduct statistical tests using Python but also explains in detail, how to perform these using a calculator (as if, it was the 1960s). This will help you in gaining the real intuition behind these tests.
Learn statistics, and apply these concepts in your workplace using Python.
The course will teach you the basic concepts related to Statistics and Data Analysis, and help you in applying these concepts. Various examples and data-sets are used to explain the application.
I will explain the basic theory first, and then I will show you how to use Python to perform these calculations.
The following areas of statistics are covered:
Descriptive Statistics - Mean, Mode, Median, Quartile, Range, Inter Quartile Range, Standard Deviation.
Data Visualization - Commonly used plots such as Histogram, Box and Whisker Plot and Scatter Plot, using the Matplotlib.pyplot and Seaborn libraries.
Probability - Basic Concepts, Permutations, Combinations
Population and Sampling - Basic concepts
Probability Distributions - Normal, Binomial and Poisson Distributions
Hypothesis Testing - One Sample and Two Samples - z Test, t-Test, F Test and Chi-Square Test
ANOVA - Perform Analysis of Variance (ANOVA) step by step doing the manual calculation and by using Python.
The Goodness of Fit and the Contingency Tables.