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

This topic: ALMA > TWikiUsers > ToddHunter > CasaExtensions > AverageTheRepeatedValues
Topic revision: 2014-03-18, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback