def violin_stats(X, method, points=100):
 vpstats = []
 X = _reshape_2D(X)
 for x in X:
  stats = {}
  min_val = np.min(x)
  max_val = np.max(x)
  coords = np.linspace(min_val, max_val, points)
  stats[u'vals'] = method(x, coords)
  stats[u'coords'] = coords
  stats[u'mean'] = np.mean(x)
  stats[u'median'] = np.median(x)
  stats[u'min'] = min_val
  stats[u'max'] = max_val
  vpstats.append(stats)
 return vpstats

def violin_stats ( X , method , points = 100 ) : vpstats = [ ] X = _reshape_2D ( X ) for x in X : stats = { } min_val = np . min ( x ) max_val = np . max ( x ) coords = np . linspace ( min_val , max_val , points ) stats [ u'vals' ] = method ( x , coords ) stats [ u'coords' ] = coords stats [ u'mean' ] = np . mean ( x ) stats [ u'median' ] = np . median ( x ) stats [ u'min' ] = min_val stats [ u'max' ] = max_val vpstats . append ( stats ) return vpstats
returns a list of dictionaries of data which can be used to draw a series of violin plots .