Analysing Garmin Sleep Data with Python and Power BI

Luka Kovacevic
4 min readMay 26, 2024
Power BI Dashboard of my sleep data

As someone keen on optimising my sleep patterns and improving wake time consistency, I embarked on a journey to analyse my sleep data using Python and Power BI. This post outlines the steps I took, from extracting data from my Garmin device to visualising it in Power BI, providing insights into my sleep patterns and areas for improvement.

Objectives

  • Understand My Sleep Patterns Better: Analyse my nightly rest to identify trends and gain insights.
  • Improve Wake-Up Consistency: Aim for a more regular wake-up time to enhance daily energy and well-being.

Overview of Steps

  1. Download Your Garmin Data: Visit the Garmin Connect IQ site and export your data.
  2. Locate the Sleep Data: Extract the zipped JSON format data, and navigate to DI_CONNECT then DI_Connect_Wellness where the JSON files are stored by date.
  3. Save and Extract Data: Save these files into a folder on your computer.
  4. Python Data Extraction: Using Python, extract the data into a pandas DataFrame.
  5. Data Cleaning: Remove any null values to ensure data accuracy.
  6. Save as CSV: Save the cleaned DataFrame as a CSV file.
  7. Connect to Power BI

--

--