In January 2016, I started filling out a quick form after each workout. My goal is to summarize the key metrics to give me clear pointers — supported by data — on where to improve.
According to my own training logs, how do I exercise?
I use Typeform.com thanks to their nice interface when completing the form. Unfortunately, the data is far from tidy. For example, the answer to a multiple choice question has been recoded into one column per answer, so I have to melt those columns into a categorical variable. For details, see the code.
I have written a python script where I clean the data, and summarize some key metrics — such as (a) distribution of total training time per workout, (b) stretching time per workout, (c) total cardio time per week, and (d) having a 50/50 split between upper/lower strength training.
- I train my upper body just as often as my lower body.
- I split my training into: cardio, legs, chest, back, and yoga. The leg workouts are longer than the chest workouts.
- The time I spend on stretching is too little.
- There are too many weeks that I have not done any cardio at all. I should do at least one cardio session per week.
The code, as of 2017-11-12, can be found on Pastebin.
Below I have pasted the code needed to reach those 4 conclusions.
## 1. # frequency table print(df['Daycategory'].value_counts() / df['Daycategory'].count() * 100) # concl: good split of types ## 2. # Hist for legdays pd.DataFrame.hist(df[df.Legday==True], column='Muscles_time') plt.title('Muscles_time for Legdays') # Hist for chestdays pd.DataFrame.hist(df[df.Chestday==True], column='Muscles_time') plt.title('Muscles_time for Chestdays') ## 3. # Stretch_time print(df['Stretch_time'].describe()) # concl: Stretch_time must go up! stretch every session! ## 4. # Cardio_time and Muscles_time, per week tbl1 = pd.pivot_table(df, index='Week', values=['Cardio_time', 'Muscles_time'], aggfunc='sum') n_days = (df['Datetime'].max() - df['Datetime'].min()) n_days = (n_days / np.timedelta64(1, 'D')).astype(int) n_weeks = n_days / 7 print(tbl1[tbl1.Cardio_time == 0].Cardio_time.count() / n_weeks * 100) # concl: too many weeks that I do zero cardio!
In the future, I plan to use the “typeform” package to pull the data directly from the web. Then I can make the python script publish som key metrics directly on jacoblindberg.com/workout Giving out that link to a few friends will create a public commitment to workout, and ask them to harrass me when I haven’t trained. I can also see my key metrics without having to run the script on my computer.