Last active
October 28, 2021 15:47
-
-
Save DakaiZhou/71f34a8b43233c3645d1dd932add1b91 to your computer and use it in GitHub Desktop.
medium random location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geopandas as gpd | |
import pandas as pd | |
import numpy as np | |
from shapely.geometry import Polygon | |
from shapely.geometry import box | |
import matplotlib.patches as patches | |
import random | |
from shapely.geometry import Point | |
import matplotlib.pyplot as plt | |
from copy import copy | |
plz_shape_df = gpd.read_file('plz-gebiete.shp', dtype={'plz': str}) | |
plz_region_df = pd.read_csv('zuordnung_plz_ort.csv', sep=',', dtype={'plz': str}) | |
plz_region_df.drop('osm_id', axis=1, inplace=True) | |
germany_df = pd.merge(left=plz_shape_df, right=plz_region_df, on='plz', how='inner') | |
düsseldorf_df = germany_df.query('ort == "Düsseldorf"') | |
düsseldorf_geo = düsseldorf_df["geometry"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment