60 lines
1.5 KiB
Plaintext
60 lines
1.5 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "8d393e6d",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import sys\n",
|
|
"import os\n",
|
|
"import sqlite3\n",
|
|
"import pandas as pd\n",
|
|
"\n",
|
|
"# 1. Resolve repository pathing and connect to SQLite\n",
|
|
"BASE_DIR = os.path.dirname(os.getcwd())\n",
|
|
"DB_PATH = os.path.join(BASE_DIR, \"data\", \"met_office_weather.db\")\n",
|
|
"conn = sqlite3.connect(DB_PATH)\n",
|
|
"\n",
|
|
"# 2. Extract dataset profile\n",
|
|
"df = pd.read_sql_query(\"SELECT * FROM historic_weather\", conn)\n",
|
|
"print(\"--- Dataset Shape ---\")\n",
|
|
"print(f\"Total Rows: ${df.shape[0]}, Total column: ${df.shape[1]}\\n\")\n",
|
|
"\n",
|
|
"print (\"--- Column Data Types & Counts ---\")\n",
|
|
"print(df.info())\n",
|
|
"\n",
|
|
"print(\"\\n--- Missing Values (NaN) Per Feature Column ---\")\n",
|
|
"print(df.isnull().sum())\n",
|
|
"\n",
|
|
"print(\"\\n --- Total Row Logs Collected Per Unique Station ---\")\n",
|
|
"print(df[\"station_name\"].value_counts())\n",
|
|
"\n",
|
|
"conn.close()"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": ".venv (3.14.2)",
|
|
"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.14.2"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|