This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import math | |
# Some functions to later apply to our columns | |
def dcos(theta): | |
theta = theta*(math.pi/180) | |
return math.cos(theta) | |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import itertools | |
# Load data | |
prices = pd.read_csv("PizzaPrices.csv") | |
# Filter out an unwanted establishment | |
prices = prices[(prices['establishment_name'] != "Pizza Zone")] |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Apr 28 11:58:10 2015 | |
@author: Duncan Parkes | |
""" | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np |
This file contains hidden or 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
#List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
#Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
#Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(value_list)] |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Oct 20 11:41:59 2015 | |
Find out from which years you cited most publications in your thesis or | |
dissertation. | |
https://xkcd.com/208/ | |
May need to somehow account for 'missing' years | |
http://pandas.pydata.org/pandas-docs/stable/missing_data.html |
This file contains hidden or 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 os | |
import folium | |
import pandas as pd | |
from bng_to_latlon import OSGB36toWGS84 | |
os.chdir("C:\Users\Duncan\Documents\Python Scripts\pythonGIS") | |
# Load map centred on Colchester | |
uk = folium.Map(location=[51.8860942,0.8336077], zoom_start=10) | |
# Load locally stored colchester public toilets data | |
toilets = pd.read_csv("public-toilets.csv") |
This file contains hidden or 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 gpxpy | |
import gpxpy.gpx | |
import folium | |
gpx_file = open('my_gpx_coords.gpx', 'r') | |
gpx = gpxpy.parse(gpx_file) | |
points = [] | |
for track in gpx.tracks: | |
for segment in track.segments: |
This file contains hidden or 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 gpxpy | |
import gpxpy.gpx | |
import folium | |
gpx_file = open('path_to_gpx_file.gpx', 'r') | |
gpx = gpxpy.parse(gpx_file) | |
points = [] | |
for track in gpx.tracks: | |
for segment in track.segments: |
This file contains hidden or 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
Name | lat | lon | |
---|---|---|---|
The University of Aberdeen | 57.165019 | -2.099122 | |
University of Abertay Dundee | 56.46334 | -2.973441 | |
Aberystwyth University | 52.403473 | -4.043584 | |
Anglia Ruskin University | 51.741381 | 0.474495 | |
Aston University | 52.486637 | -1.890952 | |
Bangor University | 53.229193 | -4.129437 | |
Bath Spa University | 51.373209 | -2.440912 | |
The University of Bath | 51.380441 | -2.330673 | |
University of Bedfordshire | 51.87825 | -0.411539 |
This file contains hidden or 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
\documentclass{article} | |
\usepackage{natbib} | |
\usepackage{bibunits} | |
\begin{document} | |
% bibunit to list our publications | |
\begin{bibunit}[plain] | |
\renewcommand{\bibsection}{\large \textbf{\begin{center} | |
Publications | |
\end{center}}} |
OlderNewer