Skip to content

Instantly share code, notes, and snippets.

View philippschw's full-sized avatar

Philipp Schwarz philippschw

View GitHub Profile
@philippschw
philippschw / Dash_download_csv_and_excel.py
Last active October 27, 2020 01:56
Create file dynamically and let the user download it as csv or excel
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import urllib
import io
import flask
@philippschw
philippschw / convert_shp2graph
Last active May 16, 2023 12:52
Transform Shapefile of routing network to graph (osmnx object)
import networkx as nx
import geopandas as gp
import osmnx as ox
import pandas as pd
from shapely.geometry import LineString
def convert_shp2graph(p, make_G_bidi = True, name='unamed'):
"""
Converts shapefile to routable networkx graph.