data-mountains


Namedata-mountains JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/joel-lbth/data-mountains
Summaryturn a geodataframe of points into mountains, scaled by a data attribute associated with each point
upload_time2023-01-31 23:54:16
maintainer
docs_urlNone
authorjoel
requires_python>=3.7
licenseagplv3
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            data-mountains
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

``` python
# requirements

import pandas as pd
import geopandas as gpd
from shapely.geometry import Polygon, Point, LineString, GeometryCollection
from shapely.ops import unary_union, transform
import altair as alt
import math
import matplotlib.pyplot as plt
```

## Install

``` sh
pip install data_mountains
```

## How to use

``` python
# import the library
import data_mountains.mountainise as dm

# some census output area population density data
popden_oa = pd.read_csv('https://gist.github.com/joel-lbth/b35c0ac7a3652c3f34441d25c45ea84a/raw/d69075dc707b5bdb06c9b640d43db1e5b2ffcb64/lbth_census_2021_pop_density_oa.csv')

# some census output area population weighted centroids
oa = gpd.read_file("https://gist.github.com/joel-lbth/00f24602797d51d02d2177ed82f9295d/raw/b6c26621504a0df20ef6db1c93e5f99bce911d0a/lbth_oa21_pop_centroids.geojson")

# add data attribute to each point by merging on common identifier
gdf = oa.merge(popden_oa, left_on='oa21cd', right_on='GEOGRAPHY_CODE')

# turn each point in a data sized mountain
gdf = dm.points_to_peaks(gdf=gdf, column='OBS_VALUE', range=[0, 0.01])
```

``` python
# use Altair to create the visual
dm.plot(gdf=gdf, fill='#eee', stroke='#333')
```

![](https://raw.githubusercontent.com/joel-lbth/data-mountains/main/nbs/visualization.svg)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/joel-lbth/data-mountains",
    "name": "data-mountains",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nbdev jupyter notebook python",
    "author": "joel",
    "author_email": "joeldn@pm.me",
    "download_url": "https://files.pythonhosted.org/packages/ad/53/b9ac7cda6713742bec1348e1b3157ee0ce8f130d0d7a8e240d3697341be2/data-mountains-0.0.5.tar.gz",
    "platform": null,
    "description": "data-mountains\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n``` python\n# requirements\n\nimport pandas as pd\nimport geopandas as gpd\nfrom shapely.geometry import Polygon, Point, LineString, GeometryCollection\nfrom shapely.ops import unary_union, transform\nimport altair as alt\nimport math\nimport matplotlib.pyplot as plt\n```\n\n## Install\n\n``` sh\npip install data_mountains\n```\n\n## How to use\n\n``` python\n# import the library\nimport data_mountains.mountainise as dm\n\n# some census output area population density data\npopden_oa = pd.read_csv('https://gist.github.com/joel-lbth/b35c0ac7a3652c3f34441d25c45ea84a/raw/d69075dc707b5bdb06c9b640d43db1e5b2ffcb64/lbth_census_2021_pop_density_oa.csv')\n\n# some census output area population weighted centroids\noa = gpd.read_file(\"https://gist.github.com/joel-lbth/00f24602797d51d02d2177ed82f9295d/raw/b6c26621504a0df20ef6db1c93e5f99bce911d0a/lbth_oa21_pop_centroids.geojson\")\n\n# add data attribute to each point by merging on common identifier\ngdf = oa.merge(popden_oa, left_on='oa21cd', right_on='GEOGRAPHY_CODE')\n\n# turn each point in a data sized mountain\ngdf = dm.points_to_peaks(gdf=gdf, column='OBS_VALUE', range=[0, 0.01])\n```\n\n``` python\n# use Altair to create the visual\ndm.plot(gdf=gdf, fill='#eee', stroke='#333')\n```\n\n![](https://raw.githubusercontent.com/joel-lbth/data-mountains/main/nbs/visualization.svg)\n",
    "bugtrack_url": null,
    "license": "agplv3",
    "summary": "turn a geodataframe of points into mountains, scaled by a data attribute associated with each point",
    "version": "0.0.5",
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebfbcd88bf0decdccf70b5eacd583fc4ec69e520561264615286cb377497b277",
                "md5": "56c16e5edae2b6c9eb58a8e10d8e9572",
                "sha256": "9305ca6e7579295e6b0bce9edb136f1c0129eeea998a1dfbd5c160ef7092802d"
            },
            "downloads": -1,
            "filename": "data_mountains-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56c16e5edae2b6c9eb58a8e10d8e9572",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 16704,
            "upload_time": "2023-01-31T23:54:13",
            "upload_time_iso_8601": "2023-01-31T23:54:13.671716Z",
            "url": "https://files.pythonhosted.org/packages/eb/fb/cd88bf0decdccf70b5eacd583fc4ec69e520561264615286cb377497b277/data_mountains-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad53b9ac7cda6713742bec1348e1b3157ee0ce8f130d0d7a8e240d3697341be2",
                "md5": "c0da55f843704c6ddafb7bef088a26ff",
                "sha256": "539d9c80d6201958c86d30919c2c01148e2e85d78f8c1d3fa8a36dc010849b61"
            },
            "downloads": -1,
            "filename": "data-mountains-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "c0da55f843704c6ddafb7bef088a26ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 70104,
            "upload_time": "2023-01-31T23:54:16",
            "upload_time_iso_8601": "2023-01-31T23:54:16.483014Z",
            "url": "https://files.pythonhosted.org/packages/ad/53/b9ac7cda6713742bec1348e1b3157ee0ce8f130d0d7a8e240d3697341be2/data-mountains-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-31 23:54:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "joel-lbth",
    "github_project": "data-mountains",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "data-mountains"
}
        
Elapsed time: 0.07025s