Sport Activities Analysis

Looking at the sport activities that the sport watch collected, it is really telling something interesting story.

Inspired by Dr. G., I think I should tell more stories using the data rather than only pictures. Google Charts provide some very good examples. I was planning to embed that google chart code in my website. But I found that, actually I can used the current platform to achieve my goal. I used the markdown file as default. But it also support the R markdown, which is a more flexible file. In the R markdown file, I can plot using data.

Sports Activities

Learning by doing. The past two-year data collected from the watch is very interesting.

From the time series figure of 2017 to 2018, it includes swimming, cycling, running and others (walking and fitness). The swimming activity showed two peaks. One peak at May, and the other peak at October and November. For my understand, I swam a lot of times during May because the exciting feel of the new watch. The second peak was due to the transition time between cycling and winter sports. My cycling activity mainly occurred at summer time.

2017 Sports Activities

The python code for the time series plotting was displayed as the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 12:16:37 2020

@author: peter
"""

import pandas as pd
import matplotlib.pyplot as plt

# Import Data
swim17 = [0,14,5,9,8,4,12,12,0,1,2,1]
cycle17 = [0,6,9,10,4,2,2,0,0,0,0,0]
run17 = [0,0,0,0,0,0,2,0,4,3,0,0]
other17 = [0,6,0,0,0,0,0,0,2,0,0,0]
dates17 = pd.date_range('2017-03-31', periods=12, freq='M')

# Define the upper limit, lower limit, interval of Y axis and colors
y_LL = -1
y_UL = 15
y_interval = 3
mycolors = ['tab:red', 'tab:blue', 'tab:green', 'tab:orange']    

# Draw Plot and Annotate
fig, ax = plt.subplots(1,1,figsize=(16, 9), dpi=80)

plt.plot(dates17, swim17, color='tab:red', linestyle='dotted')
plt.text(dates17[6], swim17[6]+0.5, 'swim17', fontsize=14, color='tab:red')

plt.plot(dates17, cycle17, color='tab:blue', linestyle='dashed')
plt.text(dates17[2], cycle17[2]+1, 'cycle17', fontsize=14, color='tab:blue')

plt.plot(dates17, run17, color='tab:grey', linestyle='solid')     
plt.text(dates17[9], run17[9]+0.5, 'run17', fontsize=14, color='tab:grey')

plt.plot(dates17, other17, color='tab:orange', linestyle='dashdot')   
plt.text(dates17[2], other17[2]+1, 'other17', fontsize=14, color='tab:orange')

# Other plot properties
plt.grid(alpha=.2)
plt.title('Sport Activities: 2017/04-2018/03', fontsize=20)
plt.xticks(fontsize=14)  
plt.yticks(range(y_LL+1, y_UL, y_interval), fontsize=14)     
plt.ylim(y_LL, y_UL)  

Then, the pie chart tells that swimming occupied 58% of the recorded activities from 2017/04 to 2018/03. Cycling has 28%.

2017 Sports Activities

For the second year (2018/04 to 2019/03), there is only one high peak for swimming that happened at July. That time was supposed to be a good time for cycling. But last year, the rains and flash flood made the cycling environment not so friendly. Another highlight was the XC skiing activity, I learned from February, 2019. But you can tell I skiied 10 times in 2 months, that's roughly 1 time per week.

2018 Sports Activities

In terms of the pie chart, the swimming activity was still in a dominant position. It was in that position, and I think it will still be in that position. The new activity of XC skiing contributes to 10%. Considering the new activities just in two months, the potential can not be ignored.

2018 Sports Activities

updatedupdated2020-06-192020-06-19