first commit
This commit is contained in:
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Python-generated files
|
||||
__pycache__/
|
||||
*.py[oc]
|
||||
build/
|
||||
dist/
|
||||
wheels/
|
||||
*.egg-info
|
||||
|
||||
# Virtual environments
|
||||
.venv
|
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3.12
|
6
main.py
Normal file
6
main.py
Normal file
@@ -0,0 +1,6 @@
|
||||
def main():
|
||||
print("Hello from my-data-gov!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"cells": [],
|
||||
"metadata": {},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
107
notebook/my_vehicle_registration.ipynb
Normal file
107
notebook/my_vehicle_registration.ipynb
Normal file
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "28a2e7d9-9ee1-4045-a05c-12eba8683dac",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# uv add pandas\n",
|
||||
"# uv add fastparquet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4b3733cd-3c59-4cb4-a343-4cf75ea36ceb",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# If not already installed, do: pip install pandas fastparquet\n",
|
||||
"import pandas as pd\n",
|
||||
"\n",
|
||||
"URL_DATA = 'https://storage.data.gov.my/transportation/cars_2025.parquet'\n",
|
||||
"\n",
|
||||
"df = pd.read_parquet(URL_DATA)\n",
|
||||
"if 'date' in df.columns: df['date'] = pd.to_datetime(df['date'])\n",
|
||||
"\n",
|
||||
"print(df)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"id": "72c39de4-4b98-4dca-8152-3a51f84d86f5",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
" date_reg type maker model colour fuel \\\n",
|
||||
"0 2025-01-01 motokar BYD Seal white electric \n",
|
||||
"1 2025-01-01 window_van Cam Placer-X yellow greendiesel \n",
|
||||
"2 2025-01-01 jip Chery Jaecoo J7 green petrol \n",
|
||||
"3 2025-01-01 jip Chery Jaecoo J7 silver petrol \n",
|
||||
"4 2025-01-01 jip Chery Tiggo grey petrol \n",
|
||||
"... ... ... ... ... ... ... \n",
|
||||
"396824 2025-06-30 window_van Zeekr 009 white electric \n",
|
||||
"396825 2025-06-30 jip Zeekr X beige electric \n",
|
||||
"396826 2025-06-30 jip Zeekr X grey electric \n",
|
||||
"396827 2025-06-30 jip Zeekr X grey electric \n",
|
||||
"396828 2025-06-30 jip Zeekr X green electric \n",
|
||||
"\n",
|
||||
" state \n",
|
||||
"0 Rakan Niaga \n",
|
||||
"1 Johor \n",
|
||||
"2 Rakan Niaga \n",
|
||||
"3 Rakan Niaga \n",
|
||||
"4 Rakan Niaga \n",
|
||||
"... ... \n",
|
||||
"396824 W.P. Kuala Lumpur \n",
|
||||
"396825 W.P. Kuala Lumpur \n",
|
||||
"396826 W.P. Kuala Lumpur \n",
|
||||
"396827 W.P. Kuala Lumpur \n",
|
||||
"396828 W.P. Kuala Lumpur \n",
|
||||
"\n",
|
||||
"[396829 rows x 7 columns]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import pandas as pd\n",
|
||||
"\n",
|
||||
"URL_DATA = 'https://storage.data.gov.my/transportation/cars_2025.parquet'\n",
|
||||
"\n",
|
||||
"# Assuming 'your_file.parquet' is the path to your Parquet file\n",
|
||||
"df = pd.read_parquet(URL_DATA, engine='pyarrow')\n",
|
||||
"if 'date' in df.columns: df['date'] = pd.to_datetime(df['date'])\n",
|
||||
"\n",
|
||||
"# print(df.head())\n",
|
||||
"print(df)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
12
pyproject.toml
Normal file
12
pyproject.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[project]
|
||||
name = "my-data-gov"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"fastparquet>=2024.11.0",
|
||||
"jupyter>=1.1.1",
|
||||
"pandas>=2.3.1",
|
||||
"pyarrow>=21.0.0",
|
||||
]
|
Reference in New Issue
Block a user