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
# Mathieu Blondel, February 2012 | |
# License: BSD 3 clause | |
# Port to Python of examples in chapter 5 of | |
# "Introductory Statistics with R" by Peter Dalgaard | |
import numpy as np | |
from scipy.stats import ttest_1samp, wilcoxon, ttest_ind, mannwhitneyu | |
# daily intake of energy in kJ for 11 women |
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
def RGB2YUV(input): | |
(R, G, B) = input | |
Y = int(0.299 * R + 0.587 * G + 0.114 * B) | |
U = int(-0.147 * R + -0.289 * G + 0.436 * B) | |
V = int(0.615 * R + -0.515 * G + -0.100 * B) | |
return (Y, U, V) | |
def YUV2RGB(input): | |
(Y, U, V) = input |
This file has been truncated, but you can view the full file.
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:c94d0761ba047cfd77267c1d2e8b1d694c8fb3c18b19f8007e5c90777da3bfd5" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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 scipy.spatial.distance import pdist, squareform | |
import numpy as np | |
from numbapro import jit, float32 | |
def distcorr(X, Y): | |
""" Compute the distance correlation function | |
>>> a = [1,2,3,4,5] | |
>>> b = np.array([1,2,9,4,4]) |
Loading
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
import numpy as np | |
from scipy import ndimage as ndi | |
# lookup tables for bwmorph_thin | |
G123_LUT = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, | |
0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, | |
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, |
Loading
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
import numpy as np | |
from scipy.interpolate import Rbf | |
import matplotlib.pyplot as plt | |
from matplotlib.colors import LinearSegmentedColormap | |
from mpl_toolkits.axes_grid1 import inset_locator | |
from matplotlib.projections.polar import PolarAxes | |
np.random.seed(1977) | |
def main(): | |
x, y, z = generate_surface() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.