This file contains 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
""" | |
Created on Wed Aug 03 11:56:41 2016 | |
""" | |
from scipy.signal.windows import (boxcar, hann, hamming, bartlett, bohman, | |
blackman, parzen, blackmanharris, cosine, | |
kaiser, tukey, gaussian) | |
from scipy.fftpack import fft | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains 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
#!/usr/bin/env python | |
# alpha release 2005-02-04 | |
# This python script by Russ Paielli implements two variations of | |
# Condorcet-Schulze voting algorithms and provides associated | |
# input/output utilities. To try it, type | |
# Condorcet.py <input> <output> |
This file contains 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
#!/usr/bin/env python | |
# Copyright (C) 2002 by Mike Ossipoff and Russ Paielli | |
# version 1.0 - released 2002-02-14 | |
# version 1.01 - released 2002-08-24 -- comments revised slightly | |
# version 1.02 - released 2004-02-14 -- comments revised slightly | |
# See http://ElectionMethods.org/CondorcetSSD.py for updates. | |
# See http://ElectionMethods.org for related informatioin. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
Train a neural network to implement the discrete Fourier transform | |
""" | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Dense | |
import numpy as np | |
import matplotlib.pyplot as plt | |
N = 32 | |
batch = 10000 |
This file contains 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
from numpy import pi, exp, tan, sqrt, log10 | |
import numpy as np | |
from scipy import signal | |
import matplotlib.pyplot as plt | |
def lp2_mzti(w0=None, K=None): | |
""" | |
Digital 2nd order lowpass filter design using | |
improved Matched Z transform (MZTi) |
This file contains 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
! Title: Finite Scroll (kills infinite scrolling) | |
! Last modified: 2017-10-24 | |
! Homepage: https://gist.github.com/endolith/72ac5e69e037be02b118adbedcdeac59 | |
! This URL: https://gist.githubusercontent.com/endolith/72ac5e69e037be02b118adbedcdeac59/raw/finite_scroll.txt | |
! TODO: Add these scripts: https://infinite-scroll.com/ | |
! Forbes infinite scroll (and all other AJAX) |
This file contains 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 numpy as np | |
from numpy import exp, sqrt, pi, cos, sin, e | |
import matplotlib.pyplot as plt | |
from scipy import optimize | |
import warnings | |
warnings.filterwarnings("ignore",".*GUI is implemented.*") | |
from scipy._lib._util import check_random_state | |
from scipy.optimize._basinhopping import AdaptiveStepsize, RandomDisplacement | |
This file contains 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
from skimage import io as sio | |
import skimage | |
import numpy as np | |
import matplotlib.pyplot as plt | |
filename = 'Lennert jet.png' | |
img = skimage.img_as_float(sio.imread(filename))[:,:,:3] | |
jet = plt.cm.jet |
This file contains 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
from tkinter import Tk, Label | |
from PIL import Image, ImageTk | |
import os | |
import sys | |
# Skip every n frames. Use 1 to show all images | |
skip = 1 | |
try: | |
root = Tk() |