> - I don't follow what the snippet of code below is doing: > > if cbook.iterable(value): > vtype = 'array' > val = ma.asarray(value).astype(np.float) > else: > vtype = 'scalar' > val = ma.array([value]).astype(np.float) >
The idea is that the norm __call__ method should return a scalar when given a scalar input, or an array when given a sequence input. It is easiest to do the calculation with masked arrays or ndarrays, however, so inputs are converted, keeping track of whether it is a scalar or not, so that if it is a scalar, the output can be converted from 1-element array back to a scalar. Eric ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users