Skip to main content

turn a geodataframe of points into mountains, scaled by a data attribute associated with each point

Project description


# 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


pip install data_mountains

How to use

# import the library
import data_mountains.mountainise as dm

# some census output area population density data
popden_oa = pd.read_csv('')

# some census output area population weighted centroids
oa = gpd.read_file("")

# 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])
# use Altair to create the visual
dm.plot(gdf=gdf, fill='#eee', stroke='#333')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data-mountains-0.0.5.tar.gz (70.1 kB view hashes)

Uploaded source

Built Distribution

data_mountains-0.0.5-py3-none-any.whl (16.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page