diff --git a/.gitignore b/.gitignore index 8feb8c1..b6abfca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /.env -/config/.ipynb_checkpoints/ +*/.ipynb_checkpoints/ diff --git a/exploration/screen.ipynb b/exploration/screen.ipynb new file mode 100644 index 0000000..043933a --- /dev/null +++ b/exploration/screen.ipynb @@ -0,0 +1,80 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 11, + "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": 20, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "\n", + "from config.models import Participant, Screen\n", + "from setup import db_engine, session" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "query_screen = (\n", + " session.query(Screen, Participant.username)\n", + " .filter(Participant.id == Screen.participant_id)\n", + " .filter(Participant.username.in_([\"nokia_0000003\"]))\n", + " )\n", + "with db_engine.connect() as connection:\n", + " df_screen = pd.read_sql(query_screen.statement, connection)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(df_screen)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.1" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}