1103 lines
150 KiB
Plaintext
1103 lines
150 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 1,
|
|||
|
"id": "c15c9866",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"import pandas as pd\n",
|
|||
|
"import re\n",
|
|||
|
"import os\n",
|
|||
|
"import sys\n",
|
|||
|
"\n",
|
|||
|
"from tabulate import tabulate\n",
|
|||
|
"\n",
|
|||
|
"nb_dir = os.path.split(os.getcwd())[0]\n",
|
|||
|
"if nb_dir not in sys.path:\n",
|
|||
|
" sys.path.append(nb_dir)\n",
|
|||
|
"\n",
|
|||
|
"import participants.query_db\n",
|
|||
|
"from features.screen import *"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 2,
|
|||
|
"id": "91e8d1f0",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/html": [
|
|||
|
"<div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>id</th>\n",
|
|||
|
" <th>_id</th>\n",
|
|||
|
" <th>timestamp</th>\n",
|
|||
|
" <th>device_id</th>\n",
|
|||
|
" <th>screen_status</th>\n",
|
|||
|
" <th>participant_id</th>\n",
|
|||
|
" <th>username</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>0</th>\n",
|
|||
|
" <td>11923</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>1581933295955</td>\n",
|
|||
|
" <td>78082f9f-98c2-468d-b4a2-7c835bd812bd</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>13</td>\n",
|
|||
|
" <td>uploader_20449</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1</th>\n",
|
|||
|
" <td>11960</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>1581933741144</td>\n",
|
|||
|
" <td>78082f9f-98c2-468d-b4a2-7c835bd812bd</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>13</td>\n",
|
|||
|
" <td>uploader_20449</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>2</th>\n",
|
|||
|
" <td>11961</td>\n",
|
|||
|
" <td>3</td>\n",
|
|||
|
" <td>1581933741213</td>\n",
|
|||
|
" <td>78082f9f-98c2-468d-b4a2-7c835bd812bd</td>\n",
|
|||
|
" <td>3</td>\n",
|
|||
|
" <td>13</td>\n",
|
|||
|
" <td>uploader_20449</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>3</th>\n",
|
|||
|
" <td>11969</td>\n",
|
|||
|
" <td>4</td>\n",
|
|||
|
" <td>1581933914555</td>\n",
|
|||
|
" <td>78082f9f-98c2-468d-b4a2-7c835bd812bd</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>13</td>\n",
|
|||
|
" <td>uploader_20449</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>4</th>\n",
|
|||
|
" <td>11970</td>\n",
|
|||
|
" <td>5</td>\n",
|
|||
|
" <td>1581933967403</td>\n",
|
|||
|
" <td>78082f9f-98c2-468d-b4a2-7c835bd812bd</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>13</td>\n",
|
|||
|
" <td>uploader_20449</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>310182</th>\n",
|
|||
|
" <td>408335</td>\n",
|
|||
|
" <td>9405</td>\n",
|
|||
|
" <td>1626151058187</td>\n",
|
|||
|
" <td>4b62a655-cbf0-4ac0-a448-06726f45b56a</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>90</td>\n",
|
|||
|
" <td>uploader_53573</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>310183</th>\n",
|
|||
|
" <td>408336</td>\n",
|
|||
|
" <td>9406</td>\n",
|
|||
|
" <td>1626152741826</td>\n",
|
|||
|
" <td>4b62a655-cbf0-4ac0-a448-06726f45b56a</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>90</td>\n",
|
|||
|
" <td>uploader_53573</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>310184</th>\n",
|
|||
|
" <td>408337</td>\n",
|
|||
|
" <td>9407</td>\n",
|
|||
|
" <td>1626152742536</td>\n",
|
|||
|
" <td>4b62a655-cbf0-4ac0-a448-06726f45b56a</td>\n",
|
|||
|
" <td>3</td>\n",
|
|||
|
" <td>90</td>\n",
|
|||
|
" <td>uploader_53573</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>310185</th>\n",
|
|||
|
" <td>408338</td>\n",
|
|||
|
" <td>9408</td>\n",
|
|||
|
" <td>1626152746336</td>\n",
|
|||
|
" <td>4b62a655-cbf0-4ac0-a448-06726f45b56a</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>90</td>\n",
|
|||
|
" <td>uploader_53573</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>310186</th>\n",
|
|||
|
" <td>408339</td>\n",
|
|||
|
" <td>9409</td>\n",
|
|||
|
" <td>1626152746350</td>\n",
|
|||
|
" <td>4b62a655-cbf0-4ac0-a448-06726f45b56a</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>90</td>\n",
|
|||
|
" <td>uploader_53573</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"<p>310187 rows × 7 columns</p>\n",
|
|||
|
"</div>"
|
|||
|
],
|
|||
|
"text/plain": [
|
|||
|
" id _id timestamp device_id \\\n",
|
|||
|
"0 11923 1 1581933295955 78082f9f-98c2-468d-b4a2-7c835bd812bd \n",
|
|||
|
"1 11960 2 1581933741144 78082f9f-98c2-468d-b4a2-7c835bd812bd \n",
|
|||
|
"2 11961 3 1581933741213 78082f9f-98c2-468d-b4a2-7c835bd812bd \n",
|
|||
|
"3 11969 4 1581933914555 78082f9f-98c2-468d-b4a2-7c835bd812bd \n",
|
|||
|
"4 11970 5 1581933967403 78082f9f-98c2-468d-b4a2-7c835bd812bd \n",
|
|||
|
"... ... ... ... ... \n",
|
|||
|
"310182 408335 9405 1626151058187 4b62a655-cbf0-4ac0-a448-06726f45b56a \n",
|
|||
|
"310183 408336 9406 1626152741826 4b62a655-cbf0-4ac0-a448-06726f45b56a \n",
|
|||
|
"310184 408337 9407 1626152742536 4b62a655-cbf0-4ac0-a448-06726f45b56a \n",
|
|||
|
"310185 408338 9408 1626152746336 4b62a655-cbf0-4ac0-a448-06726f45b56a \n",
|
|||
|
"310186 408339 9409 1626152746350 4b62a655-cbf0-4ac0-a448-06726f45b56a \n",
|
|||
|
"\n",
|
|||
|
" screen_status participant_id username \n",
|
|||
|
"0 0 13 uploader_20449 \n",
|
|||
|
"1 1 13 uploader_20449 \n",
|
|||
|
"2 3 13 uploader_20449 \n",
|
|||
|
"3 0 13 uploader_20449 \n",
|
|||
|
"4 1 13 uploader_20449 \n",
|
|||
|
"... ... ... ... \n",
|
|||
|
"310182 2 90 uploader_53573 \n",
|
|||
|
"310183 1 90 uploader_53573 \n",
|
|||
|
"310184 3 90 uploader_53573 \n",
|
|||
|
"310185 0 90 uploader_53573 \n",
|
|||
|
"310186 2 90 uploader_53573 \n",
|
|||
|
"\n",
|
|||
|
"[310187 rows x 7 columns]"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 2,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"participants_inactive_usernames = participants.query_db.get_usernames()\n",
|
|||
|
"df_screen_inactive = get_screen_data(participants_inactive_usernames)\n",
|
|||
|
"df_screen_inactive"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"id": "ad829a51",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"##### Demonstration of the functioning of the function *identify_screen_sequence*"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"id": "b90a0c12",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stderr",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"/home/ivan/IJS/straw2analysis/features/screen.py:121: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only\n",
|
|||
|
" df_screen[[\"device_id\", \"participant_id\"]]\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/html": [
|
|||
|
"<div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>participant_id</th>\n",
|
|||
|
" <th>device_id</th>\n",
|
|||
|
" <th>sequence_type</th>\n",
|
|||
|
" <th>beginning</th>\n",
|
|||
|
" <th>end</th>\n",
|
|||
|
" <th>duration</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>0</th>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>unlock</td>\n",
|
|||
|
" <td>1615293112969</td>\n",
|
|||
|
" <td>1615293173309</td>\n",
|
|||
|
" <td>60340</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1</th>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>unlock</td>\n",
|
|||
|
" <td>1615293658662</td>\n",
|
|||
|
" <td>1615293690054</td>\n",
|
|||
|
" <td>31392</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>2</th>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>unlock</td>\n",
|
|||
|
" <td>1615295718916</td>\n",
|
|||
|
" <td>1615295758055</td>\n",
|
|||
|
" <td>39139</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>3</th>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>unlock</td>\n",
|
|||
|
" <td>1615298325519</td>\n",
|
|||
|
" <td>1615298437787</td>\n",
|
|||
|
" <td>112268</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>4</th>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>unlock</td>\n",
|
|||
|
" <td>1615300829591</td>\n",
|
|||
|
" <td>1615302061324</td>\n",
|
|||
|
" <td>1231733</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>84061</th>\n",
|
|||
|
" <td>55</td>\n",
|
|||
|
" <td>ffd2bd86-e427-4e58-911b-f803898be134</td>\n",
|
|||
|
" <td>check</td>\n",
|
|||
|
" <td>1615541984037</td>\n",
|
|||
|
" <td>1615541986753</td>\n",
|
|||
|
" <td>2716</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>84062</th>\n",
|
|||
|
" <td>55</td>\n",
|
|||
|
" <td>ffd2bd86-e427-4e58-911b-f803898be134</td>\n",
|
|||
|
" <td>check</td>\n",
|
|||
|
" <td>1615542689686</td>\n",
|
|||
|
" <td>1615542692116</td>\n",
|
|||
|
" <td>2430</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>84063</th>\n",
|
|||
|
" <td>55</td>\n",
|
|||
|
" <td>ffd2bd86-e427-4e58-911b-f803898be134</td>\n",
|
|||
|
" <td>check</td>\n",
|
|||
|
" <td>1615542812361</td>\n",
|
|||
|
" <td>1615542814928</td>\n",
|
|||
|
" <td>2567</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>84064</th>\n",
|
|||
|
" <td>55</td>\n",
|
|||
|
" <td>ffd2bd86-e427-4e58-911b-f803898be134</td>\n",
|
|||
|
" <td>check</td>\n",
|
|||
|
" <td>1615542921422</td>\n",
|
|||
|
" <td>1615542924725</td>\n",
|
|||
|
" <td>3303</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>84065</th>\n",
|
|||
|
" <td>55</td>\n",
|
|||
|
" <td>ffd2bd86-e427-4e58-911b-f803898be134</td>\n",
|
|||
|
" <td>check</td>\n",
|
|||
|
" <td>1615543040302</td>\n",
|
|||
|
" <td>1615543043454</td>\n",
|
|||
|
" <td>3152</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"<p>84066 rows × 6 columns</p>\n",
|
|||
|
"</div>"
|
|||
|
],
|
|||
|
"text/plain": [
|
|||
|
" participant_id device_id sequence_type \\\n",
|
|||
|
"0 75 01594408-b636-4842-bd0d-f925f10544a9 unlock \n",
|
|||
|
"1 75 01594408-b636-4842-bd0d-f925f10544a9 unlock \n",
|
|||
|
"2 75 01594408-b636-4842-bd0d-f925f10544a9 unlock \n",
|
|||
|
"3 75 01594408-b636-4842-bd0d-f925f10544a9 unlock \n",
|
|||
|
"4 75 01594408-b636-4842-bd0d-f925f10544a9 unlock \n",
|
|||
|
"... ... ... ... \n",
|
|||
|
"84061 55 ffd2bd86-e427-4e58-911b-f803898be134 check \n",
|
|||
|
"84062 55 ffd2bd86-e427-4e58-911b-f803898be134 check \n",
|
|||
|
"84063 55 ffd2bd86-e427-4e58-911b-f803898be134 check \n",
|
|||
|
"84064 55 ffd2bd86-e427-4e58-911b-f803898be134 check \n",
|
|||
|
"84065 55 ffd2bd86-e427-4e58-911b-f803898be134 check \n",
|
|||
|
"\n",
|
|||
|
" beginning end duration \n",
|
|||
|
"0 1615293112969 1615293173309 60340 \n",
|
|||
|
"1 1615293658662 1615293690054 31392 \n",
|
|||
|
"2 1615295718916 1615295758055 39139 \n",
|
|||
|
"3 1615298325519 1615298437787 112268 \n",
|
|||
|
"4 1615300829591 1615302061324 1231733 \n",
|
|||
|
"... ... ... ... \n",
|
|||
|
"84061 1615541984037 1615541986753 2716 \n",
|
|||
|
"84062 1615542689686 1615542692116 2430 \n",
|
|||
|
"84063 1615542812361 1615542814928 2567 \n",
|
|||
|
"84064 1615542921422 1615542924725 3303 \n",
|
|||
|
"84065 1615543040302 1615543043454 3152 \n",
|
|||
|
"\n",
|
|||
|
"[84066 rows x 6 columns]"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"sequences = identify_screen_sequence(df_screen_inactive)\n",
|
|||
|
"sequences"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"id": "c4ae6ce4",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"##### Demonstration of the heuristics for identifying sequences"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 4,
|
|||
|
"id": "3e06bc77",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"def colored(r, g, b, text):\n",
|
|||
|
" return \"\\033[38;2;{};{};{}m{} \\033[38;2;255;255;255m\".format(r, g, b, text)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 5,
|
|||
|
"id": "b4d13772",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/html": [
|
|||
|
"<div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>id</th>\n",
|
|||
|
" <th>_id</th>\n",
|
|||
|
" <th>timestamp</th>\n",
|
|||
|
" <th>device_id</th>\n",
|
|||
|
" <th>screen_status</th>\n",
|
|||
|
" <th>participant_id</th>\n",
|
|||
|
" <th>username</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>147311</th>\n",
|
|||
|
" <td>234981</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>1615292823847</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>147312</th>\n",
|
|||
|
" <td>234982</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>1615293112969</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>147313</th>\n",
|
|||
|
" <td>234983</td>\n",
|
|||
|
" <td>3</td>\n",
|
|||
|
" <td>1615293116729</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>3</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>147314</th>\n",
|
|||
|
" <td>234984</td>\n",
|
|||
|
" <td>4</td>\n",
|
|||
|
" <td>1615293173282</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>147315</th>\n",
|
|||
|
" <td>234985</td>\n",
|
|||
|
" <td>5</td>\n",
|
|||
|
" <td>1615293173309</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>223048</th>\n",
|
|||
|
" <td>313095</td>\n",
|
|||
|
" <td>2205</td>\n",
|
|||
|
" <td>1617121606309</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>223049</th>\n",
|
|||
|
" <td>313096</td>\n",
|
|||
|
" <td>2206</td>\n",
|
|||
|
" <td>1617121606327</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>222957</th>\n",
|
|||
|
" <td>313099</td>\n",
|
|||
|
" <td>2207</td>\n",
|
|||
|
" <td>1617121649358</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>1</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>222958</th>\n",
|
|||
|
" <td>313100</td>\n",
|
|||
|
" <td>2208</td>\n",
|
|||
|
" <td>1617121654062</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>0</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>222959</th>\n",
|
|||
|
" <td>313101</td>\n",
|
|||
|
" <td>2209</td>\n",
|
|||
|
" <td>1617121654084</td>\n",
|
|||
|
" <td>01594408-b636-4842-bd0d-f925f10544a9</td>\n",
|
|||
|
" <td>2</td>\n",
|
|||
|
" <td>75</td>\n",
|
|||
|
" <td>uploader_73880</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"<p>2209 rows × 7 columns</p>\n",
|
|||
|
"</div>"
|
|||
|
],
|
|||
|
"text/plain": [
|
|||
|
" id _id timestamp device_id \\\n",
|
|||
|
"147311 234981 1 1615292823847 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"147312 234982 2 1615293112969 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"147313 234983 3 1615293116729 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"147314 234984 4 1615293173282 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"147315 234985 5 1615293173309 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"... ... ... ... ... \n",
|
|||
|
"223048 313095 2205 1617121606309 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"223049 313096 2206 1617121606327 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"222957 313099 2207 1617121649358 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"222958 313100 2208 1617121654062 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"222959 313101 2209 1617121654084 01594408-b636-4842-bd0d-f925f10544a9 \n",
|
|||
|
"\n",
|
|||
|
" screen_status participant_id username \n",
|
|||
|
"147311 0 75 uploader_73880 \n",
|
|||
|
"147312 1 75 uploader_73880 \n",
|
|||
|
"147313 3 75 uploader_73880 \n",
|
|||
|
"147314 0 75 uploader_73880 \n",
|
|||
|
"147315 2 75 uploader_73880 \n",
|
|||
|
"... ... ... ... \n",
|
|||
|
"223048 0 75 uploader_73880 \n",
|
|||
|
"223049 2 75 uploader_73880 \n",
|
|||
|
"222957 1 75 uploader_73880 \n",
|
|||
|
"222958 0 75 uploader_73880 \n",
|
|||
|
"222959 2 75 uploader_73880 \n",
|
|||
|
"\n",
|
|||
|
"[2209 rows x 7 columns]"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 5,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"single_device_df = df_screen_inactive[df_screen_inactive[\"device_id\"] == \"01594408-b636-4842-bd0d-f925f10544a9\"]\n",
|
|||
|
"single_device_df.sort_values(\"timestamp\")\n",
|
|||
|
"single_device_df"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 6,
|
|||
|
"id": "420f03cd",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"test_list = single_device_df[\"screen_status\"].tolist()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 7,
|
|||
|
"id": "047bcd40",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"test_string = \"\".join([str(n) for n in test_list])\n",
|
|||
|
"test_timestamps = single_device_df[\"timestamp\"].tolist()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 8,
|
|||
|
"id": "036034e9",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"unlock_pat = re.compile(r\"(?=[0,2]((13|31)(0+|010)2))\")\n",
|
|||
|
"check_pat = re.compile(r\"(?=[0,2](10+))\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 9,
|
|||
|
"id": "1dce2689",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"unlock_events = list()\n",
|
|||
|
"check_events = list()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 10,
|
|||
|
"id": "3d444ccd",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"for match in unlock_pat.finditer(test_string):\n",
|
|||
|
" beginning = match.start(1)\n",
|
|||
|
" end = match.end(1)\n",
|
|||
|
" for n in range(beginning, end):\n",
|
|||
|
" unlock_events.append(n)\n",
|
|||
|
"for match in check_pat.finditer(test_string):\n",
|
|||
|
" beginning = match.start(1)\n",
|
|||
|
" end = match.end(1)\n",
|
|||
|
" for n in range(beginning, end):\n",
|
|||
|
" check_events.append(n)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"id": "c4a84510",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"*Unlock sequences are printed in blue; screen-check sequences are printed in red*"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 11,
|
|||
|
"id": "b039cb7a",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"\u001b[38;2;0;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;25
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;250;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m2 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;0m0 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m1 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m3 \u001b[38;2;255;255;255m\u001b[38;2;0;0;250m0 \u001b[38;
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"for i in range(len(test_string)):\n",
|
|||
|
" if i in unlock_events:\n",
|
|||
|
" print(colored(0,0,250,test_string[i]), end=\"\")\n",
|
|||
|
" elif i in check_events:\n",
|
|||
|
" print(colored(250,0,0,test_string[i]), end=\"\")\n",
|
|||
|
" else:\n",
|
|||
|
" print(colored(0,0,0,test_string[i]), end=\"\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"id": "4a6ac4ff",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"#### Time statistics"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 12,
|
|||
|
"id": "c01428ac",
|
|||
|
"metadata": {
|
|||
|
"scrolled": true
|
|||
|
},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stderr",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"/home/ivan/IJS/straw2analysis/features/screen.py:121: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only\n",
|
|||
|
" df_screen[[\"device_id\", \"participant_id\"]]\n",
|
|||
|
"/home/ivan/anaconda3/envs/straw2analysis/lib/python3.9/site-packages/pandas/core/frame.py:9186: FutureWarning: merging between different levels is deprecated and will be removed in a future version. (1 levels on the left,2 on the right)\n",
|
|||
|
" return merge(\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/html": [
|
|||
|
"<div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>real_usage_time</th>\n",
|
|||
|
" <th>total_usage_time</th>\n",
|
|||
|
" <th>real_usage_time_percentage</th>\n",
|
|||
|
" <th>average_time_between_unlocks</th>\n",
|
|||
|
" <th>average_time_between_checks</th>\n",
|
|||
|
" <th>average_check_duration</th>\n",
|
|||
|
" <th>average_unlock_duration</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>device_id</th>\n",
|
|||
|
" <th>participant_id</th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th></th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>01594408-b636-4842-bd0d-f925f10544a9</th>\n",
|
|||
|
" <th>75</th>\n",
|
|||
|
" <td>59771475</td>\n",
|
|||
|
" <td>816980569</td>\n",
|
|||
|
" <td>0.073161</td>\n",
|
|||
|
" <td>7.185870e+06</td>\n",
|
|||
|
" <td>4.814041e+06</td>\n",
|
|||
|
" <td>16327</td>\n",
|
|||
|
" <td>216062</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>01f86641-b4d6-41d0-b895-7466aee05818</th>\n",
|
|||
|
" <th>16</th>\n",
|
|||
|
" <td>73143920</td>\n",
|
|||
|
" <td>808445844</td>\n",
|
|||
|
" <td>0.090475</td>\n",
|
|||
|
" <td>7.479910e+06</td>\n",
|
|||
|
" <td>1.021231e+07</td>\n",
|
|||
|
" <td>14370</td>\n",
|
|||
|
" <td>303005</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>05befa66-336f-4372-aa33-defab8aa8cbe</th>\n",
|
|||
|
" <th>77</th>\n",
|
|||
|
" <td>417479806</td>\n",
|
|||
|
" <td>1045567754</td>\n",
|
|||
|
" <td>0.399285</td>\n",
|
|||
|
" <td>1.675716e+06</td>\n",
|
|||
|
" <td>8.997918e+06</td>\n",
|
|||
|
" <td>18675</td>\n",
|
|||
|
" <td>502140</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>068045df-9884-4b53-ad1a-a156a80f34d0</th>\n",
|
|||
|
" <th>74</th>\n",
|
|||
|
" <td>229987677</td>\n",
|
|||
|
" <td>894284781</td>\n",
|
|||
|
" <td>0.257175</td>\n",
|
|||
|
" <td>6.381771e+06</td>\n",
|
|||
|
" <td>8.712901e+06</td>\n",
|
|||
|
" <td>710687</td>\n",
|
|||
|
" <td>333589</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>0b435346-73a3-4456-9135-35253cbf57ff</th>\n",
|
|||
|
" <th>88</th>\n",
|
|||
|
" <td>166865446</td>\n",
|
|||
|
" <td>982168538</td>\n",
|
|||
|
" <td>0.169895</td>\n",
|
|||
|
" <td>2.791171e+06</td>\n",
|
|||
|
" <td>7.200347e+06</td>\n",
|
|||
|
" <td>18107</td>\n",
|
|||
|
" <td>242935</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>e83054b4-8cb1-498f-a39b-731bac005340</th>\n",
|
|||
|
" <th>53</th>\n",
|
|||
|
" <td>763717496</td>\n",
|
|||
|
" <td>1402183611</td>\n",
|
|||
|
" <td>0.544663</td>\n",
|
|||
|
" <td>2.665140e+06</td>\n",
|
|||
|
" <td>1.509794e+06</td>\n",
|
|||
|
" <td>19600</td>\n",
|
|||
|
" <td>2133141</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>e9da909a-3fa4-4b4b-bc14-598781ce097f</th>\n",
|
|||
|
" <th>72</th>\n",
|
|||
|
" <td>410824671</td>\n",
|
|||
|
" <td>1018402523</td>\n",
|
|||
|
" <td>0.403401</td>\n",
|
|||
|
" <td>2.077600e+06</td>\n",
|
|||
|
" <td>3.095163e+06</td>\n",
|
|||
|
" <td>7441</td>\n",
|
|||
|
" <td>593345</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>f3ab976e-a4a1-42f4-bf55-c22b6dc83e12</th>\n",
|
|||
|
" <th>60</th>\n",
|
|||
|
" <td>384273678</td>\n",
|
|||
|
" <td>1375484813</td>\n",
|
|||
|
" <td>0.279373</td>\n",
|
|||
|
" <td>1.635691e+06</td>\n",
|
|||
|
" <td>2.113979e+06</td>\n",
|
|||
|
" <td>7945</td>\n",
|
|||
|
" <td>343840</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>fb719001-fe50-4431-98a5-80f1f889f42f</th>\n",
|
|||
|
" <th>15</th>\n",
|
|||
|
" <td>32845387</td>\n",
|
|||
|
" <td>190907398</td>\n",
|
|||
|
" <td>0.172049</td>\n",
|
|||
|
" <td>8.708605e+05</td>\n",
|
|||
|
" <td>8.846072e+05</td>\n",
|
|||
|
" <td>13776</td>\n",
|
|||
|
" <td>104840</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>ffd2bd86-e427-4e58-911b-f803898be134</th>\n",
|
|||
|
" <th>55</th>\n",
|
|||
|
" <td>37981136</td>\n",
|
|||
|
" <td>778802676</td>\n",
|
|||
|
" <td>0.048769</td>\n",
|
|||
|
" <td>7.094376e+06</td>\n",
|
|||
|
" <td>4.912305e+06</td>\n",
|
|||
|
" <td>20441</td>\n",
|
|||
|
" <td>113549</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"<p>70 rows × 7 columns</p>\n",
|
|||
|
"</div>"
|
|||
|
],
|
|||
|
"text/plain": [
|
|||
|
" real_usage_time \\\n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 59771475 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 73143920 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 417479806 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 229987677 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 166865446 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 763717496 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 410824671 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 384273678 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 32845387 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 37981136 \n",
|
|||
|
"\n",
|
|||
|
" total_usage_time \\\n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 816980569 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 808445844 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 1045567754 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 894284781 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 982168538 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 1402183611 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 1018402523 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 1375484813 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 190907398 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 778802676 \n",
|
|||
|
"\n",
|
|||
|
" real_usage_time_percentage \\\n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 0.073161 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 0.090475 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 0.399285 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 0.257175 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 0.169895 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 0.544663 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 0.403401 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 0.279373 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 0.172049 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 0.048769 \n",
|
|||
|
"\n",
|
|||
|
" average_time_between_unlocks \\\n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 7.185870e+06 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 7.479910e+06 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 1.675716e+06 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 6.381771e+06 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 2.791171e+06 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 2.665140e+06 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 2.077600e+06 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 1.635691e+06 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 8.708605e+05 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 7.094376e+06 \n",
|
|||
|
"\n",
|
|||
|
" average_time_between_checks \\\n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 4.814041e+06 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 1.021231e+07 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 8.997918e+06 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 8.712901e+06 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 7.200347e+06 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 1.509794e+06 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 3.095163e+06 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 2.113979e+06 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 8.846072e+05 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 4.912305e+06 \n",
|
|||
|
"\n",
|
|||
|
" average_check_duration \\\n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 16327 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 14370 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 18675 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 710687 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 18107 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 19600 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 7441 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 7945 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 13776 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 20441 \n",
|
|||
|
"\n",
|
|||
|
" average_unlock_duration \n",
|
|||
|
"device_id participant_id \n",
|
|||
|
"01594408-b636-4842-bd0d-f925f10544a9 75 216062 \n",
|
|||
|
"01f86641-b4d6-41d0-b895-7466aee05818 16 303005 \n",
|
|||
|
"05befa66-336f-4372-aa33-defab8aa8cbe 77 502140 \n",
|
|||
|
"068045df-9884-4b53-ad1a-a156a80f34d0 74 333589 \n",
|
|||
|
"0b435346-73a3-4456-9135-35253cbf57ff 88 242935 \n",
|
|||
|
"... ... \n",
|
|||
|
"e83054b4-8cb1-498f-a39b-731bac005340 53 2133141 \n",
|
|||
|
"e9da909a-3fa4-4b4b-bc14-598781ce097f 72 593345 \n",
|
|||
|
"f3ab976e-a4a1-42f4-bf55-c22b6dc83e12 60 343840 \n",
|
|||
|
"fb719001-fe50-4431-98a5-80f1f889f42f 15 104840 \n",
|
|||
|
"ffd2bd86-e427-4e58-911b-f803898be134 55 113549 \n",
|
|||
|
"\n",
|
|||
|
"[70 rows x 7 columns]"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 12,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"time_df = time_screen_sequence(df_screen_inactive)\n",
|
|||
|
"time_df"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 13,
|
|||
|
"id": "2eca8c41",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"import matplotlib"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 14,
|
|||
|
"id": "8ad02cbc",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"def plot_usage_time(df, min_, max_):\n",
|
|||
|
" plotting = time_df.reset_index()[[\"participant_id\",\"real_usage_time\",\"total_usage_time\"]]\n",
|
|||
|
" plotting_subsection = plotting[plotting[\"participant_id\"].isin(list(range(min_, max_)))]\n",
|
|||
|
" plotting_subsection.plot.bar(x=\"participant_id\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 15,
|
|||
|
"id": "11c5fc38",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEVCAYAAADwyx6sAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAfZklEQVR4nO3de5gU9Z398fcRMciCwI5oVFQmrncYBAdFCZHRVTDqTxLXeEsiJi5JCMr6eySaTTRuMAaVqIs3liT8iImIt6hESTS4sGiQ5TpcFBDUWRnxtwKuRCQql8/+0c2kHefSQE93TXFezzOPXZepOt2DZ2qqu76liMDMzFq/vUodwMzMCsOFbmaWEi50M7OUcKGbmaWEC93MLCVc6GZmKVHSQpc0UdI7kpblse7hkp6XtETSTEndipHRzKy1KPUR+iRgcJ7rjgUeiIgK4MfAT1sqlJlZa1TSQo+IWcC7ufMkHSHpD5IWSHpB0jHZRccBz2cfzwDOL2JUM7PEK/URekMmAFdFxInAtcB92fmLgQuyj78EdJRUVoJ8ZmaJtHepA+SS1AE4FXhU0o7Zn8n+91rgHklDgVnAW8DWYmc0M0uqRBU6mb8Y3ouIE+oviIi1wJehrvgviIiNxY1nZpZciTrlEhF/Bt6QdCGAMnplH+8vaUfe7wMTSxTTzCyRSv2xxYeAl4CjJdVK+iZwGfBNSYuBl/nrm58DgZWSXgUOBH5SgshmZoklD59rZpYOiTrlYmZmu86FbmaWEiX7lMv+++8f3bt3L9XuzcxapQULFqyPiK4NLStZoXfv3p358+eXavdmZq2SpP9qbJlPuZiZpYQL3cwsJVzoZmYpkahL/7ds2UJtbS0ffvhhqaNYC2nXrh3dunWjbdu2pY5iljqJKvTa2lo6duxI9+7dyRmcy1IiItiwYQO1tbWUl5eXOo5Z6iTqlMuHH35IWVmZyzylJFFWVua/wMxaSKIKHXCZp5x/vmYtJ3GFbmZmuyZR59Dr6379MwXdXs2Ycwq6vYbsuGBq//33b/F97a677rqLYcOG0b59ewC++MUvMnnyZDp37lzaYGlwU6c81vFw/lZYPkJvQkSwffv2UsdoMXfddRebN2+um542bZrL3KwVc6HXU1NTw7HHHsvw4cPp06cPo0ePpm/fvlRUVPCjH/2obr0hQ4Zw4okncvzxxzNhwoS8t92jR4+66bFjx3LTTTcBMG7cOI477jgqKiq4+OKLAZg7dy6nnnoqvXv35tRTT2XlypUAbN68ma985StUVFRw0UUXcfLJJ9cNo/Dcc89xyimn0KdPHy688EI2bdrUYJZx48axdu1aqqqqqKqqAjJ/Xaxfv56amhqOOeYYrrzySnr06MFll13G9OnT6d+/P0ceeSRz584F4IMPPuAb3/gGffv2pXfv3jz11FM78UqbWaG50BuwcuVKvv71r3Prrbfy1ltvMXfuXKqrq1mwYAGzZs0CYOLEiSxYsID58+czbtw4NmzYsFv7HDNmDIsWLWLJkiWMHz8egGOOOYZZs2axaNEifvzjH/PP//zPANx333106dKFJUuWcMMNN7BgwQIA1q9fz80338z06dNZuHAhlZWV3HHHHQ3u7+qrr+bggw9mxowZzJgx41PLV69ezciRI1myZAkrVqxg8uTJvPjii4wdO5ZbbrkFgJ/85CecfvrpzJs3jxkzZjBq1Cg++OCD3XodzGzXJfoceqkcfvjh9OvXj2uvvZbnnnuO3r17A7Bp0yZWrVrFF77wBcaNG8cTTzwBwJo1a1i1ahVlZWW7vM+Kigouu+wyhgwZwpAhQwDYuHEjl19+OatWrUISW7ZsAeDFF19k5MiRAPTo0YOKigoA5syZwyuvvEL//v0B+PjjjznllFN2KU95eTk9e/YE4Pjjj+eMM85AEj179qSmpgbI/DUwdepUxo4dC2Q+dvrmm29y7LHH7tI+zWz3uNAb8Dd/8zdA5hz697//fb71rW99YvnMmTOZPn06L730Eu3bt2fgwIF5fbZ67733/sQ5+dzveeaZZ5g1axZTp05l9OjRvPzyy9xwww1UVVXxxBNPUFNTw8CBA+tyNSQiOPPMM3nooYd29il/ymc+85m6x3vttVfd9F577cXWrVvr9vf4449z9NFH7/b+zGz3+ZRLEwYNGsTEiRPrzkO/9dZbvPPOO2zcuJEuXbrQvn17VqxYwZw5c/La3oEHHsg777zDhg0b+Oijj3j66acB2L59O2vWrKGqqorbbruN9957j02bNrFx40YOOeQQACZNmlS3nc9//vM88sgjALzyyissXboUgH79+vGnP/2J1atXA5lz7a+++mqjeTp27Mj777+/cy9KjkGDBnH33XfX/YJZtGjRLm/LzHZfoo/Qi/Exw6acddZZLF++vO60RYcOHfjNb37D4MGDGT9+PBUVFRx99NH069cvr+21bduWG2+8kZNPPpny8nKOOeYYALZt28ZXv/pVNm7cSERwzTXX0LlzZ773ve9x+eWXc8cdd3D66afXbWf48OFcfvnlVFRU0Lt3byoqKujUqRNdu3Zl0qRJXHLJJXz00UcA3HzzzRx11FEN5hk2bBhnn302Bx10UIPn0Ztzww038E//9E9UVFQQEXTv3r3ul5SZFV/JbhJdWVkZ9W9wsXz5cp9/zcO2bdvYsmUL7dq147XXXuOMM87g1VdfZZ999il1tLzsET9nfw7dWoikBRFR2dCyRB+hW8M2b95MVVUVW7ZsISK4//77W02Zm1nLcaG3gA0bNnDGGWd8av7zzz+/W5+E2aFjx447dfu+L33pS7zxxhufmHfrrbcyaNCg3c5iZsnhQm8BZWVlVFdXlzpGnR0frzQrCZ9+Khp/ysXMLCVc6GZmKdFsoUuaKOkdScsaWX6ZpCXZr9mSehU+ppmZNSefI/RJwOAmlr8BnBYRFcBoIL+RqszMrKCafVM0ImZJ6t7E8tk5k3OAbgXIlZHPmyk7tb2m33h57733mDx5MsOHD290nZqaGmbPns2ll17a5LZqamo499xzWbaswT9sEqX+8167di1XX301jz32WImTmdnOKPQ59G8Cvy/wNovmvffe47777mtynZqaGiZPnlykRMVR/3kffPDBLnOzVqhghS6pikyhX9fEOsMkzZc0f926dYXadcFcf/31vPbaa5xwwgmMGjWKUaNG0aNHD3r27MnDDz9ct84LL7zACSecwJ133klNTQ0DBgygT58+9OnTh9mzZzezl4xJkyYxYsSIuulzzz2XmTNnsm3bNoYOHVq33zvvvBOAn//85/Tt25devXpxwQUX1N2Y4rXXXqNfv3707duXG2+8kQ4dOtRt8/bbb29wLPfmnnfuuO2TJk1iyJAhnHfeeZSXl3PPPfdwxx130Lt3b/r168e7775bl2Pw4MGceOKJDBgwgBUrVuzEK29mhVCQQpdUAfwCOD8iGh0YPCImRERlRFR27dq1ELsuqDFjxnDEEUdQXV1Nv379qK6uZvHixUyfPp1Ro0bx9ttvM2bMGAYMGEB1dTXXXHMNBxxwAH/84x9ZuHAhDz/8MFdfffVuZaiuruatt95i2bJlLF26lCuuuAKAL3/5y8ybN4/Fixdz7LHH8stf/hKAkSNHMnLkSObNm8fBBx9ct53nnnuOVatWNTiWe1PP+/bbb//U8mXLljF58mTmzp3LD37wA9q3b8+iRYs45ZRTeOCBB4DMuDB33303CxYsYOzYsU2etjKzlrHbFxZJOgz4LfC1iGh8aL9W5sUXX+SSSy6hTZs2HHjggZx22mnMmzeP/fbb7xPrbdmyhREjRlBdXU2bNm2aHN0wH5/73Od4/fXXueqqqzjnnHM466yzgEyp/vCHP6wbiXHHVZ4vvfQSTz75JACXXnop1157LZAp9MbGct9ZVVVVdOzYkY4dO9KpUyfOO+88AHr27MmSJUvYtGkTs2fP5sILL6z7nh2Dg5lZ8TRb6JIeAgYC+0uqBX4EtAWIiPHAjUAZcJ8kgK2NDRzTmuQ7aNmdd97JgQceyOLFi9m+fTvt2rXL6/saGxu9S5cuLF68mGeffZZ7772XRx55hIk
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"plot_usage_time(time_df, 70, 80)"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"kernelspec": {
|
|||
|
"display_name": "straw2analysis",
|
|||
|
"language": "python",
|
|||
|
"name": "straw2analysis"
|
|||
|
},
|
|||
|
"language_info": {
|
|||
|
"codemirror_mode": {
|
|||
|
"name": "ipython",
|
|||
|
"version": 3
|
|||
|
},
|
|||
|
"file_extension": ".py",
|
|||
|
"mimetype": "text/x-python",
|
|||
|
"name": "python",
|
|||
|
"nbconvert_exporter": "python",
|
|||
|
"pygments_lexer": "ipython3",
|
|||
|
"version": "3.9.6"
|
|||
|
}
|
|||
|
},
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 5
|
|||
|
}
|