Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

src/n/i/nipy-0.3.0/nipy/labs/utils/__init__.py   nipy(Download)
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from .routines import (quantile, median, mahalanobis, svd, permutations,
                       combinations, gamln, psi)
from .zscore import zscore

src/n/i/nipy-0.3.0/nipy/labs/utils/tests/test_misc.py   nipy(Download)
from scipy import special
 
from ..routines import median, mahalanobis, gamln, psi
 
from nose.tools import assert_true
        A = np.dot(A.transpose(), A) + np.eye(100)
        mah = np.dot(x, np.dot(np.linalg.inv(A), x))
        assert_almost_equal(mah, mahalanobis(x, A), decimal=1) 
 
    def test_mahalanobis2(self):
        j = np.random.randint(4)
        mah = np.dot(x[:,i,j], np.dot(np.linalg.inv(Aa[:,:,i,j]), x[:,i,j]))
        f_mah = (mahalanobis(x, Aa))[i,j]
        assert_true(np.allclose(mah, f_mah))