04 Comparing with z-scores
04 Comparing with z-scores#
%%html
<iframe width="700" height="400" src="https://www.youtube.com/embed/_rtQGAX5wsQ/" frameborder="0" allowfullscreen></iframe>
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
from scipy import stats
data = {'Exam': ['LSAT', 'MCAT'], 'Score': [172, 37], 'Mean': [151, 25.1], 'Standard deviation': [10, 6.4]}
df = DataFrame(data)
df['Z-Score'] = (df['Score'] - df['Mean']) / df['Standard deviation']
df
Exam | Score | Mean | Standard deviation | Z-Score | |
---|---|---|---|---|---|
0 | LSAT | 172 | 151.0 | 10.0 | 2.100000 |
1 | MCAT | 37 | 25.1 | 6.4 | 1.859375 |