In [1]:
import pandas as pd
In [2]:
my_dir = "/Volumes/dax/seals/Kaggle-NOAA-SeaLions/"
train = 'Train/train.csv'
so_far = '2017-06-24_submission_stripped.csv'
In [3]:
t_d = pd.read_csv(my_dir + train)
t_d.head()
Out[3]:
In [4]:
t_m = t_d.mean()
In [5]:
t_m
Out[5]:
In [6]:
sf_d = pd.read_csv(my_dir + so_far)
del sf_d['test_id']
sf_d.head()
Out[6]:
In [7]:
sums = sf_d.sum(axis = 1)
In [8]:
sf_d.iloc[1]
Out[8]:
In [9]:
sums[-5:]
Out[9]:
In [10]:
counter = 0
for i in sums:
if i == 0:
sf_d.set_value(index = counter, col = 'adult_males', value = t_m['adult_males'])
sf_d.set_value(index = counter, col = 'subadult_males', value = t_m['subadult_males'])
sf_d.set_value(index = counter, col = 'adult_females', value = t_m['adult_females'])
sf_d.set_value(index = counter, col = 'juveniles', value = t_m['juveniles'])
sf_d.set_value(index = counter, col = 'pups', value = t_m['pups'])
counter += 1
In [11]:
sf_d.tail()
Out[11]:
In [12]:
sf_d.to_csv(my_dir + 'hail_mary.csv')
In [ ]: