Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(12)  |  Derive(0)  |  Import(2)

src/a/s/astroML-0.2/astroML/stats/tests/test_binned_statistic.py   astroML(Download)
import numpy as np
from numpy.testing import assert_array_almost_equal
from astroML.stats import \
    binned_statistic, binned_statistic_2d, binned_statistic_dd
 
def test_dd_count():
    X = np.random.random((100, 3))
    v = np.random.random(100)
 
    count1, edges1 = binned_statistic_dd(X, v, 'count', bins=3)
def test_dd_sum():
    X = np.random.random((100, 3))
    v = np.random.random(100)
 
    sum1, edges1 = binned_statistic_dd(X, v, 'sum', bins=3)
def test_dd_mean():
    X = np.random.random((100, 3))
    v = np.random.random(100)
 
    stat1, edges1 = binned_statistic_dd(X, v, 'mean', bins=3)
    stat2, edges2 = binned_statistic_dd(X, v, np.mean, bins=3)

src/a/s/astroML-HEAD/astroML/stats/tests/test_binned_statistic.py   astroML(Download)
import numpy as np
from numpy.testing import assert_array_almost_equal
from astroML.stats import \
    binned_statistic, binned_statistic_2d, binned_statistic_dd
 
def test_dd_count():
    X = np.random.random((100, 3))
    v = np.random.random(100)
 
    count1, edges1 = binned_statistic_dd(X, v, 'count', bins=3)
def test_dd_sum():
    X = np.random.random((100, 3))
    v = np.random.random(100)
 
    sum1, edges1 = binned_statistic_dd(X, v, 'sum', bins=3)
def test_dd_mean():
    X = np.random.random((100, 3))
    v = np.random.random(100)
 
    stat1, edges1 = binned_statistic_dd(X, v, 'mean', bins=3)
    stat2, edges2 = binned_statistic_dd(X, v, np.mean, bins=3)