# One Sample t-Test

This lesson will focus on how to perform one sample t-tests in Python.

## We'll cover the following

## One-sample t-test

A **One sample t-test** checks whether a population mean differs from the sample mean or not. We can use the function `ttest_1samp`

from the `scipy.stats`

module.

We will be using the Student Alcohol Consumption Dataset. We will take a sample from the data and find the *mean* grade. We will check if the population mean grade ($\mu$) differs from the sample mean grade ($\bar{x}$) or not.

**Null hypothesis $H_0$**: $\bar{x} = \mu$

**Alternate hypothesis $H_a$**: $\bar{x} \neq \mu$

We choose $\alpha$ to be at $95\%$ confidence level which means $\alpha =1 - (conf.level) = 1 - 0.95 = 0.05$

Get hands-on with 1200+ tech skills courses.