Repository where I mostly put random python scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

428 lines
95 KiB

  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "import os\n",
  10. "import matplotlib.pyplot as plt\n",
  11. "import pandas as pd"
  12. ]
  13. },
  14. {
  15. "cell_type": "code",
  16. "execution_count": 2,
  17. "metadata": {},
  18. "outputs": [
  19. {
  20. "name": "stdout",
  21. "output_type": "stream",
  22. "text": [
  23. " logId dateOfSleep startTime endTime \\\n",
  24. "0 22919218280 2019-07-01 2019-06-30T21:42:30.000 2019-07-01T06:53:00.000 \n",
  25. "1 22907959315 2019-06-30 2019-06-29T22:50:30.000 2019-06-30T08:22:30.000 \n",
  26. "2 22896495948 2019-06-29 2019-06-28T23:00:30.000 2019-06-29T07:34:30.000 \n",
  27. "3 22885271917 2019-06-28 2019-06-27T23:25:30.000 2019-06-28T07:01:00.000 \n",
  28. "4 22873469544 2019-06-27 2019-06-27T00:22:30.000 2019-06-27T06:37:30.000 \n",
  29. "5 22859901781 2019-06-26 2019-06-25T23:10:30.000 2019-06-26T06:41:30.000 \n",
  30. "6 22835159082 2019-06-24 2019-06-23T22:23:30.000 2019-06-24T06:34:30.000 \n",
  31. "7 22835159081 2019-06-23 2019-06-22T23:07:00.000 2019-06-23T06:42:00.000 \n",
  32. "8 22835159080 2019-06-22 2019-06-22T01:42:00.000 2019-06-22T07:36:30.000 \n",
  33. "9 22799331499 2019-06-21 2019-06-20T22:55:00.000 2019-06-21T06:35:30.000 \n",
  34. "10 22786383973 2019-06-20 2019-06-19T22:24:00.000 2019-06-20T06:22:00.000 \n",
  35. "11 22773778389 2019-06-19 2019-06-18T22:36:00.000 2019-06-19T06:18:00.000 \n",
  36. "12 22762586407 2019-06-18 2019-06-17T22:31:00.000 2019-06-18T06:32:00.000 \n",
  37. "13 22747505160 2019-06-17 2019-06-16T21:56:30.000 2019-06-17T06:30:30.000 \n",
  38. "14 22738149556 2019-06-16 2019-06-15T23:13:00.000 2019-06-16T07:12:30.000 \n",
  39. "15 22723339639 2019-06-15 2019-06-14T23:09:00.000 2019-06-15T07:47:00.000 \n",
  40. "16 22710872408 2019-06-14 2019-06-13T22:16:00.000 2019-06-14T06:12:30.000 \n",
  41. "17 22698921476 2019-06-13 2019-06-12T22:12:30.000 2019-06-13T06:01:30.000 \n",
  42. "18 22681265384 2019-06-12 2019-06-11T22:05:30.000 2019-06-12T06:30:30.000 \n",
  43. "19 22674775396 2019-06-11 2019-06-10T22:07:30.000 2019-06-11T06:32:30.000 \n",
  44. "20 22661124288 2019-06-10 2019-06-09T21:56:00.000 2019-06-10T06:22:00.000 \n",
  45. "21 22648970133 2019-06-09 2019-06-08T22:46:00.000 2019-06-09T07:30:30.000 \n",
  46. "22 22638820465 2019-06-08 2019-06-07T22:14:30.000 2019-06-08T06:50:00.000 \n",
  47. "23 22626446172 2019-06-07 2019-06-06T22:33:30.000 2019-06-07T07:04:30.000 \n",
  48. "24 22615666021 2019-06-06 2019-06-05T22:31:00.000 2019-06-06T06:39:00.000 \n",
  49. "25 22602351745 2019-06-05 2019-06-04T23:03:00.000 2019-06-05T06:39:00.000 \n",
  50. "26 22590503668 2019-06-04 2019-06-03T22:19:00.000 2019-06-04T06:20:00.000 \n",
  51. "27 22576235910 2019-06-03 2019-06-02T22:33:30.000 2019-06-03T06:16:30.000 \n",
  52. "28 22562754522 2019-06-02 2019-06-01T22:49:00.000 2019-06-02T07:00:30.000 \n",
  53. "29 22553516585 2019-06-01 2019-06-01T08:50:30.000 2019-06-01T10:09:30.000 \n",
  54. "30 22550042569 2019-06-01 2019-05-31T23:06:00.000 2019-06-01T04:57:30.000 \n",
  55. "\n",
  56. " duration minutesToFallAsleep minutesAsleep minutesAwake \\\n",
  57. "0 33000000 0 481 69 \n",
  58. "1 34320000 0 492 80 \n",
  59. "2 30840000 0 432 82 \n",
  60. "3 27300000 0 387 68 \n",
  61. "4 22500000 0 319 56 \n",
  62. "5 27060000 0 387 64 \n",
  63. "6 29460000 0 415 76 \n",
  64. "7 27300000 0 400 55 \n",
  65. "8 21240000 0 304 50 \n",
  66. "9 27600000 0 380 80 \n",
  67. "10 28680000 0 422 56 \n",
  68. "11 27720000 0 395 67 \n",
  69. "12 28860000 0 408 73 \n",
  70. "13 30840000 0 452 62 \n",
  71. "14 28740000 0 406 73 \n",
  72. "15 31080000 0 451 67 \n",
  73. "16 28560000 0 413 63 \n",
  74. "17 28140000 0 386 83 \n",
  75. "18 30300000 0 441 64 \n",
  76. "19 30300000 0 446 59 \n",
  77. "20 30360000 0 454 52 \n",
  78. "21 31440000 0 445 79 \n",
  79. "22 30900000 0 449 66 \n",
  80. "23 30660000 0 432 79 \n",
  81. "24 29280000 0 416 72 \n",
  82. "25 27360000 0 377 79 \n",
  83. "26 28860000 0 435 46 \n",
  84. "27 27780000 0 400 63 \n",
  85. "28 29460000 0 434 57 \n",
  86. "29 4740000 0 76 3 \n",
  87. "30 21060000 0 299 52 \n",
  88. "\n",
  89. " minutesAfterWakeup timeInBed efficiency type infoCode \\\n",
  90. "0 8 550 89 stages 0 \n",
  91. "1 0 572 90 stages 0 \n",
  92. "2 0 514 94 stages 0 \n",
  93. "3 1 455 84 stages 0 \n",
  94. "4 0 375 92 stages 0 \n",
  95. "5 0 451 86 stages 0 \n",
  96. "6 5 491 92 stages 0 \n",
  97. "7 0 455 93 stages 0 \n",
  98. "8 0 354 93 stages 0 \n",
  99. "9 0 460 91 stages 0 \n",
  100. "10 0 478 95 stages 0 \n",
  101. "11 0 462 87 stages 0 \n",
  102. "12 14 481 87 stages 0 \n",
  103. "13 1 514 89 stages 0 \n",
  104. "14 1 479 86 stages 0 \n",
  105. "15 0 518 89 stages 0 \n",
  106. "16 0 476 88 stages 0 \n",
  107. "17 0 469 93 stages 0 \n",
  108. "18 1 505 88 stages 0 \n",
  109. "19 3 505 92 stages 0 \n",
  110. "20 0 506 93 stages 0 \n",
  111. "21 0 524 94 stages 0 \n",
  112. "22 0 515 92 stages 0 \n",
  113. "23 0 511 84 stages 0 \n",
  114. "24 0 488 89 stages 0 \n",
  115. "25 0 456 86 stages 0 \n",
  116. "26 1 481 84 stages 0 \n",
  117. "27 2 463 91 stages 0 \n",
  118. "28 1 491 89 stages 0 \n",
  119. "29 0 79 96 classic 2 \n",
  120. "30 0 351 85 stages 0 \n",
  121. "\n",
  122. " levels mainSleep \n",
  123. "0 {'summary': {'deep': {'count': 5, 'minutes': 9... True \n",
  124. "1 {'summary': {'deep': {'count': 4, 'minutes': 1... True \n",
  125. "2 {'summary': {'deep': {'count': 4, 'minutes': 1... True \n",
  126. "3 {'summary': {'deep': {'count': 3, 'minutes': 9... True \n",
  127. "4 {'summary': {'deep': {'count': 5, 'minutes': 7... True \n",
  128. "5 {'summary': {'deep': {'count': 3, 'minutes': 8... True \n",
  129. "6 {'summary': {'deep': {'count': 2, 'minutes': 6... True \n",
  130. "7 {'summary': {'deep': {'count': 3, 'minutes': 8... True \n",
  131. "8 {'summary': {'deep': {'count': 2, 'minutes': 6... True \n",
  132. "9 {'summary': {'deep': {'count': 2, 'minutes': 7... True \n",
  133. "10 {'summary': {'deep': {'count': 4, 'minutes': 9... True \n",
  134. "11 {'summary': {'deep': {'count': 2, 'minutes': 7... True \n",
  135. "12 {'summary': {'deep': {'count': 2, 'minutes': 6... True \n",
  136. "13 {'summary': {'deep': {'count': 4, 'minutes': 9... True \n",
  137. "14 {'summary': {'deep': {'count': 3, 'minutes': 8... True \n",
  138. "15 {'summary': {'deep': {'count': 4, 'minutes': 1... True \n",
  139. "16 {'summary': {'deep': {'count': 2, 'minutes': 6... True \n",
  140. "17 {'summary': {'deep': {'count': 4, 'minutes': 8... True \n",
  141. "18 {'summary': {'deep': {'count': 6, 'minutes': 9... True \n",
  142. "19 {'summary': {'deep': {'count': 3, 'minutes': 1... True \n",
  143. "20 {'summary': {'deep': {'count': 4, 'minutes': 1... True \n",
  144. "21 {'summary': {'deep': {'count': 5, 'minutes': 9... True \n",
  145. "22 {'summary': {'deep': {'count': 5, 'minutes': 1... True \n",
  146. "23 {'summary': {'deep': {'count': 4, 'minutes': 7... True \n",
  147. "24 {'summary': {'deep': {'count': 4, 'minutes': 6... True \n",
  148. "25 {'summary': {'deep': {'count': 3, 'minutes': 8... True \n",
  149. "26 {'summary': {'deep': {'count': 6, 'minutes': 1... True \n",
  150. "27 {'summary': {'deep': {'count': 5, 'minutes': 9... True \n",
  151. "28 {'summary': {'deep': {'count': 6, 'minutes': 8... True \n",
  152. "29 {'summary': {'restless': {'count': 2, 'minutes... False \n",
  153. "30 {'summary': {'deep': {'count': 4, 'minutes': 8... True \n"
  154. ]
  155. }
  156. ],
  157. "source": [
  158. "sleep_df = pd.read_json(\"data/sleep-2019-06-01.json\", convert_dates=True)\n",
  159. "print(sleep_df)"
  160. ]
  161. },
  162. {
  163. "cell_type": "code",
  164. "execution_count": 3,
  165. "metadata": {},
  166. "outputs": [
  167. {
  168. "data": {
  169. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAEWCAYAAABYGk2QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAZ20lEQVR4nO3df5TV9X3n8dcLBuSHIggoKiBa1CCg8vvHTIJN2jSJniTtdtMYm21a1q05Jttk091tl02jm5o0uzlrmppuk2h+bFTSTdI9ycaYmhZiM8OvAURQkGJFgSiIg/weYYT3/vH9juc6c2fuvcO985kLz8c5c5i53+/9fN/3cuc1n/v+3vu5jggBAPrfoNQFAMC5igAGgEQIYABIhAAGgEQIYABIhAAGgEQI4Dpi+yO2m1PXUYzt/2L7/iqOd9T2Vfn337L951Uc+29sf7pa4xWMa9vftP2q7XXVHh9nHwJ4gLHdZHuV7UO2D9husT0vcU0/t/2a7SO2D9veYP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yuoLAQygYoMHD9aiRYve9LZk2g+VI4AB9EnXNgQBXDkCGECfFC7MExEswNMHDakLAFCf5s2bpy1btuj48ePat2+fIkJXXnll6rLqCgEMoE9GjBih66+/XuvWrdPu3bvV1NQk26nLqisEMIA+61wXYvfu3az/0Af0gAH0WeeJOE7A9Q0BDKDPCmfAN9xwQ+py6g4tCAB9Nn78eE2cOFGTJk1SQwNxUinuMQBnZMmSJZo0aVLqMuoSLQic8zhzf2buvfde/dfX/0f
  170. "text/plain": [
  171. "<Figure size 432x288 with 1 Axes>"
  172. ]
  173. },
  174. "metadata": {
  175. "needs_background": "light"
  176. },
  177. "output_type": "display_data"
  178. }
  179. ],
  180. "source": [
  181. "ax = plt.gca()\n",
  182. "ax.set_title('Sleep Distribution for June')\n",
  183. "ax.boxplot(sleep_df['minutesAsleep']/60, vert=False,manage_ticks=False, notch=True)\n",
  184. "plt.xlabel(\"Hours Asleep\")\n",
  185. "ax.set_yticks([])\n",
  186. "plt.show()"
  187. ]
  188. },
  189. {
  190. "cell_type": "code",
  191. "execution_count": 4,
  192. "metadata": {},
  193. "outputs": [
  194. {
  195. "data": {
  196. "text/plain": [
  197. "<matplotlib.axes._subplots.AxesSubplot at 0x7f61966bb050>"
  198. ]
  199. },
  200. "execution_count": 4,
  201. "metadata": {},
  202. "output_type": "execute_result"
  203. },
  204. {
  205. "data": {
  206. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAANmklEQVR4nO3dX4hc93nG8edplBahNYqN7Kmqmm4uTKjrpQINbsE3s6RJVOtCdqnBphgJu6wv4hLo3mzTixhMQJQqvihtqYyNdZF4McTGwjJpVZGNCATa2SC6UlVjk2xd/WGFsKJ4jWhZ++3FO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0O0vI+3U9MSKDre57438MlIAGBSegQNAUgQcAJIi4ACQFAEHgKQIOAAkRcABIKk0LyPE8AzqJZud4CWbQOd4Bg4ASRFwAEiKgANAUgQcAJLaUMBt77f9nu0PbM/0aygAQHs9B9z25yT9vaQ/lvSgpKdsP9ivwQAAd7aRZ+APS/ogIn4WEf8naVbSwf6MBQBoxxHR24H2n0raHxF/Xl5/WtIfRMTza/abkjRVXv2SpPd6H3cgdkm6VvUQmwDrUGAdCqxDYbOsw+9ExL1rN27kjTxuse22/xpExDFJxzbwOANluxkR9arnqBrrUGAdCqxDYbOvw0ZOoVyUdP+q678t6fLGxgEAdGojAf93SQ/Y/qLtX5f0pKQT/RkLANBOz6dQImLF9vOS/lnS5yS9GhHn+zbZ8Gza0ztDxjoUWIcC61DY1OvQ8//EBABUi3diAkBSBBwAktqSAbf9hO3ztj+zXV9z21+
  207. "text/plain": [
  208. "<Figure size 432x288 with 1 Axes>"
  209. ]
  210. },
  211. "metadata": {
  212. "needs_background": "light"
  213. },
  214. "output_type": "display_data"
  215. }
  216. ],
  217. "source": [
  218. "startTimes = pd.to_datetime(sleep_df['startTime'])\n",
  219. "sleep = pd.to_datetime(sleep_df['startTime']).dt.hour -12 + pd.to_datetime(sleep_df['startTime']).dt.minute/60\n",
  220. "sleep.hist()"
  221. ]
  222. },
  223. {
  224. "cell_type": "code",
  225. "execution_count": 5,
  226. "metadata": {},
  227. "outputs": [
  228. {
  229. "data": {
  230. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEWCAYAAAB/tMx4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAbM0lEQVR4nO3de3hV9Z3v8fc33ClihktFFEwtyKNAQaGKgYFiC6NyVxTCLdmZzun0mY4zPaf2+Dxtz2nPmTnT2+N0OuM8nj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FVVFfv27WuwTUVFBePGjSM3Nzd7hYmXFOAiWdS+fXsKCgooLy9vsI1On0iqFOAiWVZcXExZWRk1NTUXbauqquL48eOMHj06hsrENwpwkSy79dZbyc3NpbKy8qJttQtX5eToV1Map58SkRjUdzHzs88+Y8GCBRQVFcVTlHhHAS4SgxkzZrBy5UqOHz9+4bnly5czePBgbrjhhhgrE58owEVi0LVrV8aOHcvChQsvPKeLl9JUCnCRmNS96fH+/fvZtGkTU6ZMibkq8YkCXCQmY8aM4cCBA2zbto3y8nKmTZtGhw4d4i5LPNI67gJErlStWrWiqKiIJ554ghUrVrBo0aK4SxLPKMBFYlRUVET//v256aabGDJkSNzliGcU4CIx6tOnD8OHD2fy5Mm6abE0mc6BS9YpqP7YypUreejoj+Iuwxv6+fkDBbhIzDp27Bh3CeIpBbiIiKcU4CIinlKAi4h4SgEuIuIpBbiIiKcU4CIinlKAi4h4SgEuIuIpBbiIiKcU4CIinlKAi4h4SgEuIuI
  231. "text/plain": [
  232. "<Figure size 432x288 with 1 Axes>"
  233. ]
  234. },
  235. "metadata": {
  236. "needs_background": "light"
  237. },
  238. "output_type": "display_data"
  239. }
  240. ],
  241. "source": [
  242. "ax = plt.gca()\n",
  243. "ax.set_title('Fall asleep times')\n",
  244. "ax.boxplot(sleep, vert=False,manage_ticks=False, notch=True)\n",
  245. "plt.xlabel(\"Time went to Bed\")\n",
  246. "plt.xlim(8, 12)\n",
  247. "ax.set_yticks([])\n",
  248. "plt.show()"
  249. ]
  250. },
  251. {
  252. "cell_type": "code",
  253. "execution_count": 6,
  254. "metadata": {},
  255. "outputs": [],
  256. "source": [
  257. "def getAllSleepData():\n",
  258. " files = os.listdir(\"data\")\n",
  259. " dfs = []\n",
  260. " for file in files: # this can take 15 seconds\n",
  261. " if \"sleep-\" in file: # finds the steps files\n",
  262. " dfs.append(pd.read_json(\"data/\" + file, convert_dates=['startTime', 'endTime']))\n",
  263. " return pd.concat(dfs)"
  264. ]
  265. },
  266. {
  267. "cell_type": "code",
  268. "execution_count": 7,
  269. "metadata": {},
  270. "outputs": [],
  271. "source": [
  272. "sleep_df = getAllSleepData()"
  273. ]
  274. },
  275. {
  276. "cell_type": "code",
  277. "execution_count": 8,
  278. "metadata": {},
  279. "outputs": [],
  280. "source": [
  281. "sleep_df['start'] = sleep_df['startTime'].dt.hour - 12 + sleep_df['startTime'].dt.minute/60\n",
  282. "sleep_df['end'] = sleep_df['endTime'].dt.hour + sleep_df['endTime'].dt.minute/60"
  283. ]
  284. },
  285. {
  286. "cell_type": "code",
  287. "execution_count": 9,
  288. "metadata": {},
  289. "outputs": [
  290. {
  291. "data": {
  292. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWcAAAEWCAYAAAC6xlbpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAVVUlEQVR4nO3de5ScdX3H8c8nm4UAIQGyCYEksiRsdjZGpRBt5CYX8dRr0NqatLZKQW3Lwes5VsFaz2np0bSiHO3B04LiOWqsYL3AabkFDpIolyRQIN3ZLORCLpILlyQkJNlsvv1jnsVxSTYzu7Pz/LLzfp2TMzPPPM8z34ddPvPb7/zmeRwRAgCkZVTeBQAAXotwBoAEEc4AkCDCGQASRDgDQIIIZwBIEOGMurP9Fds/yLuOgdj+ju2/z7sONC7CGYdl+4u2/7vfsu5DLJtf3+qqZ/t1tl8u+xe2d5U9Pj8i/joi/jHvWtG4RuddAI4Iv5L0BdtNEdFre7KkZkln9Vt2RrZu0iLiWUlj+x7bDklvioin86sK+H2MnFGJR1UK4zOzxxdIul9SV79lz0TEJkmyfYPt9bZ32F5u+/yD7dh2s+1Ftn9q+yjbo2x/wfYztp+3/RPbJ2XrXmh7Q7/t19p+e3b/K7Zvs/2ftnfaXmH7TYM5YNu32P6n8te1/XnbW2z/1vZltt9le5XtF2xfU7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jnIEM4YwkFItFzZs3T93d3ert7c27HCB3hDOS0NnZqTlz5qilpUXr1q3Luxwgd4QzklAsFlUoFFQoFGhtACKckYBt27apt7d
  293. "text/plain": [
  294. "<Figure size 432x288 with 1 Axes>"
  295. ]
  296. },
  297. "metadata": {
  298. "needs_background": "light"
  299. },
  300. "output_type": "display_data"
  301. }
  302. ],
  303. "source": [
  304. "ax = plt.gca()\n",
  305. "ax.set_title('Wakeup Time')\n",
  306. "ax.boxplot(sleep_df['end'], vert=False,manage_ticks=False, notch=True)\n",
  307. "plt.xlabel(\"Wakeup Time\")\n",
  308. "ax.set_yticks([])\n",
  309. "plt.xlim(4, 10)\n",
  310. "plt.show()"
  311. ]
  312. },
  313. {
  314. "cell_type": "code",
  315. "execution_count": 10,
  316. "metadata": {},
  317. "outputs": [
  318. {
  319. "data": {
  320. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEWCAYAAAB/tMx4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAZKElEQVR4nO3df5TddX3n8ec7kwQmMIGGhJ/mhyGYM8mExZxYaaGUrNa21kK723rqIVuRVMsRTd1T16LZdnFpaO26Z6Xaiqvpqqsb667VWlcB60aT4KIGBWaSgSEkhmAYCD9iBpKYOHz2j+/3Zq+Xmcydud9773wnz8c598y931/3fT/JvOYzn898v99IKSFJKp9p7S5AkjQxBrgklZQBLkklZYBLUkkZ4JJUUga4JJWUAa4TIuJ9EfGJdtcxlUTE1RHxeLvr0NRkgJ9CIuL5qseLEXGk6vV1KaXbUkp/0II67oqI91S9vigi0ijLzm/wvcYM0Ij4ZET8eQPvsTwi7o6I5yLiYETcFxGvn+jxpHoZ4KeQlNKZlQfwGPCbVcs+28JStgC/XPX6KuChEZY9klIabGFdE/VPwNeB84BzgXXAobZWpFO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VTpA3zTpk309PTQ0dFBT08PmzZtandJktQS09tdQCM2bdrE+vXr2bhxI1deeSXbtm1j7dq1ALzpTW9qc3WS1Fyl7oFv2LCBjRs3snr1ambMmMHq1avZuHEjGzZsaHdpktR0kVKa8M6rVq1K27dvL7Cc8eno6ODo0aPMmDHjxLLjx49z+umnMzw83La6miEi2l3CpNb
  321. "text/plain": [
  322. "<Figure size 432x288 with 1 Axes>"
  323. ]
  324. },
  325. "metadata": {
  326. "needs_background": "light"
  327. },
  328. "output_type": "display_data"
  329. }
  330. ],
  331. "source": [
  332. "ax = plt.gca()\n",
  333. "ax.set_title('Time Went to Sleep')\n",
  334. "ax.boxplot(sleep_df['start'], vert=False,manage_ticks=False, notch=True)\n",
  335. "plt.xlabel(\"Time went to sleep\")\n",
  336. "ax.set_yticks([])\n",
  337. "plt.xlim(8, 12)\n",
  338. "plt.show()"
  339. ]
  340. },
  341. {
  342. "cell_type": "code",
  343. "execution_count": 11,
  344. "metadata": {},
  345. "outputs": [],
  346. "source": [
  347. "sleep_df['weekday'] = sleep_df['startTime'].dt.weekday"
  348. ]
  349. },
  350. {
  351. "cell_type": "code",
  352. "execution_count": 12,
  353. "metadata": {},
  354. "outputs": [
  355. {
  356. "data": {
  357. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZMAAAEcCAYAAAAC+llsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3dd3gc5bX48e+R5SK5V2FLcsUYjMHGjW5MM5geQjEJCaQZSEJJhxt+kJtGSCD3hhJKgFBjcGhJsOlYLsQGGxv3XlVsy7Yk27Jk1fP7Y2Zv1mIlze7O7K6k83mefaTdeeedd3alOTtvFVXFGGOMiUdasgtgjDGm5bNgYowxJm4WTIwxxsTNgokxxpi4WTAxxhgTNwsmxh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KVU/EmfrhroY7uTPTPgpMxemzf507Q60xxpgUFVgwUdV5OPMahb/2nqrWuk9Di+g0NBHYpKpbVLUaeBlnckFjjDEpKpltJt8E3o7wejZHrgVRQNj6GMYYY1JPUkbAu2s81wIvRdoc4bVGu5yJyHRgOkBGRsa43NxIS1X4o76+nrS0lt9noTWch51D6mgN52Hn4M2GDRv2qmrfSNsSHkxE5AacSe7O1cj9kgs4cmGhHCIvmASAqj4JPAkwfvx4XbJkiY+lPVJeXh6TJ08OLP9EaQ3nYeeQOlrSecQyz1lLGT6RiM9BRBpd+TOhwURELsRZWOcsd76kSBYDw0VkCM403tNwBnYZY5KoNVyIGyvP4Dtnse13Fye4NK1LkF2DZ+AstjNCRApE5Fs4i/h0Bd4Xkc9F5HE37QARmQ3gNtB
  358. "text/plain": [
  359. "<Figure size 432x288 with 1 Axes>"
  360. ]
  361. },
  362. "metadata": {
  363. "needs_background": "light"
  364. },
  365. "output_type": "display_data"
  366. }
  367. ],
  368. "source": [
  369. "ax = plt.gca()\n",
  370. "ax.set_title('Steps Distribution for July\\n')\n",
  371. "sleep_df.boxplot(column=['start'], by='weekday',ax=ax, notch=True)\n",
  372. "plt.xlabel(\"Week Day\")\n",
  373. "plt.ylabel(\"Sleep Start\")\n",
  374. "plt.ylim(8, 12)\n",
  375. "plt.show()"
  376. ]
  377. },
  378. {
  379. "cell_type": "code",
  380. "execution_count": 13,
  381. "metadata": {},
  382. "outputs": [
  383. {
  384. "data": {
  385. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEcCAYAAAAydkhNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3deXhU1fnA8e+bsO972Ak7AVQERAXEIAq4b7WKu6K4Rq1tfyi0tlZpa1vbWpfWVtywUq27aFGRBAF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FgLEflERNa5f5v7tX1jjDGV5+eZxIs4QxQEegD4VFV7Ap+6940xxlRTvrZJiEgyMENVS2aoWgOkqupOEWmHMzdBb98CMMYYUylV3SaRpKo7Ady/bap4+8YYY8JQba+4FpEJwASA+vXrD+rUqaxpArxTXFxMQkJst+PbPlQf8bAfsboPmzZtok2bNjRo0ODbfTh69CjZ2dkkJydHO7yIVMV7sXbt2r2q2voHT/g5xCzOEMIrAu6vAdq5/7cD1oRSzqBBg9Rv6enpvm/Db7YP1Uc87Ees7kNCQoLm5+er6nf7kJ+frwkJCVGMqnKq4r0AFmkZx9+q/pnwHs7Y8rh/363i7Rtj4lxKSgrz5s373mPz5s0jJSUlShHFNj+7wE7HGY6gt4hsE5HxwO+Bc0RkHXCOe98YYzwzefJkxo8fT3p6OoWFhaSnpzN+/HgmT54c7dBikm9tEqo6LshTo/zapjHGjBvnHHrS0tLIzMwkJSWFKVOmfPu4CU+1bbg2xphIjRs3jnHjxpGRkUFqamq0w4lpsdd1wRhjTJWxJGGMMSYoSxLGGGOCsiRhjDEmKEsSxhhjgrIkYYw
  386. "text/plain": [
  387. "<Figure size 432x288 with 1 Axes>"
  388. ]
  389. },
  390. "metadata": {
  391. "needs_background": "light"
  392. },
  393. "output_type": "display_data"
  394. }
  395. ],
  396. "source": [
  397. "ax = plt.gca()\n",
  398. "ax.set_title('Wake Up Time')\n",
  399. "sleep_df.boxplot(column=['end'], by='weekday',ax=ax, notch=True)\n",
  400. "plt.xlabel(\"Week Day\")\n",
  401. "plt.ylabel(\"Sleep Start\")\n",
  402. "plt.ylim(5, 10)\n",
  403. "plt.show()"
  404. ]
  405. }
  406. ],
  407. "metadata": {
  408. "kernelspec": {
  409. "display_name": "Python 3",
  410. "language": "python",
  411. "name": "python3"
  412. },
  413. "language_info": {
  414. "codemirror_mode": {
  415. "name": "ipython",
  416. "version": 3
  417. },
  418. "file_extension": ".py",
  419. "mimetype": "text/x-python",
  420. "name": "python",
  421. "nbconvert_exporter": "python",
  422. "pygments_lexer": "ipython3",
  423. "version": "3.7.6"
  424. }
  425. },
  426. "nbformat": 4,
  427. "nbformat_minor": 4
  428. }