PHD Project - Driver energy prediction
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.2 KiB

2 years ago
{
"cells": [
{
"cell_type": "markdown",
"id": "2a759a8e",
"metadata": {},
"source": [
"# Datensatz herunterladen\n",
"\n",
"`SETUP_ID` anpassen, Rest läuft automatisch.\n",
"\n",
"Einige Datensätze besitzen keinen Eintrag für `flt_obd_speed`. Für eine Liste der Datensätze *mit* diesem Wert kann beispielsweise folgende SQL-Abfrage verwendet werden (Achtung, braucht (prinzipbedingt) sehr lange!):\n",
"\n",
"```sql\n",
"select setup_id s, count(*) n\n",
"from computeddata\n",
"group by s\n",
"having not exists (\n",
" select *\n",
" from computeddata\n",
" where setup_id = s\n",
" and flt_obd_speed is null)\n",
"order by n asc\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "bd18001b",
"metadata": {},
"outputs": [],
"source": [
"SETUP_ID = 868\n",
"import csv\n",
"from runsql import runsql\n",
"\n",
"reader = runsql('select distinct setup_id from computeddata')\n",
"reader_data = list(reader) # list(...) so that following cells can be repeated"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "dfcd912a",
"metadata": {},
"outputs": [],
"source": [
"ids = []\n",
"for i in reader_data:\n",
" ids.append(int(i['setup_id']))"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "1f8c5b69",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1122"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(ids)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "607eee22",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"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.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}