Skip to content

Instantly share code, notes, and snippets.

@Akramz
Last active October 25, 2015 00:55
Show Gist options
  • Save Akramz/5b779f20cdc921016d6b to your computer and use it in GitHub Desktop.
Save Akramz/5b779f20cdc921016d6b to your computer and use it in GitHub Desktop.
math analysis of the null hypothesis
import numpy as np
from ggplot import *
import scipy
import scipy.stats
import pandas
df = pandas.read_csv('new.csv')
with_rain_mean = np.mean(df['ENTRIESn_hourly'][df['rain'] == 1])
without_rain_mean = np.mean(df['ENTRIESn_hourly'][df['rain'] == 0])
U, p = scipy.stats.mannwhitneyu(df['ENTRIESn_hourly'][df['rain'] == 1], df['ENTRIESn_hourly'][df['rain'] == 0])
print with_rain_mean, without_rain_mean, U, p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment