Skip to content

Instantly share code, notes, and snippets.

View dfulu's full-sized avatar

James Fulton dfulu

  • Edinburgh
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfulu
dfulu / minimise_expected_loss.ipynb
Created September 27, 2024 10:22
Minimise expected loss from predicted quantiles
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfulu
dfulu / C20C+_HadGEM3_issue.ipynb
Created April 14, 2021 20:36
C20C+ HadGEM3 issue
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfulu
dfulu / load_noaa.py
Last active November 28, 2019 16:02
Function to load from NOAA downloaded dataset to pandas dataframe (tested on MEI only)
import pandas as pd
def load_noaa(filepath, skiprows=1, skipfooter=4, na_values=-999):
"""Loads a NOAA style downloaded dataset into a tidy pandas dataframe
Parameters
----------
filepath : str
Filepath of dataset
skiprows : int, optional
@dfulu
dfulu / xarray_example.ipynb
Last active October 18, 2019 15:12
xarray_example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfulu
dfulu / self_organising_map_colour_example.ipynb
Last active November 16, 2018 10:36
Implemented the SOM algorithm in a standard form. Extended algorithm to a 1D circular circumference node map and a 2D toroidal surface node map.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfulu
dfulu / map_plotting_with_xarray.py
Created November 16, 2018 10:27
Simon's solution to plotting maps from xarray
'''
Simon's solution to plotting maps from xarray
'''
import cartopy
def cyclicContourf(ax, dataFrame, *args, **kwargs):
"""
make a filled contour by adding a cyclic value for longitude.
:param dataFrame: data frame
:param args: passsed straight through to contourf