Start exploring screen data.
parent
29b664c41b
commit
e4b6dc90e2
|
@ -1,2 +1,2 @@
|
|||
/.env
|
||||
/config/.ipynb_checkpoints/
|
||||
*/.ipynb_checkpoints/
|
||||
|
|
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue