Skip to content

Instantly share code, notes, and snippets.

@janpipek
Created March 16, 2017 13:01
Show Gist options
  • Save janpipek/848b3aa5aa6fddf7398f811970558fd9 to your computer and use it in GitHub Desktop.
Save janpipek/848b3aa5aa6fddf7398f811970558fd9 to your computer and use it in GitHub Desktop.
Convert a certain Munro table into more digestible
import pandas as pd
munros = pd.read_csv("../physt/example/munrotab_v6.csv", encoding="latin-1")
munros = munros[munros["Post 1997"] == "MUN"]
munros["name"] = munros["Name"]
munros["height"] = munros["Height (m)"]
from bng_to_latlon import OSGB36toWGS84
munros["lat"], munros["long"] = tuple(zip(*[OSGB36toWGS84(*pair) for pair in (zip(munros.xcoord, munros.ycoord))]))
munros = munros[["name", "height", "long", "lat"]].reset_index(drop=True)
munros.to_csv("../physt/example/munros.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment