averageTheRepeatedValues
Return to directory of Todd's CASA extensions
Accepts paired lists and averages the entries that have the same x value,
where the x value can be a string or integer or float.
Usage:
au.averageTheRepeatedValues(x, y, median=False, returnStdev=False)
Inputs:
- median: if True, then take the median rather than the mean
- returnStdev: if True, then return: x, y, standardDeviation; otherwise return: x, y
- if both median and returnStdev are True, then return: x, y, MAD
Returns:
- 2 or 3 arrays: x, y, [standadrDeviation or MAD]
Example:
CASA <7>: au.averageTheRepeatedValues([1,2,2,3],[0,0,1,0])
Out[7]: (array([1, 2, 3]), array([ 0. , 0.5, 0. ]))
--
ToddHunter - 2013-12-18