{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os, sys\n", "nb_dir = os.path.split(os.getcwd())[0]\n", "if nb_dir not in sys.path:\n", " sys.path.append(nb_dir)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from features.screen import *\n", "import participants.query_db" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "df_screen_nokia = get_screen_data([\"nokia_0000003\"])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " id _id timestamp device_id \\\n", "0 245456 155 1615456297079 12324354-e195-4e93-a2d5-268556e3ea5d \n", "1 245455 154 1615456297069 12324354-e195-4e93-a2d5-268556e3ea5d \n", "2 245454 153 1615456288219 12324354-e195-4e93-a2d5-268556e3ea5d \n", "3 245453 152 1615455357213 12324354-e195-4e93-a2d5-268556e3ea5d \n", "4 245452 151 1615455357190 12324354-e195-4e93-a2d5-268556e3ea5d \n", "... ... ... ... ... \n", "1911 33221 5 1583329949659 d5fb52e1-7df8-44b5-a805-8d04ca008061 \n", "1912 33171 4 1583327341863 d5fb52e1-7df8-44b5-a805-8d04ca008061 \n", "1913 33170 3 1583327340983 d5fb52e1-7df8-44b5-a805-8d04ca008061 \n", "1914 33169 2 1583327340739 d5fb52e1-7df8-44b5-a805-8d04ca008061 \n", "1915 33168 1 1583327340713 d5fb52e1-7df8-44b5-a805-8d04ca008061 \n", "\n", " screen_status participant_id username \n", "0 2 21 nokia_0000003 \n", "1 0 21 nokia_0000003 \n", "2 1 21 nokia_0000003 \n", "3 2 21 nokia_0000003 \n", "4 0 21 nokia_0000003 \n", "... ... ... ... \n", "1911 3 21 nokia_0000003 \n", "1912 3 21 nokia_0000003 \n", "1913 1 21 nokia_0000003 \n", "1914 2 21 nokia_0000003 \n", "1915 0 21 nokia_0000003 \n", "\n", "[1916 rows x 7 columns]\n" ] } ], "source": [ "print(df_screen_nokia)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "participants_inactive_usernames = participants.query_db.get_usernames()\n", "df_screen_inactive = get_screen_data(participants_inactive_usernames)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "screen_status\n", "0 70243\n", "1 70012\n", "2 63080\n", "3 36666\n", "dtype: int64" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_screen_inactive.value_counts(\"screen_status\")" ] } ], "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.2" } }, "nbformat": 4, "nbformat_minor": 4 }