15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples<br />

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

If relative==False, tuple indicating whether values exactly equal to the absolute limits<br />

are allowed. If relative==True, tuple indicating whether the number of data being<br />

masked on each side should be rounded (True) or truncated (False).<br />

relative : {False, True} optional<br />

Whether to consider the limits as absolute values (False) or proportions to cut (True).<br />

axis : {None, integer}, optional<br />

Axis along which to trim.<br />

>>>z = [ 1, 2, 3, 4, 5, 6, 7, 8, 9,10] >>>trim(z,(3,8)) [–,–, 3, 4, 5, 6, 7, 8,–,–] >>>trim(z,(0.1,0.2),relative=True)<br />

[–, 2, 3, 4, 5, 6, 7, 8,–,–]<br />

trima(a, limits=None, inclusive=(True, True))<br />

Trims an array by masking the data outside some given limits. Returns a masked version of the input array.<br />

Parameters<br />

a : sequence<br />

Input array.<br />

limits : {None, tuple} optional<br />

Tuple of (lower limit, upper limit) in absolute values. Values of the input array lower<br />

(greater) than the lower (upper) limit will be masked. A limit is None indicates an<br />

open interval.<br />

inclusive : {(True,True) tuple} optional<br />

Tuple of (lower flag, upper flag), indicating whether values exactly equal to the lower<br />

(upper) limit are allowed.<br />

trimboth(data, proportiontocut=0.20000000000000001, inclusive=(True, True), axis=None)<br />

Trims the data by masking the int(proportiontocut*n) smallest and<br />

int(proportiontocut*n) largest values of data along the given axis, where n is the number of unmasked<br />

values before trimming.<br />

Parameters<br />

data : ndarray<br />

Data to trim.<br />

proportiontocut<br />

[{0.2, float} optional] Percentage of trimming (as a float between 0 and 1). If n<br />

is the number of unmasked values before trimming, the number of values after<br />

trimming is:<br />

(1-2*proportiontocut)*n.<br />

inclusive<br />

[{(True, True) tuple} optional] Tuple indicating whether the number of data<br />

being masked on each side should be rounded (True) or truncated (False).<br />

axis<br />

[{None, integer}, optional] Axis along which to perform the trimming. If None,<br />

the input array is first flattened.<br />

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

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

Saved successfully!

Ooh no, something went wrong!