15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

An array containing the calculated quantiles.<br />

SciPy Reference Guide, Release 0.8.dev<br />

>>> from <strong>scipy</strong>.stats.mstats import mquantiles<br />

>>> a = np.array([6., 47., 49., 15., 42., 41., 7., 39., 43., 40., 36.])<br />

>>> mquantiles(a)<br />

array([ 19.2, 40. , 42.8])<br />

Using a 2D array, specifying axis and limit.<br />

>>> data = np.array([[ 6., 7., 1.],<br />

[ 47., 15., 2.],<br />

[ 49., 36., 3.],<br />

[ 15., 39., 4.],<br />

[ 42., 40., -999.],<br />

[ 41., 41., -999.],<br />

[ 7., -999., -999.],<br />

[ 39., -999., -999.],<br />

[ 43., -999., -999.],<br />

[ 40., -999., -999.],<br />

[ 36., -999., -999.]])<br />

>>> mquantiles(data, axis=0, limit=(0, 50))<br />

array([[ 19.2 , 14.6 , 1.45],<br />

[ 40. , 37.5 , 2.5 ],<br />

[ 42.8 , 40.05, 3.55]])<br />

>>> data[:, 2] = -999.<br />

>>> mquantiles(data, axis=0, limit=(0, 50))<br />

masked_array(data =<br />

[[19.2 14.6 --]<br />

[40.0 37.5 --]<br />

[42.8 40.05 --]],<br />

mask =<br />

[[False False True]<br />

[False False True]<br />

[False False True]],<br />

fill_value = 1e+20)<br />

msign(x)<br />

Returns the sign of x, or 0 if x is masked.<br />

normaltest(a, axis=0)<br />

Tests whether a sample differs from a normal distribution<br />

This function tests the null hypothesis that a sample comes from a normal distribution. It is based on D’Agostino<br />

and Pearson’s [R28], [R29] test that combines skew and kurtosis to produce an omnibus test of normality.<br />

Parameters<br />

a : array<br />

axis : int or None<br />

Returns<br />

p-value : float<br />

A 2-sided chi squared probability for the hypothesis test<br />

3.18. Statistical functions (<strong>scipy</strong>.stats) 681

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!