Skip to content

Instantly share code, notes, and snippets.

Trevor Sweetnam treviesweets

Block or report user

Report or block treviesweets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tartakynov
tartakynov / fourex.py
Last active Feb 12, 2020
Fourier Extrapolation in Python
View fourex.py
import numpy as np
import pylab as pl
from numpy import fft
def fourierExtrapolation(x, n_predict):
n = x.size
n_harm = 10 # number of harmonics in model
t = np.arange(0, n)
p = np.polyfit(t, x, 1) # find linear trend in x
x_notrend = x - p[0] * t # detrended x
@endolith
endolith / geo_median.py
Last active Jun 20, 2019
Computing the geometric median in Python by Daniel J Lewis
View geo_median.py
import math
from dbfpy import dbf
import matplotlib.pyplot as plt
#create a plot
fig = plt.figure(1, figsize = [10,10], dpi=90)
axScatter = plt.subplot(111)
def candMedian(dataPoints):
#Calculate the first candidate median as the geometric mean
You can’t perform that action at this time.