sleep logo sleep: summary

1 2 3 4 5 6 7 8 9
Notes

You can get this dataset by downloading it directly. You can also fetch it from the command line by running;

wget https://calmcode.io/datasets/sleep.csv

The original research paper of the dataset can be found on arxiv. Feel free to check the datasets portion of the website to see some details about the dataset.

With that out of the way. Let's write our first summary for this analysis.

import numpy as np
import pandas as pd
import matplotlib.pylab as plt
df = pd.read_csv("/<path>/sleep.csv")

(df
  .groupby('sleep')
  .agg(n=('id', 'count'),
      mean_unit_tests=('passed_unit_tests', np.mean),
      mean_asserts=('passed_asserts', np.mean),
      mean_user_stories=('tackled_user_stories', np.mean),))