{"id":13426981,"url":"https://github.com/DahnJ/H3-Pandas","last_synced_at":"2025-03-15T22:31:32.294Z","repository":{"id":37545336,"uuid":"369767253","full_name":"DahnJ/H3-Pandas","owner":"DahnJ","description":"Integration of H3 with GeoPandas and Pandas","archived":false,"fork":false,"pushed_at":"2025-03-02T01:25:02.000Z","size":12869,"stargazers_count":210,"open_issues_count":15,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-02T01:27:08.809Z","etag":null,"topics":["geopandas","geospatial","h3","h3-pandas","hexagons-are-bestagons","pandas","pyhon"],"latest_commit_sha":null,"homepage":"http://h3-pandas.readthedocs.io/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DahnJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-22T09:26:44.000Z","updated_at":"2025-03-02T01:25:06.000Z","dependencies_parsed_at":"2024-01-16T00:22:24.157Z","dependency_job_id":"59c9acfc-dc16-4dda-a904-9958d1a092e4","html_url":"https://github.com/DahnJ/H3-Pandas","commit_stats":{"total_commits":142,"total_committers":5,"mean_commits":28.4,"dds":"0.24647887323943662","last_synced_commit":"258e8685860e5b67d073025f7aaf9ea4e7a89acb"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DahnJ%2FH3-Pandas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DahnJ%2FH3-Pandas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DahnJ%2FH3-Pandas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DahnJ%2FH3-Pandas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DahnJ","download_url":"https://codeload.github.com/DahnJ/H3-Pandas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801600,"owners_count":20350105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geopandas","geospatial","h3","h3-pandas","hexagons-are-bestagons","pandas","pyhon"],"created_at":"2024-07-31T00:01:50.057Z","updated_at":"2025-03-15T22:31:27.274Z","avatar_url":"https://github.com/DahnJ.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"\u003cimg align=\"left\" src=\"https://i.imgur.com/OH8DoTA.png\" alt=\"H3 Logo\" width=\"500\"\u003e\n\n\n\u0026nbsp;\n\n# H3-Pandas ⬢ 🐼\nIntegrates [H3](https://github.com/uber/h3-py) with  [GeoPandas](https://github.com/geopandas/geopandas)\nand [Pandas](https://github.com/pandas-dev/pandas).\n[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DahnJ/H3-Pandas/blob/master/notebook/00-intro.ipynb)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/DahnJ/H3-Pandas/HEAD?filepath=%2Fnotebook%2F00-intro.ipynb)\n[![image](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Documentation Status](https://readthedocs.org/projects/pip/badge/?version=stable)](https://pip.pypa.io/en/stable/?badge=stable)\n\n\u0026nbsp;\n\n\n---\n\n\u003ch3 align=\"center\"\u003e\n  ⬢ \u003ca href=\"https://mybinder.org/v2/gh/DahnJ/H3-Pandas/HEAD?filepath=%2Fnotebook%2F00-intro.ipynb\"\u003eTry it out\u003c/a\u003e ⬢\n\u003c/h3\u003e\n\n---\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/DahnJ/H3-Pandas\"\u003e\u003cimg src=\"https://i.imgur.com/GZWsC8G.gif\" alt=\"example usage\" width=\"450\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## Installation\n### pip\n[![image](https://img.shields.io/pypi/v/h3pandas.svg)](https://pypi.python.org/pypi/h3pandas)\n```bash\npip install h3pandas\n```\n\n### conda\n[![conda-version](https://anaconda.org/conda-forge/h3pandas/badges/version.svg)]()\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/h3pandas/badges/downloads.svg)](https://anaconda.org/conda-forge/h3pandas)\n```bash\nconda install -c conda-forge h3pandas\n```\n\n## Usage examples\n\n### H3 API\n`h3pandas` automatically applies H3 functions to both Pandas Dataframes and GeoPandas Geodataframes\n\n```python\n# Prepare data\n\u003e\u003e\u003e import pandas as pd\n\u003e\u003e\u003e import h3pandas\n\u003e\u003e\u003e df = pd.DataFrame({'lat': [50, 51], 'lng': [14, 15]})\n```\n\n```python\n\u003e\u003e\u003e resolution = 10\n\u003e\u003e\u003e df = df.h3.geo_to_h3(resolution)\n\u003e\u003e\u003e df\n\n| h3_10           |   lat |   lng |\n|:----------------|------:|------:|\n| 8a1e30973807fff |    50 |    14 |\n| 8a1e2659c2c7fff |    51 |    15 |\n\n\u003e\u003e\u003e df = df.h3.h3_to_geo_boundary()\n\u003e\u003e\u003e df\n\n| h3_10           |   lat |   lng | geometry        |\n|:----------------|------:|------:|:----------------|\n| 8a1e30973807fff |    50 |    14 | POLYGON ((...)) |\n| 8a1e2659c2c7fff |    51 |    15 | POLYGON ((...)) |\n```\n\n### H3-Pandas Extended API\n`h3pandas` also provides some extended functionality out-of-the-box, \noften simplifying common workflows into a single command.\n\n```python\n# Set up data\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e import pandas as pd\n\u003e\u003e\u003e np.random.seed(1729)\n\u003e\u003e\u003e df = pd.DataFrame({\n\u003e\u003e\u003e   'lat': np.random.uniform(50, 51, 100),\n\u003e\u003e\u003e   'lng': np.random.uniform(14, 15, 100),\n\u003e\u003e\u003e   'value': np.random.poisson(100, 100)})\n\u003e\u003e\u003e })\n```\n\n```python\n# Aggregate values by their location and sum\n\u003e\u003e\u003e df = df.h3.geo_to_h3_aggregate(3)\n\u003e\u003e\u003e df\n\n| h3_03           |   value | geometry        |\n|:----------------|--------:|:----------------|\n| 831e30fffffffff |     102 | POLYGON ((...)) |\n| 831e34fffffffff |     189 | POLYGON ((...)) |\n| 831e35fffffffff |    8744 | POLYGON ((...)) |\n| 831f1bfffffffff |    1040 | POLYGON ((...)) |\n\n# Aggregate to a lower H3 resolution\n\u003e\u003e\u003e df.h3.h3_to_parent_aggregate(2)\n\n| h3_02           |   value | geometry        |\n|:----------------|--------:|:----------------|\n| 821e37fffffffff |    9035 | POLYGON ((...)) |\n| 821f1ffffffffff |    1040 | POLYGON ((...)) |\n```\n\n\n### Further examples\nFor more examples, see the \n[example notebooks](https://nbviewer.jupyter.org/github/DahnJ/H3-Pandas/tree/master/notebook/).\n\n## API\nFor a full API documentation and more usage examples, see the \n[documentation](https://h3-pandas.readthedocs.io/en/latest/).\n\n## Development\nH3-Pandas cover the basics of the H3 API, but there are still many possible improvements.\n\n**Any suggestions and contributions are very welcome**!\n\nIn particular, the next steps are:\n- [ ] Improvements \u0026 stability of the \"Extended API\", e.g. `k_ring_smoothing`. \n\nAdditional possible directions\n- [ ] Allow for alternate h3-py APIs such as [memview_int](https://github.com/uber/h3-py#h3apimemview_int)\n- [ ] Performance improvements through [Cythonized h3-py](https://github.com/uber/h3-py/pull/147)\n- [ ] [Dask](https://github.com/dask/dask) integration through [dask-geopandas](https://github.com/geopandas/dask-geopandas) (experimental as of now)\n\nSee [issues](https://github.com/DahnJ/H3-Pandas/issues) for more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDahnJ%2FH3-Pandas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDahnJ%2FH3-Pandas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDahnJ%2FH3-Pandas/lists"}