Kaggle competition: NFL Big Data Bowl
DEBUG = False<load_from_csv>
def train_my_model(train_df): 
(a, b, loc ,shape)= stats.norminvgauss.fit(play_df[train_df.NflId==train_df.NflIdRusher]['Yards'])
 return(a, b, loc ,shape)
def read_data() :
if DEBUG:
print('Reading train.csv file.... ')
 train = pd.read_csv(dirs+'train.csv', nrows=100000)
 print('Training.csv file have {} rows and {} columns'.format(train.shape[0], train.shape[1]))
print('Reading test.csv file.... ')
 test = pd.read_csv(dirs+'test.csv', nrows=100000)
 print('Test.csv file have {} rows and {} columns'.format(test.shape[0], test.shape[1]))
else:
print('Reading train.csv file.... ')
 train = pd.read_csv(dirs+'train.csv')
 print('Training.csv file have {} rows and {} columns'.format(train.shape[0], train.shape[1]))
print('Reading test.csv file.... ')
 test = pd.read_csv(dirs+'test.csv')
 print('Test.csv file have {} rows and {} columns'.format(test.shape[0], test.shape[1]))
print('Reading train_labels.csv file.... ')
 train_labels = pd.read_csv(dirs+'train_labels.csv')
 print('Train_labels.csv file have {} rows and {} columns'.format(train_labels.shape[0], train_labels.shape[1]))
print('Reading specs.csv file.... ')
 specs = pd.read_csv(dirs+'specs.csv')
 print('Specs.csv file have {} rows and {} columns'.format(specs.shape[0], specs.shape[1]))
print('Reading sample_submission.csv file.... ')
 sample_submission = pd.read_csv(dirs+'sample_submission.csv')
 print('Sample_submission.csv file have {} rows and {} columns'.format(sample_submission.shape[0], sample_submission.shape[1]))
result=[]
for event_id,df in train.groupby('event_id'):
if event_id=='27253bdc':
result.append({'event_id':event_id,'event_code':df['event_code'].iloc[0],'title':"ALL Clips",'type':"Clip",'world':"ALL worlds"})
 else:
result.append({'event_id':event_id,'event_code':df['event_code'].iloc[0],'title':df['title'].iloc[0],'type':df['type'].iloc[0],'world':df['world'].iloc[0]})
 title_code=pd.DataFrame(result)
 specs=pd.merge(specs,title_code,how='outer',right_on='event_id',left_on='event_id')
 return train, test, train_labels, specs, sample_submission
train, test, train_labels, specs, sample_submission = read_data()<load_from_csv>
<feature_engineering><EOS> 
env = nflrush.make_env()
param=train_my_model(train_df)
 CDF=stats.norminvgauss.cdf(np.linspace(-99,99,199),param[0],param[1],param[2],param[3])
 for(test_df, sample_prediction_df)in env.iter_test() :
predictions_df = pd.DataFrame(data=[CDF], columns= sample_prediction_df.columns)
 env.predict(predictions_df)
 env.write_submission_file()
print([filename for filename in os.listdir('/kaggle/working')if '.csv' in filename] )