Last active
October 25, 2015 02:50
-
-
Save Akramz/5eae0eaf86e7eacbb8b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import statsmodels.api as sm | |
from sys import exit | |
# try whatever you want | |
listX = ['day_week', 'fog', 'rain', 'weekday'] | |
df = pd.read_csv('../improved_data_set/turnstile_weather_v2.csv', index_col=0) | |
dk = pd.DataFrame(df.groupby(listX)['ENTRIESn_hourly'].mean().reset_index()) | |
X = dk[listX] | |
y = dk['ENTRIESn_hourly'] | |
X = sm.add_constant(X) | |
est = sm.OLS(y, X).fit() | |
print est.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment