Jeffery Russell 5 years ago
parent
commit
063bbd6150
6 changed files with 181 additions and 6 deletions
  1. +40
    -1
      data_preparation/first_rows/games.csv
  2. +40
    -1
      data_preparation/first_rows/gps.csv
  3. +40
    -1
      data_preparation/first_rows/rpe.csv
  4. +40
    -1
      data_preparation/first_rows/wellness.csv
  5. +3
    -2
      data_preparation/printFirstFewRows.py
  6. +18
    -0
      data_preparation/vectorization_ex.py

+ 40
- 1
data_preparation/first_rows/games.csv View File

@ -1 +1,40 @@
['\ufeffGameID,Date,Tournament,TournamentGame,Team,Opponent,Outcome,TeamPoints,TeamPointsAllowed\n', '1,2017-11-30,Dubai,1,Canada,Spain,W,19,0\n', '2,2017-11-30,Dubai,2,Canada,Ireland,W,31,0\n', '3,2017-11-30,Dubai,3,Canada,Fiji,W,31,14\n', '4,2017-12-01,Dubai,4,Canada,France,W,24,19\n', '5,2017-12-01,Dubai,5,Canada,Australia,L,7,25\n', '6,2017-12-01,Dubai,6,Canada,Russia,L,5,10\n', '7,2018-01-26,Sydney,1,Canada,Fiji,W,24,12\n', '8,2018-01-26,Sydney,2,Canada,Ireland,W,24,12\n', '9,2018-01-26,Sydney,3,Canada,Russia,W,19,5\n', '10,2018-01-27,Sydney,4,Canada,France,W,28,12\n', '11,2018-01-27,Sydney,5,Canada,New Zealand,L,0,26\n', '12,2018-01-28,Sydney,6,Canada,Russia,W,40,12\n', '13,2018-04-13,Commonwealth,1,Canada,South Africa,W,29,0\n', '14,2018-04-13,Commonwealth,2,Canada,Kenya,W,24,12\n', '15,2018-04-14,Commonwealth,3,Canada,New Zealand,L,7,24\n', '16,2018-04-15,Commonwealth,4,Canada,Australia,L,7,33\n', '17,2018-04-15,Commonwealth,5,Canada,England,L,19,24\n', '18,2018-04-21,Kitakyushu,1,Canada,Fiji,W,38,14\n', '19,2018-04-21,Kitakyushu,2,Canada,England,L,19,21\n']
GameID,Date,Tournament,TournamentGame,Team,Opponent,Outcome,TeamPoints,TeamPointsAllowed
1,2017-11-30,Dubai,1,Canada,Spain,W,19,0
2,2017-11-30,Dubai,2,Canada,Ireland,W,31,0
3,2017-11-30,Dubai,3,Canada,Fiji,W,31,14
4,2017-12-01,Dubai,4,Canada,France,W,24,19
5,2017-12-01,Dubai,5,Canada,Australia,L,7,25
6,2017-12-01,Dubai,6,Canada,Russia,L,5,10
7,2018-01-26,Sydney,1,Canada,Fiji,W,24,12
8,2018-01-26,Sydney,2,Canada,Ireland,W,24,12
9,2018-01-26,Sydney,3,Canada,Russia,W,19,5
10,2018-01-27,Sydney,4,Canada,France,W,28,12
11,2018-01-27,Sydney,5,Canada,New Zealand,L,0,26
12,2018-01-28,Sydney,6,Canada,Russia,W,40,12
13,2018-04-13,Commonwealth,1,Canada,South Africa,W,29,0
14,2018-04-13,Commonwealth,2,Canada,Kenya,W,24,12
15,2018-04-14,Commonwealth,3,Canada,New Zealand,L,7,24
16,2018-04-15,Commonwealth,4,Canada,Australia,L,7,33
17,2018-04-15,Commonwealth,5,Canada,England,L,19,24
18,2018-04-21,Kitakyushu,1,Canada,Fiji,W,38,14
19,2018-04-21,Kitakyushu,2,Canada,England,L,19,21

+ 40
- 1
data_preparation/first_rows/gps.csv View File

@ -1 +1,40 @@
['GameID,Half,PlayerID,FrameID,Time,GameClock,Speed,AccelImpulse,AccelLoad,AccelX,AccelY,AccelZ,Longitude,Latitude\n', '1,1,2,1,00:22:01,00:00:00,0.65833386,0.6111116,0.005330055775340482,0.1325,0.69875,0.565,55.466666,24.99487317\n', '1,1,2,2,00:22:01,00:00:00,0.59444492,0.6388894,0.0065681174768838745,0.11125,0.9199999999999999,0.70625,55.46666633,24.99487367\n', '1,1,2,3,00:22:01,00:00:00,0.36388918,2.3055574,0.003114314124166962,0.01375,0.77,0.6775,55.46666683,24.99487383\n', '1,1,2,4,00:22:01,00:00:00,0.4444448,0.80555619999999994,0.0026018184905968666,0.00625,0.88625,0.595,55.46666717,24.99487417\n', '1,1,2,5,00:22:01,00:00:00,0.40000032,0.4444448,0.0038131387595548402,-0.017499999999999998,0.8575,0.57375,55.46666783,24.994874\n', '1,1,2,6,00:22:01,00:00:00,0,4.0000032,0.0030357852445959373,-0.06375,0.9037499999999999,0.55125,55.46666817,24.99487417\n', '1,1,2,7,00:22:01,00:00:00,0,0,0.004433123674069088,-0.06875,1.0175,0.45375,55.4666685,24.994874\n', '1,1,2,8,00:22:01,00:00:00,0,0,0.00541869611211891,-0.0975,1.08625,0.365,55.466669,24.994874\n', '1,1,2,9,00:22:01,00:00:00,0,0,0.005841307840687845,-0.13,0.8887499999999999,0.53625,55.46666917,24.99487383\n', '1,1,2,10,00:22:02,00:00:01,0,0,0.007464539226093879,-0.1775,0.8525,0.58875,55.46666917,24.99487383\n', '1,1,2,11,00:22:02,00:00:01,0,0,0.005548698158773078,-0.16749999999999998,0.9087500000000001,0.5525,55.46666917,24.99487367\n', '1,1,2,12,00:22:02,00:00:01,0,0,0.006430762460071173,-0.10875,0.9137500000000001,0.55875,55.46666933,24.99487333\n', '1,1,2,13,00:22:02,00:00:01,0.39722254,3.9722254,0.00507912007908566,-0.05875,0.86375,0.5925,55.46666933,24.99487267\n', '1,1,2,14,00:22:02,00:00:01,0.37222252,0.2500002,0.00404378877347331,-0.01375,0.84375,0.60375,55.4666695,24.99487217\n', '1,1,2,15,00:22:02,00:00:01,0.34166694,0.3055558,0.0015182830462427488,0.057499999999999996,0.895,0.6112500000000001,55.46666933,24.994872\n', '1,1,2,16,00:22:02,00:00:01,0.37222252,0.3055558,0.002377113995150987,0.0825,0.87875,0.5925,55.46666917,24.99487183\n', '1,1,2,17,00:22:02,00:00:01,0,3.7222252,0.003826218867270637,0.12625,0.84,0.61625,55.46666917,24.99487167\n', '1,1,2,18,00:22:02,00:00:01,0,0,0.004909086745507464,0.07625,0.9400000000000001,0.58,55.46666917,24.99487167\n', '1,1,2,19,00:22:02,00:00:01,0,0,0.0065297404465723494,-0.011250000000000001,0.8625,0.605,55.4666695,24.99487183\n']
GameID,Half,PlayerID,FrameID,Time,GameClock,Speed,AccelImpulse,AccelLoad,AccelX,AccelY,AccelZ,Longitude,Latitude
1,1,2,1,00:22:01,00:00:00,0.65833386,0.6111116,0.005330055775340482,0.1325,0.69875,0.565,55.466666,24.99487317
1,1,2,2,00:22:01,00:00:00,0.59444492,0.6388894,0.0065681174768838745,0.11125,0.9199999999999999,0.70625,55.46666633,24.99487367
1,1,2,3,00:22:01,00:00:00,0.36388918,2.3055574,0.003114314124166962,0.01375,0.77,0.6775,55.46666683,24.99487383
1,1,2,4,00:22:01,00:00:00,0.4444448,0.80555619999999994,0.0026018184905968666,0.00625,0.88625,0.595,55.46666717,24.99487417
1,1,2,5,00:22:01,00:00:00,0.40000032,0.4444448,0.0038131387595548402,-0.017499999999999998,0.8575,0.57375,55.46666783,24.994874
1,1,2,6,00:22:01,00:00:00,0,4.0000032,0.0030357852445959373,-0.06375,0.9037499999999999,0.55125,55.46666817,24.99487417
1,1,2,7,00:22:01,00:00:00,0,0,0.004433123674069088,-0.06875,1.0175,0.45375,55.4666685,24.994874
1,1,2,8,00:22:01,00:00:00,0,0,0.00541869611211891,-0.0975,1.08625,0.365,55.466669,24.994874
1,1,2,9,00:22:01,00:00:00,0,0,0.005841307840687845,-0.13,0.8887499999999999,0.53625,55.46666917,24.99487383
1,1,2,10,00:22:02,00:00:01,0,0,0.007464539226093879,-0.1775,0.8525,0.58875,55.46666917,24.99487383
1,1,2,11,00:22:02,00:00:01,0,0,0.005548698158773078,-0.16749999999999998,0.9087500000000001,0.5525,55.46666917,24.99487367
1,1,2,12,00:22:02,00:00:01,0,0,0.006430762460071173,-0.10875,0.9137500000000001,0.55875,55.46666933,24.99487333
1,1,2,13,00:22:02,00:00:01,0.39722254,3.9722254,0.00507912007908566,-0.05875,0.86375,0.5925,55.46666933,24.99487267
1,1,2,14,00:22:02,00:00:01,0.37222252,0.2500002,0.00404378877347331,-0.01375,0.84375,0.60375,55.4666695,24.99487217
1,1,2,15,00:22:02,00:00:01,0.34166694,0.3055558,0.0015182830462427488,0.057499999999999996,0.895,0.6112500000000001,55.46666933,24.994872
1,1,2,16,00:22:02,00:00:01,0.37222252,0.3055558,0.002377113995150987,0.0825,0.87875,0.5925,55.46666917,24.99487183
1,1,2,17,00:22:02,00:00:01,0,3.7222252,0.003826218867270637,0.12625,0.84,0.61625,55.46666917,24.99487167
1,1,2,18,00:22:02,00:00:01,0,0,0.004909086745507464,0.07625,0.9400000000000001,0.58,55.46666917,24.99487167
1,1,2,19,00:22:02,00:00:01,0,0,0.0065297404465723494,-0.011250000000000001,0.8625,0.605,55.4666695,24.99487183

+ 40
- 1
data_preparation/first_rows/rpe.csv View File

@ -1 +1,40 @@
['Date,PlayerID,Training,SessionType,Duration,RPE,SessionLoad,DailyLoad,AcuteLoad,ChronicLoad,AcuteChronicRatio,ObjectiveRating,FocusRating,BestOutOfMyself\n', '2018-07-21,13,Yes,Mobility/Recovery,5,0,0,446,323.1,303.25,1.07,NA,NA,Not at all\n', '2018-07-21,13,Yes,Game,29,7,203,NA,NA,NA,NA,NA,NA,Not at all\n', '2018-07-21,13,Yes,Game,27,9,243,NA,NA,NA,NA,NA,NA,Not at all\n', '2018-07-20,11,Yes,Game,36,6,216,534,256.3,344.18,0.74,9,10,Absolutely\n', '2018-07-20,11,Yes,Game,36,8,288,NA,NA,NA,NA,9,10,Absolutely\n', '2018-07-20,11,Yes,Mobility/Recovery,15,2,30,NA,NA,NA,NA,9,10,Absolutely\n', '2018-07-20,13,Yes,Game,27,6,162,306,259.4,287.32,0.9,NA,NA,Not at all\n', '2018-07-20,13,Yes,Game,24,6,144,NA,NA,NA,NA,NA,NA,Not at all\n', '2018-07-20,13,Yes,Mobility/Recovery,10,0,0,NA,NA,NA,NA,NA,NA,Not at all\n', '2018-07-19,1,Yes,Skills,60,3,180,180,87.9,140.54,0.63,NA,NA,NA\n', '2018-07-19,2,Yes,Skills,60,4,240,240,117.1,279.96,0.42,NA,NA,NA\n', '2018-07-19,6,Yes,Conditioning,20,9,180,380,107.1,301.54,0.36,8,8,NA\n', '2018-07-19,6,Yes,Strength,30,4,120,NA,NA,NA,NA,8,8,NA\n', '2018-07-19,6,Yes,Combat,20,4,80,NA,NA,NA,NA,8,8,NA\n', '2018-07-19,7,Yes,Skills,60,5,300,300,141.4,342.32,0.41,NA,NA,NA\n', '2018-07-19,10,Yes,Skills,75,4,300,300,122.1,250,0.49,NA,NA,NA\n', '2018-07-19,11,Yes,Skills,90,5,450,450,180,325.11,0.55,9,9,Absolutely\n', '2018-07-19,13,Yes,Skills,90,6,540,540,215.7,276.39,0.78,NA,NA,Not at all\n', '2018-07-19,13,Yes,Mobility/Recovery,30,0,0,NA,NA,NA,NA,NA,NA,Not at all\n']
Date,PlayerID,Training,SessionType,Duration,RPE,SessionLoad,DailyLoad,AcuteLoad,ChronicLoad,AcuteChronicRatio,ObjectiveRating,FocusRating,BestOutOfMyself
2018-07-21,13,Yes,Mobility/Recovery,5,0,0,446,323.1,303.25,1.07,NA,NA,Not at all
2018-07-21,13,Yes,Game,29,7,203,NA,NA,NA,NA,NA,NA,Not at all
2018-07-21,13,Yes,Game,27,9,243,NA,NA,NA,NA,NA,NA,Not at all
2018-07-20,11,Yes,Game,36,6,216,534,256.3,344.18,0.74,9,10,Absolutely
2018-07-20,11,Yes,Game,36,8,288,NA,NA,NA,NA,9,10,Absolutely
2018-07-20,11,Yes,Mobility/Recovery,15,2,30,NA,NA,NA,NA,9,10,Absolutely
2018-07-20,13,Yes,Game,27,6,162,306,259.4,287.32,0.9,NA,NA,Not at all
2018-07-20,13,Yes,Game,24,6,144,NA,NA,NA,NA,NA,NA,Not at all
2018-07-20,13,Yes,Mobility/Recovery,10,0,0,NA,NA,NA,NA,NA,NA,Not at all
2018-07-19,1,Yes,Skills,60,3,180,180,87.9,140.54,0.63,NA,NA,NA
2018-07-19,2,Yes,Skills,60,4,240,240,117.1,279.96,0.42,NA,NA,NA
2018-07-19,6,Yes,Conditioning,20,9,180,380,107.1,301.54,0.36,8,8,NA
2018-07-19,6,Yes,Strength,30,4,120,NA,NA,NA,NA,8,8,NA
2018-07-19,6,Yes,Combat,20,4,80,NA,NA,NA,NA,8,8,NA
2018-07-19,7,Yes,Skills,60,5,300,300,141.4,342.32,0.41,NA,NA,NA
2018-07-19,10,Yes,Skills,75,4,300,300,122.1,250,0.49,NA,NA,NA
2018-07-19,11,Yes,Skills,90,5,450,450,180,325.11,0.55,9,9,Absolutely
2018-07-19,13,Yes,Skills,90,6,540,540,215.7,276.39,0.78,NA,NA,Not at all
2018-07-19,13,Yes,Mobility/Recovery,30,0,0,NA,NA,NA,NA,NA,NA,Not at all

+ 40
- 1
data_preparation/first_rows/wellness.csv View File

@ -1 +1,40 @@
['Date,PlayerID,Fatigue,Soreness,Desire,Irritability,BedTime,WakeTime,SleepHours,SleepQuality,MonitoringScore,Pain,Illness,Menstruation,Nutrition,NutritionAdjustment,USGMeasurement,USG,TrainingReadiness\n', '2018-07-21,1,3,3,2,3,23:00:00,07:00:00,8,2,13,No,No,Yes,Excellent,Yes,No,NA,0%\n', '2018-07-21,2,4,3,4,4,23:00:00,07:00:00,8,4,19,Yes,No,Yes,NA,NA,Yes,1.01,0%\n', '2018-07-21,3,3,3,5,4,22:30:00,06:30:00,8,4,19,No,No,No,NA,NA,Yes,1.016,100%\n', '2018-07-21,4,2,3,5,4,00:30:00,07:00:00,6.5,1,15,No,No,Yes,Excellent,Yes,Yes,1.025,95%\n', '2018-07-21,5,5,3,4,4,23:45:00,07:00:00,7.25,4,20,No,No,No,Okay,Yes,Yes,1.022,100%\n', '2018-07-21,7,2,2,5,4,22:00:00,07:00:00,9,3,16,No,No,No,Excellent,Yes,Yes,1.014,95%\n', '2018-07-21,10,2,2,4,4,22:30:00,05:45:00,7.25,3,15,No,Slightly Off,No,Excellent,Yes,Yes,1.017,70%\n', '2018-07-21,11,4,3,6,4,23:00:00,07:00:00,8,3,20,No,Slightly Off,No,Excellent,Yes,Yes,1.013,100%\n', '2018-07-21,13,4,3,5,4,23:15:00,07:15:00,8,4,20,No,No,No,Excellent,Yes,Yes,1.025,100%\n', '2018-07-21,14,3,3,4,4,22:15:00,07:00:00,8.75,4,18,No,No,No,Excellent,Yes,Yes,1.015,100%\n', '2018-07-21,15,4,3,6,5,22:30:00,07:00:00,8.5,7,25,No,No,No,Excellent,Yes,No,NA,95%\n', '2018-07-21,16,3,2,5,3,23:00:00,07:00:00,8,2,15,No,No,No,Okay,Yes,Yes,1.14,100%\n', '2018-07-20,1,3,4,3,4,23:00:00,07:00:00,8,2,16,No,No,Yes,Excellent,Yes,Yes,1.019,0%\n', '2018-07-20,2,4,4,5,4,22:00:00,07:00:00,9,3,20,Yes,No,Yes,NA,NA,Yes,1.017,0%\n', '2018-07-20,3,4,4,6,4,22:30:00,06:30:00,8,4,22,No,No,No,NA,NA,Yes,1.016,100%\n', '2018-07-20,4,4,5,6,4,23:00:00,07:00:00,8,3,22,No,No,Yes,Excellent,Yes,Yes,1.019,95%\n', '2018-07-20,5,5,6,6,5,23:45:00,07:00:00,7.25,5,27,No,No,No,Okay,Yes,Yes,1.022,95%\n', '2018-07-20,7,3,4,4,4,22:00:00,07:00:00,9,4,19,No,No,No,Excellent,Yes,Yes,1.014,100%\n', '2018-07-20,10,3,4,4,4,22:30:00,07:00:00,8.5,3,18,No,Slightly Off,No,Excellent,Yes,Yes,1.016,60%\n']
Date,PlayerID,Fatigue,Soreness,Desire,Irritability,BedTime,WakeTime,SleepHours,SleepQuality,MonitoringScore,Pain,Illness,Menstruation,Nutrition,NutritionAdjustment,USGMeasurement,USG,TrainingReadiness
2018-07-21,1,3,3,2,3,23:00:00,07:00:00,8,2,13,No,No,Yes,Excellent,Yes,No,NA,0%
2018-07-21,2,4,3,4,4,23:00:00,07:00:00,8,4,19,Yes,No,Yes,NA,NA,Yes,1.01,0%
2018-07-21,3,3,3,5,4,22:30:00,06:30:00,8,4,19,No,No,No,NA,NA,Yes,1.016,100%
2018-07-21,4,2,3,5,4,00:30:00,07:00:00,6.5,1,15,No,No,Yes,Excellent,Yes,Yes,1.025,95%
2018-07-21,5,5,3,4,4,23:45:00,07:00:00,7.25,4,20,No,No,No,Okay,Yes,Yes,1.022,100%
2018-07-21,7,2,2,5,4,22:00:00,07:00:00,9,3,16,No,No,No,Excellent,Yes,Yes,1.014,95%
2018-07-21,10,2,2,4,4,22:30:00,05:45:00,7.25,3,15,No,Slightly Off,No,Excellent,Yes,Yes,1.017,70%
2018-07-21,11,4,3,6,4,23:00:00,07:00:00,8,3,20,No,Slightly Off,No,Excellent,Yes,Yes,1.013,100%
2018-07-21,13,4,3,5,4,23:15:00,07:15:00,8,4,20,No,No,No,Excellent,Yes,Yes,1.025,100%
2018-07-21,14,3,3,4,4,22:15:00,07:00:00,8.75,4,18,No,No,No,Excellent,Yes,Yes,1.015,100%
2018-07-21,15,4,3,6,5,22:30:00,07:00:00,8.5,7,25,No,No,No,Excellent,Yes,No,NA,95%
2018-07-21,16,3,2,5,3,23:00:00,07:00:00,8,2,15,No,No,No,Okay,Yes,Yes,1.14,100%
2018-07-20,1,3,4,3,4,23:00:00,07:00:00,8,2,16,No,No,Yes,Excellent,Yes,Yes,1.019,0%
2018-07-20,2,4,4,5,4,22:00:00,07:00:00,9,3,20,Yes,No,Yes,NA,NA,Yes,1.017,0%
2018-07-20,3,4,4,6,4,22:30:00,06:30:00,8,4,22,No,No,No,NA,NA,Yes,1.016,100%
2018-07-20,4,4,5,6,4,23:00:00,07:00:00,8,3,22,No,No,Yes,Excellent,Yes,Yes,1.019,95%
2018-07-20,5,5,6,6,5,23:45:00,07:00:00,7.25,5,27,No,No,No,Okay,Yes,Yes,1.022,95%
2018-07-20,7,3,4,4,4,22:00:00,07:00:00,9,4,19,No,No,No,Excellent,Yes,Yes,1.014,100%
2018-07-20,10,3,4,4,4,22:30:00,07:00:00,8.5,3,18,No,Slightly Off,No,Excellent,Yes,Yes,1.016,60%

+ 3
- 2
data_preparation/printFirstFewRows.py View File

@ -1,6 +1,7 @@
FILENAME = ".csv"
file = open("data/wellness.csv")
file = open("data/games.csv")
n = 20
head = [next(file) for x in range(20)]
print(head)
for line in head:
print(line)

+ 18
- 0
data_preparation/vectorization_ex.py View File

@ -0,0 +1,18 @@
import pandas as pd
# read in CSV
df = pd.read_csv('cleaned/wellness.csv')
# print out column uniques
print(df["Illness"].unique())
# make dictionary of unique values and their associated values
illness = {'No': 0, 'Slightly Off': 0.5, 'Yes': 1}
# iterate through new column vectorize
df["IllnessNum"] = [illness[item] for item in df["Illness"]]
df.to_csv('cleaned/wellness.csv')
print(df["Illness"])
print(df["IllnessNum"])

Loading…
Cancel
Save