stress_at_work_analysis/exploration/screen.ipynb

81 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-02-02 18:08:07 +01:00
{
"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
}