In [6]:
import pandas as pd
from scipy import stats
import numpy as np

In [18]:
df = pd.read_csv('https://docs.google.com/spreadsheets/d/1uLyzoEhNa2vBGMxBLq56KgNKhulNPPwhbtiPK1xRA98/export?format=csv&id')
df = df.dropna(subset=['Gallons'])

mpgdiff = df.dropna()['MPG difference'].values.astype(float)
print(mpgdiff)
stats.wilcoxon(mpgdiff)


[-2.   2.2 -5.3 -1.9  1.  -1.5 -1.4]
/Users/scott/anaconda/lib/python3.6/site-packages/scipy/stats/morestats.py:2385: UserWarning: Warning: sample size too small for normal approximation.
  warnings.warn("Warning: sample size too small for normal approximation.")
Out[18]:
WilcoxonResult(statistic=7.0, pvalue=0.23672357063785732)

In [ ]: