Would you like to know how your mood impact your sleep and how your parents influence your happiness levels?

Become a data nerd, and track it!

🤔 What on earth is all this? (aka data sources)

In October 2018 I started tracking several metrics about myself.

Every day I score my mood, sleep, vitamins I’m taking, and many other variables. Later, I also implemented a weekly review practice to log average times spent on different activities (e.g. work time), gratefulness, favourite quotes etc.

Data Collection

The daily and weekly reviews were logged in using online forms—daily one filled in the evening or morning the next day, weekly at the end of every Sunday. Starting from Google Forms in 2018, I then moved the forms to Coda and, in early 2020, to Airtable.

Weekly activity data (e.g. time spent on paid work, or self-improvement) were tracked daily using Toggl. The sums from the week were logged in at the end of the week.

Sleep data–duration of deep sleep and the total sleep time—were tracked using an Oura ring, with a weekly average logged at the end of the week.


In mid-2020 I accumulated enough data, or rather enough data analytical skills to investigate the results._ Are there any patterns? Correlations? What’s the coolest looking chart I can plot?_

This post below is a human-friendly summary of the process, stand-out results, and the nicest charts. 👌

The full Jupyter notebook includes a list of many ideas for further analysis.

Let’s get the numbers: data access

You can access the freshest version of the data using the Airtable API, and this awesome Python wrapper.

import os
	from pprint import pprint
	from airtable import Airtable
	import pandas as pd
	from datetime import date

	base_key = '<your base key>'
	table_name = 'Daily Tracking'
	airtable = Airtable(base_key, table_name, api_key='<your api key')

	#get all records from the airtable database
	records = airtable.get_all()

	#create a dataframe from the airtable data
	df = pd.DataFrame.from_records((r['fields'] for r in records))

	#create dates
	today = date.today()
	today_string = today.strftime("%d-%m-%Y")

	#export to csv with an appropriate name
	df.to_csv(r'/Users/<yourusername>/Dataprojects/LifeTrackingData/Life-tracking{}.csv'.format(today_string))
view raw
python_wrapper_airtable.py hosted with ❤ by GitHub

We do the same with the data frame with weekly stats and, voila, we have two pandas data frames to work with.

Let’s see what they can tell us.

🆙 Ups, downs, and Pearson

With all the mood data we can plot some delightful charts.

For instance, here is a function that plots two chosen moods over a selected number of days

#data-visualization #visualization #nlp #pandas #data-analysis #data analysis

Is mango sticky rice correlated with productivity?
1.25 GEEK